mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 00:40:58 +01:00
Implemented graceful closing of the GLFW window, along with emulation.
This commit is contained in:
parent
e4905143c8
commit
ccb59a9d28
3 changed files with 9 additions and 1 deletions
|
@ -34,7 +34,7 @@ int __cdecl main(int argc, char **argv) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(true) {
|
while (emu_window->IsOpen()) {
|
||||||
Core::RunLoop();
|
Core::RunLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,11 @@ void EmuWindow_GLFW::OnKeyEvent(GLFWwindow* win, int key, int scancode, int acti
|
||||||
HID_User::PadUpdateComplete();
|
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 constructor
|
||||||
EmuWindow_GLFW::EmuWindow_GLFW() {
|
EmuWindow_GLFW::EmuWindow_GLFW() {
|
||||||
keyboard_id = KeyMap::NewDeviceId();
|
keyboard_id = KeyMap::NewDeviceId();
|
||||||
|
|
|
@ -27,6 +27,9 @@ public:
|
||||||
|
|
||||||
static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods);
|
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;
|
void ReloadSetKeymaps() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue