-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
58 lines (41 loc) · 1012 Bytes
/
main.c
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
58
#include "inkview.h"
#include "events.h"
#include "pbdoom/render.h"
#include "pbdoom/gui.c"
#include "sdldoom-1.10/i_main.h"
#include "sdldoom-1.10/doomdef.h"
char **new_argv;
int new_argc;
void setup_app() {
SetPanelType(PANEL_DISABLED);
ClearScreen();
/* int sw = 1072, sh = 1448, dpi = 300; // Touch HD 3 (632) */
int sw = 0, sh = 0, dpi = 0; // default (use current screen settings)
gui_init(sw, sh, dpi);
FullUpdate();
}
static int main_handler(int event_type, int a, int b)
{
if (EVT_INIT == event_type) {
setup_app();
doom_main(new_argc, new_argv);
}
else if (EVT_KEYPRESS == event_type) {
CloseApp();
}
else if (EVT_EXIT == event_type) {
pbdoom_event e = { PBDOOM_EVENT_EXIT, 0, 0 };
pbdoom_post_event(e);
return 1; // we will exit ourselves on next tic
} else {
return gui_handle(event_type, a, b);
}
return 0;
}
int main (int argc, char* argv[])
{
new_argc = argc;
new_argv = argv;
InkViewMain(main_handler);
return 0;
}