Initialize SDL image and check initialization return
This commit is contained in:
parent
2453bcdcc1
commit
12cf10a35c
1 changed files with 13 additions and 1 deletions
|
@ -27,15 +27,27 @@
|
||||||
#include "control/RPGEdit.hpp"
|
#include "control/RPGEdit.hpp"
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
#include <SDL_image.h>
|
||||||
#include <SDL_main.h>
|
#include <SDL_main.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
int main(__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) {
|
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();
|
RPGEdit::Control::RPGEdit().run();
|
||||||
|
|
||||||
|
IMG_Quit();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Reference in a new issue