O'Reilly logo

Learning Vulkan by Parminder Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resizing the display window

When a display window resizes, the Vulkan application is given the new window dimensions to re-paint the drawing images. On the Windows platform, the WM_SIZE message of the associated window's procedure can be used to indicate the change in the dimension size as shown in the following highlighted code. The new changes added to the WndProc() function are highlighted with bold; the new dimension size is updated to the VulkanSwapChain class using the setSwapChainExtent() function, which will be later used to recreate the new swapchain images with the indicated dimensions:

LRESULT CALLBACK VulkanRenderer::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { VulkanApplication* appObj = VulkanApplication::GetInstance(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required