MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / ToggleFullscreen

Method ToggleFullscreen

src/app/DeviceManager.cpp:853–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853void 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
880void DeviceManager::KeyboardUpdate(int key, int scancode, int action, int mods)
881{

Callers

nothing calls this directly

Calls 1

ClearFullscreenTopmostFunction · 0.85

Tested by

no test coverage detected