source: trunk/src/test-map.cpp @ 103

Last change on this file since 103 was 103, checked in by sam, 11 years ago

Reimplement the SDL input as a ticked asset object.

  • Property svn:keywords set to Id
File size: 753 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
20int main(int argc, char **argv)
21{
22    Video *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.