summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rpgedit.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rpgedit.cpp b/src/rpgedit.cpp
index 6ef5dd3..fc3fe5f 100644
--- a/src/rpgedit.cpp
+++ b/src/rpgedit.cpp
@@ -27,15 +27,27 @@
#include "control/RPGEdit.hpp"
#include <SDL.h>
+#include <SDL_image.h>
#include <SDL_main.h>
+#include <iostream>
+
extern "C"
int main(__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) {
- SDL_Init(SDL_INIT_VIDEO);
+ if (SDL_Init(SDL_INIT_VIDEO) < 0) {
+ std::cerr << "Unable to initialize SDL" << std::endl;
+ return 1;
+ }
+
+ if (!(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)) {
+ std::cerr << "Unable to initialize PNG loader" << std::endl;
+ return 1;
+ }
RPGEdit::Control::RPGEdit().run();
+ IMG_Quit();
SDL_Quit();
return 0;