diff options
Diffstat (limited to '')
| -rw-r--r-- | src/citra/citra.cpp | 2 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_glfw.cpp | 5 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_glfw.h | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 46781defa..6ac5c5dc5 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -34,7 +34,7 @@ int __cdecl main(int argc, char **argv) { | |||
| 34 | return -1; | 34 | return -1; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | while(true) { | 37 | while (emu_window->IsOpen()) { |
| 38 | Core::RunLoop(); | 38 | Core::RunLoop(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index 6cdba2b87..079c5356d 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp | |||
| @@ -29,6 +29,11 @@ void EmuWindow_GLFW::OnKeyEvent(GLFWwindow* win, int key, int scancode, int acti | |||
| 29 | HID_User::PadUpdateComplete(); | 29 | HID_User::PadUpdateComplete(); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | /// Whether the window is still open, and a close request hasn't yet been sent | ||
| 33 | const bool EmuWindow_GLFW::IsOpen() { | ||
| 34 | return glfwWindowShouldClose(m_render_window) != 0; | ||
| 35 | } | ||
| 36 | |||
| 32 | /// EmuWindow_GLFW constructor | 37 | /// EmuWindow_GLFW constructor |
| 33 | EmuWindow_GLFW::EmuWindow_GLFW() { | 38 | EmuWindow_GLFW::EmuWindow_GLFW() { |
| 34 | keyboard_id = KeyMap::NewDeviceId(); | 39 | keyboard_id = KeyMap::NewDeviceId(); |
diff --git a/src/citra/emu_window/emu_window_glfw.h b/src/citra/emu_window/emu_window_glfw.h index d38a11c2c..638e026ef 100644 --- a/src/citra/emu_window/emu_window_glfw.h +++ b/src/citra/emu_window/emu_window_glfw.h | |||
| @@ -27,6 +27,9 @@ public: | |||
| 27 | 27 | ||
| 28 | static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods); | 28 | static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods); |
| 29 | 29 | ||
| 30 | /// Whether the window is still open, and a close request hasn't yet been sent | ||
| 31 | const bool IsOpen(); | ||
| 32 | |||
| 30 | void ReloadSetKeymaps() override; | 33 | void ReloadSetKeymaps() override; |
| 31 | 34 | ||
| 32 | private: | 35 | private: |