-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
39 lines (32 loc) · 1.01 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
#include "Tetris.h"
#include "engine/GameEngine.h"
bool UpdateFrame();
bool UpdateRender();
Tetris* g_tetris = NULL;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iShowCmd)
{
GameEngine::instance()->SetValue(GEK_LOGFILE, "tetris.log");
GameEngine::instance()->SetValue(GEK_WINTITLE, "Tetris");
GameEngine::instance()->SetValue(GEK_FPS, 100);
GameEngine::instance()->SetValue(GEK_SCREENWIDTH, 465);
GameEngine::instance()->SetValue(GEK_SCREENHEIGHT, 600);
GameEngine::instance()->SetValue(GEK_FRAMEFUNC, &UpdateFrame);
GameEngine::instance()->SetValue(GEK_RENDERFUNC, &UpdateRender);
if (GameEngine::instance()->Initiate()) {
g_tetris = new Tetris(GameEngine::instance());
g_tetris->Start();
GameEngine::instance()->Start();
}
GameEngine::instance()->Shutdown();
return 0;
}
bool UpdateFrame()
{
g_tetris->UpdateFrame();
return false;
}
bool UpdateRender()
{
g_tetris->UpdateRender();
return false;
}