-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_loops.h
57 lines (40 loc) · 981 Bytes
/
main_loops.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MAINLOOP
#define MAINLOOP
#include "configs.h"
#include "control_loop.h"
#include <iostream>
#include "render.h"
using namespace std;
void update ();
int ww, wh;
PIMAGE coltmp1, coltmp2;
class CLoop {
bool whiling;
public:
CLoop (int width, int heidth, string name = "Martys Program") {
whiling = false;
pRender -> Create (width, heidth, name);
ww = width;
wh = heidth;
coltmp1 = newimage (ww, wh);
coltmp2 = newimage (ww, wh);
}
void start () {
whiling = true;
while (whiling) {
cleardevice ();
call_update ();
delay_fps (60);
}
}
void stop_loop () {
whiling = false;
}
void continue_loop () {
whiling = true;
}
void call_update () {
update ();
}
};
#endif