Last change
on this file since 105 was
105,
checked in by sam, 12 years ago
|
Create a helper class for easy scene setup. Highly reduces the number
of includes in a few source files.
|
-
Property svn:keywords set to
Id
|
File size:
756 bytes
|
Line | |
---|
1 | // |
---|
2 | // Deus Hax (working title) |
---|
3 | // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> |
---|
4 | // |
---|
5 | |
---|
6 | #if defined HAVE_CONFIG_H |
---|
7 | # include "config.h" |
---|
8 | #endif |
---|
9 | |
---|
10 | #include <cstdio> |
---|
11 | #include <cmath> |
---|
12 | |
---|
13 | #include <SDL.h> |
---|
14 | |
---|
15 | #include "sdlvideo.h" |
---|
16 | #include "sdlinput.h" |
---|
17 | #include "game.h" |
---|
18 | #include "ticker.h" |
---|
19 | |
---|
20 | int main(int argc, char **argv) |
---|
21 | { |
---|
22 | SdlVideo *video = new SdlVideo("Deus Hax", 640, 480); |
---|
23 | Game *game = new Game("maps/testmap.tmx"); |
---|
24 | |
---|
25 | /* Register the input driver */ |
---|
26 | new SdlInput(game); |
---|
27 | |
---|
28 | while (!game->Finished()) |
---|
29 | { |
---|
30 | Ticker::TickGame(33.33333f); |
---|
31 | |
---|
32 | video->PreRender(); |
---|
33 | Ticker::TickRender(33.33333f); |
---|
34 | game->Render(); |
---|
35 | video->PostRender(33.33333f); |
---|
36 | } |
---|
37 | |
---|
38 | delete game; |
---|
39 | delete video; |
---|
40 | |
---|
41 | return EXIT_SUCCESS; |
---|
42 | } |
---|
43 | |
---|
Note: See
TracBrowser
for help on using the repository browser.