From a5ac4999b4dea546a7ef824669ab1809224b6448 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Mar 2021 16:25:58 -0800 Subject: Refactor `gfx` to surface `CommandBuffer` interface. (#1735) * Refactor `gfx` to surface `CommandBuffer` interface. * Fixes. * Fix code review issues, and make vulkan runnable on devices without VK_EXT_extended_dynamic_states. * Update solution files * Move out-of-date examples to examples/experimental Co-authored-by: Yong He --- tools/graphics-app-framework/windows/win-window.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tools/graphics-app-framework/windows/win-window.cpp') diff --git a/tools/graphics-app-framework/windows/win-window.cpp b/tools/graphics-app-framework/windows/win-window.cpp index 3bbf2575a..a86e360d0 100644 --- a/tools/graphics-app-framework/windows/win-window.cpp +++ b/tools/graphics-app-framework/windows/win-window.cpp @@ -243,7 +243,7 @@ static ATOM createWindowClassAtom() windowClassDesc.cbWndExtra = 0; windowClassDesc.hInstance = (HINSTANCE) GetModuleHandle(0); windowClassDesc.hIcon = 0; - windowClassDesc.hCursor = 0; + windowClassDesc.hCursor = LoadCursorW(NULL, IDC_ARROW); windowClassDesc.hbrBackground = 0; windowClassDesc.lpszMenuName = 0; windowClassDesc.lpszClassName = L"SlangGraphicsWindow"; @@ -269,22 +269,32 @@ Window* createWindow(WindowDesc const& desc) OSString windowTitle(desc.title); DWORD windowExtendedStyle = 0; - DWORD windowStyle = 0; + DWORD windowStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU; HINSTANCE instance = (HINSTANCE) GetModuleHandle(0); + RECT windowRect; + windowRect.left = 0; + windowRect.top = 0; + windowRect.bottom = desc.height; + windowRect.right = desc.width; + AdjustWindowRect(&windowRect, windowStyle, FALSE); + HWND windowHandle = CreateWindowExW( windowExtendedStyle, (LPWSTR) getWindowClassAtom(), windowTitle, windowStyle, - 0, 0, // x, y - desc.width, desc.height, + CW_USEDEFAULT, + 0, // x, y + windowRect.right, + windowRect.bottom, NULL, // parent NULL, // menu instance, window); + if(!windowHandle) { delete window; -- cgit v1.2.3