|
|
|
@ -127,7 +127,11 @@ Sdl2Application::~Sdl2Application() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int Sdl2Application::exec() { |
|
|
|
int Sdl2Application::exec() { |
|
|
|
while(!(flags & Flag::Exit)) { |
|
|
|
while(!(flags & Flag::Exit)) mainLoop(); |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Sdl2Application::mainLoop() { |
|
|
|
SDL_Event event; |
|
|
|
SDL_Event event; |
|
|
|
|
|
|
|
|
|
|
|
while(SDL_PollEvent(&event)) { |
|
|
|
while(SDL_PollEvent(&event)) { |
|
|
|
@ -167,7 +171,7 @@ int Sdl2Application::exec() { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case SDL_QUIT: return 0; |
|
|
|
case SDL_QUIT: return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -177,9 +181,6 @@ int Sdl2Application::exec() { |
|
|
|
} else Corrade::Utility::sleep(5); |
|
|
|
} else Corrade::Utility::sleep(5); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Sdl2Application::setMouseLocked(bool enabled) { |
|
|
|
void Sdl2Application::setMouseLocked(bool enabled) { |
|
|
|
SDL_SetWindowGrab(window, enabled ? SDL_TRUE : SDL_FALSE); |
|
|
|
SDL_SetWindowGrab(window, enabled ? SDL_TRUE : SDL_FALSE); |
|
|
|
SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); |
|
|
|
SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); |
|
|
|
|