diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -5,11 +5,22 @@ #include <SDL_image.h> +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(!init_sdl_image()) + return 1; + video::width = 1280; video::height = 720; video::init(); - IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG); #ifdef WIN32 win32_gl_init(); @@ -22,7 +33,6 @@ int main(int argc, char **argv) { SDL_WarpMouse(video::width/2, video::height/2); scene->last_time = SDL_GetTicks(); scene->update(); - std::cout << "foo" << std::endl; while(scene->running) { scene->events(); scene->render(); |