Create a MainWindow class that manages the main win32 window of the application

This commit is contained in:
Magnus Norddahl 2022-05-14 02:25:56 +02:00 committed by Christoph Oelckers
commit 6670bc09b9
24 changed files with 1187 additions and 1108 deletions

View file

@ -7,16 +7,14 @@
#endif
#include "volk/volk.h"
extern HWND Window;
#include "i_mainwindow.h"
void I_GetVulkanDrawableSize(int *width, int *height)
{
assert(Window);
RECT clientRect = { 0 };
GetClientRect(Window, &clientRect);
GetClientRect(mainwindow.GetHandle(), &clientRect);
if (width != nullptr)
{
@ -67,7 +65,7 @@ bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface)
windowCreateInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
windowCreateInfo.pNext = nullptr;
windowCreateInfo.flags = 0;
windowCreateInfo.hwnd = Window;
windowCreateInfo.hwnd = mainwindow.GetHandle();
windowCreateInfo.hinstance = GetModuleHandle(nullptr);
const VkResult result = vkCreateWin32SurfaceKHR(instance, &windowCreateInfo, nullptr, surface);