forked from ScatteredRay/SurfaceTension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
81 lines (60 loc) · 1.53 KB
/
main.cpp
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <Box2D.h>
#include <stdio.h>
#include <list>
#include "script.h"
#include "game.h"
#include "input.h"
#include "player.h"
#include <SDL.h>
#include "ploy/symbol.h"
#include "systemmanager.h"
#include "coresystems.h"
#include "glrender.h"
#include "camera.h"
#include "vrender.h"
using namespace std;
symbol_table* g_symbol_table;
GLvoid DrawScene();
void OnTimer(int value);
void DestroyPhysics()
{
delete PhysicsWorld;
PhysicsWorld = NULL;
}
#undef main // SDL redifines this as SDL_main, we want to use our own.
int main(int argc, char* argv[])
{
g_symbol_table = init_symbol_table();
SystemManager* SM = create_system_manager(g_symbol_table);
declare_sdl_system(SM);
declare_tick_system(SM);
declare_glut_system(SM);
declare_2D_camera_system(SM);
declare_gl_render_system(SM);
declare_vector_render_system(SM);
declare_script_system(SM);
set_glut_system_run(SM);
system_manager_init_systems(SM);
scheme_load_file_name(scheme_vm, "player.scm");
scheme_load_file_name(scheme_vm, "Entry.scm");
LocalPlayerInput = InitPlayerInput();
system_manager_run(SM);
//InitPhysics();
// Doing this as close to the main loop as possible to not get alot of init mixed in with my first tick.
DestroyPlayer(MainPlayer);
DestroyPlayerInput(LocalPlayerInput);
if(PhysicsWorld)
DestroyPhysics();
system_manager_shutdown_systems(SM);
destroy_system_manager(SM);
destroy_symbol_table(g_symbol_table);
}
GLvoid DrawScene()
{
}
void OnTimer(int)
{
glutTimerFunc(20, OnTimer, 1);
}