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
RevLine 
[100]1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
[13]5
[100]6#if defined HAVE_CONFIG_H
7#   include "config.h"
8#endif
9
[98]10#include <cstdio>
11#include <cmath>
12
[13]13#include <SDL.h>
14
[90]15#include "sdlvideo.h"
[103]16#include "sdlinput.h"
[79]17#include "game.h"
[96]18#include "ticker.h"
[14]19
[38]20int main(int argc, char **argv)
21{
[90]22    Video *video = new SdlVideo("Deus Hax", 640, 480);
[93]23    Game *game = new Game("maps/testmap.tmx");
[13]24
[103]25    /* Register the input driver */
26    new SdlInput(game);
27
[102]28    while (!game->Finished())
[20]29    {
[96]30        Ticker::TickGame(33.33333f);
31
32        video->PreRender();
33        Ticker::TickRender(33.33333f);
[79]34        game->Render();
[93]35        video->PostRender(33.33333f);
[13]36    }
[14]37
[79]38    delete game;
[18]39    delete video;
[14]40
[18]41    return EXIT_SUCCESS;
[13]42}
43
Note: See TracBrowser for help on using the repository browser.