Commit 0a380037 authored by cutealien's avatar cutealien

Fix incorrect cursorpos for resizable windows on Windows Vista (found and patched by buffer)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3017 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b0bc19fd
Changes in 1.7
- Fix incorrect cursorpos for resizable windows on Windows Vista (found and patched by buffer)
- Change the beginScene window parameter from void* to SExposedVideoData&. This will allow to manage contexts for OpenGL at some point.
......
......@@ -988,6 +988,8 @@ void CIrrDeviceWin32::setResizable(bool resize)
SetWindowPos(HWnd, HWND_TOP, windowLeft, windowTop, realWidth, realHeight,
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_SHOWWINDOW);
static_cast<CCursorControl*>(CursorControl)->updateBorderSize(CreationParams.Fullscreen, resize);
}
......
......@@ -120,11 +120,7 @@ namespace irr
if (WindowSize.Height!=0)
InvWindowSize.Height = 1.0f / WindowSize.Height;
if (!fullscreen)
{
BorderX = GetSystemMetrics(SM_CXDLGFRAME);
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME);
}
updateBorderSize(fullscreen, false);
}
//! Changes the visible state of the mouse cursor.
......@@ -263,6 +259,28 @@ namespace irr
InvWindowSize.Height = 0.f;
}
/** Used to notify the cursor that the window resizable settings changed. */
void updateBorderSize(bool fullscreen, bool resizable)
{
if (!fullscreen)
{
if (resizable)
{
BorderX = GetSystemMetrics(SM_CXSIZEFRAME);
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME);
}
else
{
BorderX = GetSystemMetrics(SM_CXDLGFRAME);
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME);
}
}
else
{
BorderX = BorderY = 0;
}
}
private:
//! Updates the internal cursor position
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment