diff options
author | Tony Wasserka <neobrainx@gmail.com> | 2014-10-18 01:07:04 +0200 |
---|---|---|
committer | Tony Wasserka <neobrainx@gmail.com> | 2014-10-18 01:07:04 +0200 |
commit | d32ea3b9773de22188857d6dff5566ef8821d120 (patch) | |
tree | a87a5ae1344688c6d90fd23784b6c975405d6727 /src | |
parent | Merge pull request #113 from neobrain/opengl_refactor (diff) | |
parent | Implemented graceful closing of the GLFW window, along with emulation. (diff) | |
download | yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar.gz yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar.bz2 yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar.lz yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar.xz yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.tar.zst yuzu-d32ea3b9773de22188857d6dff5566ef8821d120.zip |
Diffstat (limited to 'src')
-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) { return -1; } - while(true) { + while (emu_window->IsOpen()) { Core::RunLoop(); } 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 HID_User::PadUpdateComplete(); } +/// Whether the window is still open, and a close request hasn't yet been sent +const bool EmuWindow_GLFW::IsOpen() { + return glfwWindowShouldClose(m_render_window) != 0; +} + /// EmuWindow_GLFW constructor EmuWindow_GLFW::EmuWindow_GLFW() { 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: static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods); + /// Whether the window is still open, and a close request hasn't yet been sent + const bool IsOpen(); + void ReloadSetKeymaps() override; private: |