| 851 | } |
| 852 | |
| 853 | void DeviceManager::ToggleFullscreen() |
| 854 | { |
| 855 | if (glfwGetWindowMonitor(m_Window) != nullptr) |
| 856 | { |
| 857 | // Fullscreen → windowed: restore previous windowed state. |
| 858 | glfwSetWindowMonitor(m_Window, nullptr, m_PrevWindowX, m_PrevWindowY, m_PrevWindowWidth, m_PrevWindowHeight, 0); |
| 859 | } |
| 860 | else |
| 861 | { |
| 862 | // Windowed → fullscreen. Save current windowed state for restore. |
| 863 | glfwGetWindowPos(m_Window, &m_PrevWindowX, &m_PrevWindowY); |
| 864 | glfwGetWindowSize(m_Window, &m_PrevWindowWidth, &m_PrevWindowHeight); |
| 865 | |
| 866 | GLFWmonitor* monitor = GetCurrentMonitor(); |
| 867 | const GLFWvidmode* mode = glfwGetVideoMode(monitor); |
| 868 | int monX, monY; |
| 869 | glfwGetMonitorPos(monitor, &monX, &monY); |
| 870 | |
| 871 | // glfwSetWindowMonitor fires the framebuffer size callback so UpdateWindowSize |
| 872 | // picks up the monitor-native resolution and calls ResizeSwapChain. |
| 873 | glfwSetWindowMonitor(m_Window, monitor, monX, monY, mode->width, mode->height, mode->refreshRate); |
| 874 | |
| 875 | if (!m_DeviceParams.fullscreenAlwaysOnTop) |
| 876 | ClearFullscreenTopmost(m_Window); |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | void DeviceManager::KeyboardUpdate(int key, int scancode, int action, int mods) |
| 881 | { |
nothing calls this directly
no test coverage detected