mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 23:54:37 +00:00
Merged implementation for Win32.
This commit is contained in:
parent
8109470e72
commit
742299faaa
@ -846,6 +846,9 @@ their skills. Special thanks go out to:</p>
|
|||||||
<li>Ralph Eastwood, for the initial design and implementation of the gamma
|
<li>Ralph Eastwood, for the initial design and implementation of the gamma
|
||||||
correction API</li>
|
correction API</li>
|
||||||
|
|
||||||
|
<li>GeO4d, for the implementation of cursor enter/leave notifications on
|
||||||
|
Win32.</li>
|
||||||
|
|
||||||
<li>Gerald Franz, who made GLFW compile under IRIX, and supplied patches
|
<li>Gerald Franz, who made GLFW compile under IRIX, and supplied patches
|
||||||
for the X11 keyboard translation routine</li>
|
for the X11 keyboard translation routine</li>
|
||||||
|
|
||||||
|
@ -268,6 +268,7 @@ typedef struct _GLFWwindowWin32
|
|||||||
// Various platform specific internal variables
|
// Various platform specific internal variables
|
||||||
int desiredRefreshRate; // Desired vertical monitor refresh rate
|
int desiredRefreshRate; // Desired vertical monitor refresh rate
|
||||||
GLboolean cursorCentered;
|
GLboolean cursorCentered;
|
||||||
|
GLboolean cursorInside;
|
||||||
int oldMouseX, oldMouseY;
|
int oldMouseX, oldMouseY;
|
||||||
} _GLFWwindowWin32;
|
} _GLFWwindowWin32;
|
||||||
|
|
||||||
|
@ -1021,6 +1021,26 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
_glfwInputCursorMotion(window, x, y);
|
_glfwInputCursorMotion(window, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!window->Win32.cursorInside)
|
||||||
|
{
|
||||||
|
TRACKMOUSEEVENT tme;
|
||||||
|
ZeroMemory(&tme, sizeof(tme));
|
||||||
|
tme.cbSize = sizeof(tme);
|
||||||
|
tme.dwFlags = TME_LEAVE;
|
||||||
|
tme.hwndTrack = window->Win32.handle;
|
||||||
|
TrackMouseEvent(&tme);
|
||||||
|
|
||||||
|
window->Win32.cursorInside = GL_TRUE;
|
||||||
|
_glfwInputCursorEnter(window, GL_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_MOUSELEAVE:
|
||||||
|
{
|
||||||
|
window->Win32.cursorInside = GL_FALSE;
|
||||||
|
_glfwInputCursorEnter(window, GL_FALSE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user