From 713ea07558ad20f8955b08eb6fbf7bc2f9df1a23 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 10 Feb 2015 15:51:33 +0100 Subject: [PATCH] SDL hints need to be set before initialization --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1831257..eb07970 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -168,6 +168,9 @@ static void showInitError(const std::string &msg) int main(int argc, char *argv[]) { + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); + SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); + /* initialize SDL first */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { @@ -246,9 +249,6 @@ int main(int argc, char *argv[]) SDL_Surface *iconImg = IMG_Load_RW(iconSrc, SDL_TRUE); - SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); - SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); - SDL_Window *win; Uint32 winFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_INPUT_FOCUS;