summaryrefslogtreecommitdiffstats
path: root/tools/graphics-app-framework/windows/win-window.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-03-04 16:25:58 -0800
committerGitHub <noreply@github.com>2021-03-04 16:25:58 -0800
commita5ac4999b4dea546a7ef824669ab1809224b6448 (patch)
tree15bb22eb98a94f7f81489deef55396461501d3dc /tools/graphics-app-framework/windows/win-window.cpp
parent13ff0bd345990c0fdfb7b52ebd5339cddb04889e (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'tools/graphics-app-framework/windows/win-window.cpp')
-rw-r--r--tools/graphics-app-framework/windows/win-window.cpp18
1 files changed, 14 insertions, 4 deletions
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;