diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -1,9 +1,10 @@ #include "video.h" -#include "scene.h" +#include "game.h" #include "gl.h" #include <SDL_image.h> +#include <boost/format.hpp> bool init_sdl_image() { int real_flags = IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG); @@ -15,6 +16,11 @@ bool init_sdl_image() { } int main(int argc, char **argv) { + if(argc != 3) { + std::cout << (boost::format("Usage: %s HOST PORT") % argv[0]).str() << std::endl; + return 1; + } + if(!init_sdl_image()) return 1; @@ -26,22 +32,13 @@ int main(int argc, char **argv) { win32_gl_init(); #endif - Scene *scene = new Scene(); - SDL_ShowCursor(SDL_DISABLE); SDL_EnableUNICODE(1); - SDL_WarpMouse(video::width/2, video::height/2); - scene->last_time = SDL_GetTicks(); - scene->update(); - while(scene->running) { - scene->events(); - scene->render(); + Game& game = Game::get_instance(); - SDL_Delay(1); - } + game.run(argv[1], argv[2]); - delete scene; video::free(); return 0; |