-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
51 lines (38 loc) · 1.21 KB
/
Main.cpp
File metadata and controls
51 lines (38 loc) · 1.21 KB
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
#include "GUIEditorApp.h"
#include "GUIEditorLib.h"
#include "ContentFile.h"
#include "TimerMan.h"
using namespace RTE;
extern "C" { FILE __iob_func[3] = { *stdin, *stdout, *stderr }; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Quit Handler for Allegro.
/// </summary>
void QuitHandler(void) { g_GUIEditor.OnQuitButton(); }
END_OF_FUNCTION(QuitHandler)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Entry point for the GUI editor app.
/// </summary>
int main(int argc, char *argv[]) {
allegro_init();
// Enable the exit button on the window
LOCK_FUNCTION(QuitHandler);
set_close_button_callback(QuitHandler);
new TimerMan();
g_TimerMan.Create();
new GUIEditorApp();
if (!g_GUIEditor.Initialize()) {
std::exit(EXIT_FAILURE);
}
while (true) {
if (!g_GUIEditor.Update()) {
break;
}
}
g_TimerMan.Destroy();
ContentFile::FreeAllLoaded();
std::exit(EXIT_SUCCESS);
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return main(__argc, __argv); }