aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/application.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp
index f9be797f..55edd69c 100644
--- a/src/menu/application.cpp
+++ b/src/menu/application.cpp
@@ -102,7 +102,7 @@ namespace usdx
SDL_Event event;
EventManager event_manager;
MouseManager mouse_manager(event_manager);
- boost::thread event_thread(boost::bind(&EventManager::handle_events, &event_manager));
+ event_thread = boost::thread(boost::bind(&EventManager::handle_events, &event_manager));
SoftwareMousePointer pointer(this, &event_manager);
LoadingFrame frame(this);
@@ -121,14 +121,12 @@ namespace usdx
while (event_manager.available() && SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
- running = false;
- event_thread.interrupt();
+ quit();
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_q) {
- running = false;
- event_thread.interrupt();
+ quit();
break;
}
@@ -214,6 +212,12 @@ namespace usdx
SDL_ShowCursor(SDL_ENABLE);
}
+ void Application::quit(void)
+ {
+ running = false;
+ event_thread.interrupt();
+ }
+
const int Application::get_frames_per_second(void) const
{
return frames_per_second;