Debian Codegraph @

Tests/SuspendTest/suspend.cpp

raw
1 #include <ClanLib/core.h>
2 #include <ClanLib/application.h>
3
4 #include <iostream>
5
6 using namespace std;
7
8 void t() {
9 cerr << "Current time: " << CL_System::get_time() << "\n";
10 }
11
12 void w() {
13 cerr << "Sleeping for 100ms\n";
14 CL_System::keep_alive(100);
15 }
16
17 void s() {
18 cerr << "Suspending\n";
19 CL_System::suspend_time();
20 }
21
22 void r() {
23 cerr << "Resuming\n";
24 CL_System::resume_time();
25 }
26
27 struct App : public CL_ClanApplication {
28 int main(int, char**) {
29 CL_SetupCore::init();
30
31 while (CL_System::get_time() % 100 != 0)
32 CL_System::sleep(1);
33
34 t();
35 w();
36 t();
37 s();
38 t();
39 w();
40 t();
41 r();
42 t();
43 w();
44 t();
45 s();
46 t();
47 w();
48 t();
49 r();
50 t();
51 w();
52 t();
53
54 CL_SetupCore::deinit();
55 return 0;
56 }
57 } app;