blob: 05eddc187481735782be0898b9499c90cdb90fa2 (
plain)
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 "jin.h"
using namespace JinEngine::Game;
using namespace JinEngine::Graphics;
using namespace JinEngine::Input;
ParticleSystem* p;
void onLoad()
{
}
void onEvent(Event* e)
{
static Game* game = Game::get();
if (e->type == EventType::QUIT)
game->stop();
}
void onUpdate(int ms)
{
}
void onDraw()
{
glClear(GL_COLOR_BUFFER_BIT);
}
int main(int argc, char* argv[])
{
Game* game = Game::get();
Game::Setting setting;
setting.loader = onLoad;
setting.eventHandler = onEvent;
setting.updater = onUpdate;
setting.drawer = onDraw;
game->init(&setting);
Window* wnd = Window::get();
Window::Setting wndSetting;
wndSetting.width = 600;
wndSetting.height = 512;
wndSetting.title = "Jin v0.1.1";
wndSetting.fps = 60;
wndSetting.vsync = false;
wndSetting.fullscreen = false;
wndSetting.resizable = false;
wnd->init(&wndSetting);
game->run();
game->quit();
wnd->quit();
return 0;
}
|