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

Method UpdateWindowSize

src/app/DeviceManager.cpp:775–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775void DeviceManager::UpdateWindowSize()
776{
777 int width;
778 int height;
779 glfwGetWindowSize(m_Window, &width, &height);
780
781 if (width == 0 || height == 0)
782 {
783 // window is minimized
784 m_windowVisible = false;
785 return;
786 }
787
788 m_windowVisible = true;
789
790 m_windowIsInFocus = glfwGetWindowAttrib(m_Window, GLFW_FOCUSED) == 1;
791
792 if (int(m_DeviceParams.backBufferWidth) != width ||
793 int(m_DeviceParams.backBufferHeight) != height ||
794 (m_DeviceParams.vsyncEnabled != m_RequestedVSync && GetGraphicsAPI() == nvrhi::GraphicsAPI::VULKAN))
795 {
796 // window is not minimized, and the size has changed
797
798 BackBufferResizing();
799
800 m_DeviceParams.backBufferWidth = width;
801 m_DeviceParams.backBufferHeight = height;
802 m_DeviceParams.vsyncEnabled = m_RequestedVSync;
803
804 ResizeSwapChain();
805 BackBufferResized();
806 }
807
808 m_DeviceParams.vsyncEnabled = m_RequestedVSync;
809}
810
811void DeviceManager::WindowContentScaleCallback(float scaleX, float scaleY)
812{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected