mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Clarify WNDPROC window pointer handling
This commit is contained in:
parent
12903ee9b5
commit
1bf33a7402
|
@ -255,16 +255,19 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0);
|
||||
|
||||
switch (uMsg)
|
||||
if (!window)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
if (uMsg == WM_NCCREATE)
|
||||
{
|
||||
CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam;
|
||||
SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams);
|
||||
break;
|
||||
}
|
||||
|
||||
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_SETFOCUS:
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
|
@ -529,9 +532,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||
int xoff, yoff;
|
||||
MINMAXINFO* mmi = (MINMAXINFO*) lParam;
|
||||
|
||||
if (!window)
|
||||
break;
|
||||
|
||||
getFullWindowSize(getWindowStyle(window), getWindowExStyle(window),
|
||||
0, 0, &xoff, &yoff);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user