diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index e4add37..4963d5d 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -6,6 +6,9 @@ #include #include +int32_t CGxDeviceD3d::s_clientAdjustWidth; +int32_t CGxDeviceD3d::s_clientAdjustHeight; + D3DCMPFUNC CGxDeviceD3d::s_cmpFunc[] = { D3DCMP_LESSEQUAL, D3DCMP_EQUAL, @@ -924,6 +927,8 @@ bool CGxDeviceD3d::ICreateWindow(CGxFormat& format) { format.size.y // bottom }; AdjustWindowRectEx(&clientArea, dwStyle, false, 0); + CGxDeviceD3d::s_clientAdjustWidth = clientArea.right - format.size.x - clientArea.left; + CGxDeviceD3d::s_clientAdjustHeight = clientArea.bottom - format.size.y - clientArea.top; // TODO @@ -931,7 +936,8 @@ bool CGxDeviceD3d::ICreateWindow(CGxFormat& format) { int32_t height = format.size.y ? format.size.y : CW_USEDEFAULT; if (format.window && format.maximize != 1 && format.size.x && format.size.y) { - // TODO adjust width and height + width += CGxDeviceD3d::s_clientAdjustWidth; + height += CGxDeviceD3d::s_clientAdjustHeight; } this->m_hwnd = CreateWindowEx( diff --git a/src/gx/d3d/CGxDeviceD3d.hpp b/src/gx/d3d/CGxDeviceD3d.hpp index 8eeb71f..04a8c30 100644 --- a/src/gx/d3d/CGxDeviceD3d.hpp +++ b/src/gx/d3d/CGxDeviceD3d.hpp @@ -196,6 +196,8 @@ class CGxDeviceD3d : public CGxDevice { }; // Static variables + static int32_t s_clientAdjustWidth; + static int32_t s_clientAdjustHeight; static D3DCMPFUNC s_cmpFunc[]; static D3DCULL s_cullMode[]; static D3DBLEND s_dstBlend[];