#include "video.h" #include "game.h" #include "gl.h" #include #include bool init_sdl_image() { int real_flags = IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG); if(!(real_flags | IMG_INIT_PNG && real_flags | IMG_INIT_JPG)) { std::cerr << "Missing PNG or JPEG libraries" << std::endl; return false; } return true; } 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; video::width = 1280; video::height = 720; video::init(); #ifdef WIN32 win32_gl_init(); #endif SDL_ShowCursor(SDL_DISABLE); SDL_EnableUNICODE(1); Game& game = Game::get_instance(); game.run(argv[1], argv[2]); // free singleton to run destructors game.free(); video::free(); return 0; }