|
|
@ -31,14 +31,9 @@ |
|
|
|
#include "internal.h" |
|
|
|
#include "internal.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//************************************************************************
|
|
|
|
|
|
|
|
//**** GLFW internal functions ****
|
|
|
|
|
|
|
|
//************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We use versioned window class names in order not to cause conflicts
|
|
|
|
// We use versioned window class names in order not to cause conflicts
|
|
|
|
// between applications using different versions of GLFW
|
|
|
|
// between applications using different versions of GLFW
|
|
|
|
#define _GLFW_WNDCLASSNAME "GLFW27" |
|
|
|
#define _GLFW_WNDCLASSNAME "GLFW30" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
@ -120,7 +115,7 @@ static void setForegroundWindow( HWND hWnd ) |
|
|
|
while (hWnd != GetForegroundWindow() && try_count <= 3); |
|
|
|
while (hWnd != GetForegroundWindow() && try_count <= 3); |
|
|
|
|
|
|
|
|
|
|
|
// Restore the system minimize/restore animation setting
|
|
|
|
// Restore the system minimize/restore animation setting
|
|
|
|
(void) setMinMaxAnimations( old_animate ); |
|
|
|
setMinMaxAnimations(old_animate); |
|
|
|
|
|
|
|
|
|
|
|
// Try to modify the system settings (since this is now hopefully the
|
|
|
|
// Try to modify the system settings (since this is now hopefully the
|
|
|
|
// foreground process, we are probably allowed to do this)
|
|
|
|
// foreground process, we are probably allowed to do this)
|
|
|
@ -161,13 +156,9 @@ static _GLFWfbconfig *getFBConfigs( unsigned int *found ) |
|
|
|
*found = 0; |
|
|
|
*found = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.has_WGL_ARB_pixel_format) |
|
|
|
if (_glfwWin.has_WGL_ARB_pixel_format) |
|
|
|
{ |
|
|
|
|
|
|
|
count = getPixelFormatAttrib(1, WGL_NUMBER_PIXEL_FORMATS_ARB); |
|
|
|
count = getPixelFormatAttrib(1, WGL_NUMBER_PIXEL_FORMATS_ARB); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
count = _glfw_DescribePixelFormat(_glfwWin.DC, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); |
|
|
|
count = _glfw_DescribePixelFormat(_glfwWin.DC, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!count) |
|
|
|
if (!count) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -178,7 +169,7 @@ static _GLFWfbconfig *getFBConfigs( unsigned int *found ) |
|
|
|
result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count); |
|
|
|
result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count); |
|
|
|
if (!result) |
|
|
|
if (!result) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fprintf(stderr, "Out of memory"); |
|
|
|
fprintf(stderr, "Out of memory\n"); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -188,19 +179,17 @@ static _GLFWfbconfig *getFBConfigs( unsigned int *found ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Get pixel format attributes through WGL_ARB_pixel_format
|
|
|
|
// Get pixel format attributes through WGL_ARB_pixel_format
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only consider doublebuffered OpenGL pixel formats for windows
|
|
|
|
if (!getPixelFormatAttrib(i, WGL_SUPPORT_OPENGL_ARB) || |
|
|
|
if (!getPixelFormatAttrib(i, WGL_SUPPORT_OPENGL_ARB) || |
|
|
|
!getPixelFormatAttrib(i, WGL_DRAW_TO_WINDOW_ARB) || |
|
|
|
!getPixelFormatAttrib(i, WGL_DRAW_TO_WINDOW_ARB) || |
|
|
|
!getPixelFormatAttrib(i, WGL_DOUBLE_BUFFER_ARB)) |
|
|
|
!getPixelFormatAttrib(i, WGL_DOUBLE_BUFFER_ARB)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Only consider doublebuffered OpenGL pixel formats for windows
|
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( getPixelFormatAttrib( i, WGL_PIXEL_TYPE_ARB ) != WGL_TYPE_RGBA_ARB ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Only consider RGBA pixel formats
|
|
|
|
// Only consider RGBA pixel formats
|
|
|
|
|
|
|
|
if (getPixelFormatAttrib(i, WGL_PIXEL_TYPE_ARB) != WGL_TYPE_RGBA_ARB) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result[*found].redBits = getPixelFormatAttrib(i, WGL_RED_BITS_ARB); |
|
|
|
result[*found].redBits = getPixelFormatAttrib(i, WGL_RED_BITS_ARB); |
|
|
|
result[*found].greenBits = getPixelFormatAttrib(i, WGL_GREEN_BITS_ARB); |
|
|
|
result[*found].greenBits = getPixelFormatAttrib(i, WGL_GREEN_BITS_ARB); |
|
|
@ -219,28 +208,22 @@ static _GLFWfbconfig *getFBConfigs( unsigned int *found ) |
|
|
|
result[*found].stereo = getPixelFormatAttrib(i, WGL_STEREO_ARB); |
|
|
|
result[*found].stereo = getPixelFormatAttrib(i, WGL_STEREO_ARB); |
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.has_WGL_ARB_multisample) |
|
|
|
if (_glfwWin.has_WGL_ARB_multisample) |
|
|
|
{ |
|
|
|
|
|
|
|
result[*found].samples = getPixelFormatAttrib(i, WGL_SAMPLES_ARB); |
|
|
|
result[*found].samples = getPixelFormatAttrib(i, WGL_SAMPLES_ARB); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
result[*found].samples = 0; |
|
|
|
result[*found].samples = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Get pixel format attributes through old-fashioned PFDs
|
|
|
|
// Get pixel format attributes through old-fashioned PFDs
|
|
|
|
|
|
|
|
|
|
|
|
if (!_glfw_DescribePixelFormat(_glfwWin.DC, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd)) |
|
|
|
if (!_glfw_DescribePixelFormat(_glfwWin.DC, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd)) |
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only consider doublebuffered OpenGL pixel formats for windows
|
|
|
|
if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) || |
|
|
|
if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) || |
|
|
|
!(pfd.dwFlags & PFD_SUPPORT_OPENGL) || |
|
|
|
!(pfd.dwFlags & PFD_SUPPORT_OPENGL) || |
|
|
|
!(pfd.dwFlags & PFD_DOUBLEBUFFER)) |
|
|
|
!(pfd.dwFlags & PFD_DOUBLEBUFFER)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Only consider doublebuffered OpenGL pixel formats for windows
|
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -250,11 +233,9 @@ static _GLFWfbconfig *getFBConfigs( unsigned int *found ) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( pfd.iPixelType != PFD_TYPE_RGBA ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Only RGBA pixel formats considered
|
|
|
|
// Only RGBA pixel formats considered
|
|
|
|
|
|
|
|
if (pfd.iPixelType != PFD_TYPE_RGBA) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result[*found].redBits = pfd.cRedBits; |
|
|
|
result[*found].redBits = pfd.cRedBits; |
|
|
|
result[*found].greenBits = pfd.cGreenBits; |
|
|
|
result[*found].greenBits = pfd.cGreenBits; |
|
|
@ -295,14 +276,10 @@ static HGLRC createContext( HDC dc, const _GLFWwndconfig* wndconfig, int pixelFo |
|
|
|
int flags, i = 0, attribs[7]; |
|
|
|
int flags, i = 0, attribs[7]; |
|
|
|
|
|
|
|
|
|
|
|
if (!_glfw_DescribePixelFormat(dc, pixelFormat, sizeof(pfd), &pfd)) |
|
|
|
if (!_glfw_DescribePixelFormat(dc, pixelFormat, sizeof(pfd), &pfd)) |
|
|
|
{ |
|
|
|
|
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!_glfw_SetPixelFormat(dc, pixelFormat, &pfd)) |
|
|
|
if (!_glfw_SetPixelFormat(dc, pixelFormat, &pfd)) |
|
|
|
{ |
|
|
|
|
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.has_WGL_ARB_create_context) |
|
|
|
if (_glfwWin.has_WGL_ARB_create_context) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -323,14 +300,10 @@ static HGLRC createContext( HDC dc, const _GLFWwndconfig* wndconfig, int pixelFo |
|
|
|
flags = 0; |
|
|
|
flags = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (wndconfig->glForward) |
|
|
|
if (wndconfig->glForward) |
|
|
|
{ |
|
|
|
|
|
|
|
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; |
|
|
|
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wndconfig->glDebug) |
|
|
|
if (wndconfig->glDebug) |
|
|
|
{ |
|
|
|
|
|
|
|
flags |= WGL_CONTEXT_DEBUG_BIT_ARB; |
|
|
|
flags |= WGL_CONTEXT_DEBUG_BIT_ARB; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribs[i++] = WGL_CONTEXT_FLAGS_ARB; |
|
|
|
attribs[i++] = WGL_CONTEXT_FLAGS_ARB; |
|
|
|
attribs[i++] = flags; |
|
|
|
attribs[i++] = flags; |
|
|
@ -339,13 +312,9 @@ static HGLRC createContext( HDC dc, const _GLFWwndconfig* wndconfig, int pixelFo |
|
|
|
if (wndconfig->glProfile) |
|
|
|
if (wndconfig->glProfile) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE) |
|
|
|
if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE) |
|
|
|
{ |
|
|
|
|
|
|
|
flags = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; |
|
|
|
flags = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
flags = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; |
|
|
|
flags = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; |
|
|
|
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; |
|
|
|
attribs[i++] = flags; |
|
|
|
attribs[i++] = flags; |
|
|
@ -408,9 +377,7 @@ static int translateKey( WPARAM wParam, LPARAM lParam ) |
|
|
|
// right)
|
|
|
|
// right)
|
|
|
|
scan_code = MapVirtualKey(VK_RSHIFT, 0); |
|
|
|
scan_code = MapVirtualKey(VK_RSHIFT, 0); |
|
|
|
if (((lParam & 0x01ff0000) >> 16) == scan_code) |
|
|
|
if (((lParam & 0x01ff0000) >> 16) == scan_code) |
|
|
|
{ |
|
|
|
|
|
|
|
return GLFW_KEY_RSHIFT; |
|
|
|
return GLFW_KEY_RSHIFT; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GLFW_KEY_LSHIFT; |
|
|
|
return GLFW_KEY_LSHIFT; |
|
|
|
} |
|
|
|
} |
|
|
@ -420,9 +387,7 @@ static int translateKey( WPARAM wParam, LPARAM lParam ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
if (lParam & 0x01000000) |
|
|
|
if (lParam & 0x01000000) |
|
|
|
{ |
|
|
|
|
|
|
|
return GLFW_KEY_RCTRL; |
|
|
|
return GLFW_KEY_RCTRL; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Here is a trick: "Alt Gr" sends LCTRL, then RALT. We only
|
|
|
|
// Here is a trick: "Alt Gr" sends LCTRL, then RALT. We only
|
|
|
|
// want the RALT message, so we try to see if the next message
|
|
|
|
// want the RALT message, so we try to see if the next message
|
|
|
@ -452,9 +417,7 @@ static int translateKey( WPARAM wParam, LPARAM lParam ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
if (lParam & 0x01000000) |
|
|
|
if (lParam & 0x01000000) |
|
|
|
{ |
|
|
|
|
|
|
|
return GLFW_KEY_RALT; |
|
|
|
return GLFW_KEY_RALT; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GLFW_KEY_LALT; |
|
|
|
return GLFW_KEY_LALT; |
|
|
|
} |
|
|
|
} |
|
|
@ -464,9 +427,7 @@ static int translateKey( WPARAM wParam, LPARAM lParam ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
// Is this an extended key (i.e. right key)?
|
|
|
|
if (lParam & 0x01000000) |
|
|
|
if (lParam & 0x01000000) |
|
|
|
{ |
|
|
|
|
|
|
|
return GLFW_KEY_KP_ENTER; |
|
|
|
return GLFW_KEY_KP_ENTER; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GLFW_KEY_ENTER; |
|
|
|
return GLFW_KEY_ENTER; |
|
|
|
} |
|
|
|
} |
|
|
@ -545,13 +506,9 @@ static int translateKey( WPARAM wParam, LPARAM lParam ) |
|
|
|
|
|
|
|
|
|
|
|
// Make sure that the character is uppercase
|
|
|
|
// Make sure that the character is uppercase
|
|
|
|
if (_glfwLibrary.Sys.hasUnicode) |
|
|
|
if (_glfwLibrary.Sys.hasUnicode) |
|
|
|
{ |
|
|
|
|
|
|
|
wParam = (WPARAM) CharUpperW((LPWSTR) wParam); |
|
|
|
wParam = (WPARAM) CharUpperW((LPWSTR) wParam); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
wParam = (WPARAM) CharUpperA((LPSTR) wParam); |
|
|
|
wParam = (WPARAM) CharUpperA((LPSTR) wParam); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Valid ISO-8859-1 character?
|
|
|
|
// Valid ISO-8859-1 character?
|
|
|
|
if ((wParam >= 32 && wParam <= 126) || |
|
|
|
if ((wParam >= 32 && wParam <= 126) || |
|
|
@ -617,15 +574,11 @@ static void translateChar( DWORD wParam, DWORD lParam, int action ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Get next character from buffer
|
|
|
|
// Get next character from buffer
|
|
|
|
if (unicode) |
|
|
|
if (unicode) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputChar((int) unicode_buf[i], action); |
|
|
|
_glfwInputChar((int) unicode_buf[i], action); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputChar((int) char_buf[i], action); |
|
|
|
_glfwInputChar((int) char_buf[i], action); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
@ -698,9 +651,8 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
|
|
|
|
|
|
|
|
// Lock mouse, if necessary
|
|
|
|
// Lock mouse, if necessary
|
|
|
|
if (_glfwWin.oldMouseLockValid && _glfwWin.oldMouseLock) |
|
|
|
if (_glfwWin.oldMouseLockValid && _glfwWin.oldMouseLock) |
|
|
|
{ |
|
|
|
|
|
|
|
glfwDisable(GLFW_MOUSE_CURSOR); |
|
|
|
glfwDisable(GLFW_MOUSE_CURSOR); |
|
|
|
} |
|
|
|
|
|
|
|
_glfwWin.oldMouseLockValid = GL_FALSE; |
|
|
|
_glfwWin.oldMouseLockValid = GL_FALSE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -717,15 +669,13 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_glfwWin.fullscreen) |
|
|
|
if (_glfwWin.fullscreen) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Disallow screen saver and screen blanking if we are
|
|
|
|
// We are running in fullscreen mode, so disallow
|
|
|
|
// running in fullscreen mode
|
|
|
|
// screen saver and screen blanking
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// User trying to access application menu using ALT?
|
|
|
|
// User trying to access application menu using ALT?
|
|
|
|
case SC_KEYMENU: |
|
|
|
case SC_KEYMENU: |
|
|
@ -748,9 +698,8 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
_glfwInputKey(translateKey(wParam, lParam), GLFW_PRESS); |
|
|
|
_glfwInputKey(translateKey(wParam, lParam), GLFW_PRESS); |
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.charCallback) |
|
|
|
if (_glfwWin.charCallback) |
|
|
|
{ |
|
|
|
|
|
|
|
translateChar((DWORD) wParam, (DWORD) lParam, GLFW_PRESS); |
|
|
|
translateChar((DWORD) wParam, (DWORD) lParam, GLFW_PRESS); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -764,30 +713,35 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
_glfwInputKey(GLFW_KEY_RSHIFT, GLFW_RELEASE); |
|
|
|
_glfwInputKey(GLFW_KEY_RSHIFT, GLFW_RELEASE); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputKey(translateKey(wParam, lParam), GLFW_RELEASE); |
|
|
|
_glfwInputKey(translateKey(wParam, lParam), GLFW_RELEASE); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.charCallback) |
|
|
|
if (_glfwWin.charCallback) |
|
|
|
{ |
|
|
|
|
|
|
|
translateChar((DWORD) wParam, (DWORD) lParam, GLFW_RELEASE); |
|
|
|
translateChar((DWORD) wParam, (DWORD) lParam, GLFW_RELEASE); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_LBUTTONDOWN: |
|
|
|
case WM_LBUTTONDOWN: |
|
|
|
|
|
|
|
{ |
|
|
|
SetCapture(hWnd); |
|
|
|
SetCapture(hWnd); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_RBUTTONDOWN: |
|
|
|
case WM_RBUTTONDOWN: |
|
|
|
|
|
|
|
{ |
|
|
|
SetCapture(hWnd); |
|
|
|
SetCapture(hWnd); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_MBUTTONDOWN: |
|
|
|
case WM_MBUTTONDOWN: |
|
|
|
|
|
|
|
{ |
|
|
|
SetCapture(hWnd); |
|
|
|
SetCapture(hWnd); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_MIDDLE, GLFW_PRESS); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_MIDDLE, GLFW_PRESS); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_XBUTTONDOWN: |
|
|
|
case WM_XBUTTONDOWN: |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (HIWORD(wParam) == XBUTTON1) |
|
|
|
if (HIWORD(wParam) == XBUTTON1) |
|
|
@ -800,21 +754,31 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
SetCapture(hWnd); |
|
|
|
SetCapture(hWnd); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_5, GLFW_PRESS); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_5, GLFW_PRESS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_LBUTTONUP: |
|
|
|
case WM_LBUTTONUP: |
|
|
|
|
|
|
|
{ |
|
|
|
ReleaseCapture(); |
|
|
|
ReleaseCapture(); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_LEFT, GLFW_RELEASE); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_LEFT, GLFW_RELEASE); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_RBUTTONUP: |
|
|
|
case WM_RBUTTONUP: |
|
|
|
|
|
|
|
{ |
|
|
|
ReleaseCapture(); |
|
|
|
ReleaseCapture(); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_RIGHT, GLFW_RELEASE); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_RIGHT, GLFW_RELEASE); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_MBUTTONUP: |
|
|
|
case WM_MBUTTONUP: |
|
|
|
|
|
|
|
{ |
|
|
|
ReleaseCapture(); |
|
|
|
ReleaseCapture(); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_MIDDLE, GLFW_RELEASE); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_MIDDLE, GLFW_RELEASE); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case WM_XBUTTONUP: |
|
|
|
case WM_XBUTTONUP: |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (HIWORD(wParam) == XBUTTON1) |
|
|
|
if (HIWORD(wParam) == XBUTTON1) |
|
|
@ -827,6 +791,7 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
ReleaseCapture(); |
|
|
|
ReleaseCapture(); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_5, GLFW_RELEASE); |
|
|
|
_glfwInputMouseClick(GLFW_MOUSE_BUTTON_5, GLFW_RELEASE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -853,6 +818,7 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
_glfwInput.MousePosX = NewMouseX; |
|
|
|
_glfwInput.MousePosX = NewMouseX; |
|
|
|
_glfwInput.MousePosY = NewMouseY; |
|
|
|
_glfwInput.MousePosY = NewMouseY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_glfwInput.OldMouseX = NewMouseX; |
|
|
|
_glfwInput.OldMouseX = NewMouseX; |
|
|
|
_glfwInput.OldMouseY = NewMouseY; |
|
|
|
_glfwInput.OldMouseY = NewMouseY; |
|
|
|
_glfwInput.MouseMoved = GL_TRUE; |
|
|
|
_glfwInput.MouseMoved = GL_TRUE; |
|
|
@ -863,6 +829,7 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
_glfwInput.MousePosY); |
|
|
|
_glfwInput.MousePosY); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -873,10 +840,10 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
{ |
|
|
|
{ |
|
|
|
wheelDelta = (((int)wParam) >> 16) / WHEEL_DELTA; |
|
|
|
wheelDelta = (((int)wParam) >> 16) / WHEEL_DELTA; |
|
|
|
_glfwInput.WheelPos += wheelDelta; |
|
|
|
_glfwInput.WheelPos += wheelDelta; |
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.mouseWheelCallback) |
|
|
|
if (_glfwWin.mouseWheelCallback) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.mouseWheelCallback(_glfwInput.WheelPos); |
|
|
|
_glfwWin.mouseWheelCallback(_glfwInput.WheelPos); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
@ -892,15 +859,12 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
{ |
|
|
|
{ |
|
|
|
RECT ClipWindowRect; |
|
|
|
RECT ClipWindowRect; |
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
{ |
|
|
|
|
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_glfwWin.windowSizeCallback) |
|
|
|
if (_glfwWin.windowSizeCallback) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.windowSizeCallback(LOWORD(lParam), HIWORD(lParam)); |
|
|
|
_glfwWin.windowSizeCallback(LOWORD(lParam), HIWORD(lParam)); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -911,10 +875,8 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
{ |
|
|
|
{ |
|
|
|
RECT ClipWindowRect; |
|
|
|
RECT ClipWindowRect; |
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
{ |
|
|
|
|
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -922,9 +884,8 @@ static LRESULT CALLBACK windowProc( HWND hWnd, UINT uMsg, |
|
|
|
case WM_PAINT: |
|
|
|
case WM_PAINT: |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_glfwWin.windowRefreshCallback) |
|
|
|
if (_glfwWin.windowRefreshCallback) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.windowRefreshCallback(); |
|
|
|
_glfwWin.windowRefreshCallback(); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -996,15 +957,11 @@ static void initWGLExtensions( void ) |
|
|
|
_glfwWin.GetExtensionsStringARB = (WGLGETEXTENSIONSSTRINGARB_T) |
|
|
|
_glfwWin.GetExtensionsStringARB = (WGLGETEXTENSIONSSTRINGARB_T) |
|
|
|
wglGetProcAddress("wglGetExtensionsStringARB"); |
|
|
|
wglGetProcAddress("wglGetExtensionsStringARB"); |
|
|
|
if (!_glfwWin.GetExtensionsStringARB) |
|
|
|
if (!_glfwWin.GetExtensionsStringARB) |
|
|
|
{ |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_glfwPlatformExtensionSupported("WGL_ARB_multisample")) |
|
|
|
if (_glfwPlatformExtensionSupported("WGL_ARB_multisample")) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.has_WGL_ARB_multisample = GL_TRUE; |
|
|
|
_glfwWin.has_WGL_ARB_multisample = GL_TRUE; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_glfwPlatformExtensionSupported("WGL_ARB_create_context")) |
|
|
|
if (_glfwPlatformExtensionSupported("WGL_ARB_create_context")) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1155,13 +1112,9 @@ static int createWindow( const _GLFWwndconfig *wndconfig, |
|
|
|
// the top of the display). Fullscreen windows are always opened in
|
|
|
|
// the top of the display). Fullscreen windows are always opened in
|
|
|
|
// the upper left corner regardless of the desktop working area.
|
|
|
|
// the upper left corner regardless of the desktop working area.
|
|
|
|
if (_glfwWin.fullscreen) |
|
|
|
if (_glfwWin.fullscreen) |
|
|
|
{ |
|
|
|
|
|
|
|
wa.left = wa.top = 0; |
|
|
|
wa.left = wa.top = 0; |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &wa, 0); |
|
|
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &wa, 0); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_glfwWin.window = CreateWindowEx(_glfwWin.dwExStyle, // Extended style
|
|
|
|
_glfwWin.window = CreateWindowEx(_glfwWin.dwExStyle, // Extended style
|
|
|
|
_GLFW_WNDCLASSNAME, // Class name
|
|
|
|
_GLFW_WNDCLASSNAME, // Class name
|
|
|
@ -1255,9 +1208,9 @@ static void destroyWindow( void ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//************************************************************************
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//**** Platform implementation functions ****
|
|
|
|
////// GLFW platform API //////
|
|
|
|
//************************************************************************
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
|
// Here is where the window is created, and the OpenGL rendering context is
|
|
|
|
// Here is where the window is created, and the OpenGL rendering context is
|
|
|
@ -1393,7 +1346,7 @@ void _glfwPlatformCloseWindow( void ) |
|
|
|
|
|
|
|
|
|
|
|
void _glfwPlatformSetWindowTitle(const char* title) |
|
|
|
void _glfwPlatformSetWindowTitle(const char* title) |
|
|
|
{ |
|
|
|
{ |
|
|
|
(void) SetWindowText( _glfwWin.window, title ); |
|
|
|
SetWindowText(_glfwWin.window, title); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1427,10 +1380,8 @@ void _glfwPlatformSetWindowSize( int width, int height ) |
|
|
|
&refresh); |
|
|
|
&refresh); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
mode = _glfwWin.modeID; |
|
|
|
mode = _glfwWin.modeID; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
// If we are in windowed mode, adjust the window size to
|
|
|
|
// If we are in windowed mode, adjust the window size to
|
|
|
@ -1538,9 +1489,8 @@ void _glfwPlatformRestoreWindow( void ) |
|
|
|
|
|
|
|
|
|
|
|
// Lock mouse, if necessary
|
|
|
|
// Lock mouse, if necessary
|
|
|
|
if (_glfwWin.oldMouseLockValid && _glfwWin.oldMouseLock) |
|
|
|
if (_glfwWin.oldMouseLockValid && _glfwWin.oldMouseLock) |
|
|
|
{ |
|
|
|
|
|
|
|
glfwDisable(GLFW_MOUSE_CURSOR); |
|
|
|
glfwDisable(GLFW_MOUSE_CURSOR); |
|
|
|
} |
|
|
|
|
|
|
|
_glfwWin.oldMouseLockValid = GL_FALSE; |
|
|
|
_glfwWin.oldMouseLockValid = GL_FALSE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1562,10 +1512,8 @@ void _glfwPlatformSwapBuffers( void ) |
|
|
|
void _glfwPlatformSwapInterval(int interval) |
|
|
|
void _glfwPlatformSwapInterval(int interval) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_glfwWin.has_WGL_EXT_swap_control) |
|
|
|
if (_glfwWin.has_WGL_EXT_swap_control) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.SwapIntervalEXT(interval); |
|
|
|
_glfwWin.SwapIntervalEXT(interval); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
@ -1589,9 +1537,7 @@ void _glfwPlatformRefreshWindowParams( void ) |
|
|
|
_glfwWin.accelerated = GL_TRUE; |
|
|
|
_glfwWin.accelerated = GL_TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.accelerated = GL_FALSE; |
|
|
|
_glfwWin.accelerated = GL_FALSE; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_glfwWin.redBits = getPixelFormatAttrib(pixelFormat, WGL_RED_BITS_ARB); |
|
|
|
_glfwWin.redBits = getPixelFormatAttrib(pixelFormat, WGL_RED_BITS_ARB); |
|
|
|
_glfwWin.greenBits = getPixelFormatAttrib(pixelFormat, WGL_GREEN_BITS_ARB); |
|
|
|
_glfwWin.greenBits = getPixelFormatAttrib(pixelFormat, WGL_GREEN_BITS_ARB); |
|
|
@ -1615,10 +1561,8 @@ void _glfwPlatformRefreshWindowParams( void ) |
|
|
|
// Should we force 1 to 0 here for consistency, or keep 1 for transparency?
|
|
|
|
// Should we force 1 to 0 here for consistency, or keep 1 for transparency?
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.samples = 0; |
|
|
|
_glfwWin.samples = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
_glfw_DescribePixelFormat(_glfwWin.DC, pixelFormat, |
|
|
|
_glfw_DescribePixelFormat(_glfwWin.DC, pixelFormat, |
|
|
@ -1655,15 +1599,11 @@ void _glfwPlatformRefreshWindowParams( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_glfwWin.refreshRate = dm.dmDisplayFrequency; |
|
|
|
_glfwWin.refreshRate = dm.dmDisplayFrequency; |
|
|
|
if (_glfwWin.refreshRate <= 1) |
|
|
|
if (_glfwWin.refreshRate <= 1) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.refreshRate = 0; |
|
|
|
_glfwWin.refreshRate = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwWin.refreshRate = 0; |
|
|
|
_glfwWin.refreshRate = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
@ -1696,15 +1636,19 @@ void _glfwPlatformPollEvents( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// QUIT-message (from close window)?
|
|
|
|
// QUIT-message (from close window)?
|
|
|
|
case WM_QUIT: |
|
|
|
case WM_QUIT: |
|
|
|
|
|
|
|
{ |
|
|
|
winclosed = GL_TRUE; |
|
|
|
winclosed = GL_TRUE; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Ok, send it to the window message handler
|
|
|
|
// Ok, send it to the window message handler
|
|
|
|
default: |
|
|
|
default: |
|
|
|
|
|
|
|
{ |
|
|
|
DispatchMessage(&msg); |
|
|
|
DispatchMessage(&msg); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// LSHIFT/RSHIFT fixup (keys tend to "stick" without this fix)
|
|
|
|
// LSHIFT/RSHIFT fixup (keys tend to "stick" without this fix)
|
|
|
|
// This is the only async event handling in GLFW, but it solves some
|
|
|
|
// This is the only async event handling in GLFW, but it solves some
|
|
|
@ -1721,14 +1665,11 @@ void _glfwPlatformPollEvents( void ) |
|
|
|
// See if this differs from our belief of what has happened
|
|
|
|
// See if this differs from our belief of what has happened
|
|
|
|
// (we only have to check for lost key up events)
|
|
|
|
// (we only have to check for lost key up events)
|
|
|
|
if (!lshift_down && _glfwInput.Key[ GLFW_KEY_LSHIFT ] == 1) |
|
|
|
if (!lshift_down && _glfwInput.Key[ GLFW_KEY_LSHIFT ] == 1) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputKey(GLFW_KEY_LSHIFT, GLFW_RELEASE); |
|
|
|
_glfwInputKey(GLFW_KEY_LSHIFT, GLFW_RELEASE); |
|
|
|
} |
|
|
|
|
|
|
|
if (!rshift_down && _glfwInput.Key[ GLFW_KEY_RSHIFT ] == 1) |
|
|
|
if (!rshift_down && _glfwInput.Key[ GLFW_KEY_RSHIFT ] == 1) |
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputKey(GLFW_KEY_RSHIFT, GLFW_RELEASE); |
|
|
|
_glfwInputKey(GLFW_KEY_RSHIFT, GLFW_RELEASE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Did we have mouse movement in locked cursor mode?
|
|
|
|
// Did we have mouse movement in locked cursor mode?
|
|
|
|
if (_glfwInput.MouseMoved && _glfwWin.mouseLock) |
|
|
|
if (_glfwInput.MouseMoved && _glfwWin.mouseLock) |
|
|
@ -1744,10 +1685,8 @@ void _glfwPlatformPollEvents( void ) |
|
|
|
winclosed = _glfwWin.windowCloseCallback(); |
|
|
|
winclosed = _glfwWin.windowCloseCallback(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (winclosed) |
|
|
|
if (winclosed) |
|
|
|
{ |
|
|
|
|
|
|
|
glfwCloseWindow(); |
|
|
|
glfwCloseWindow(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//========================================================================
|
|
|
@ -1774,9 +1713,7 @@ void _glfwPlatformHideMouseCursor( void ) |
|
|
|
|
|
|
|
|
|
|
|
// Clip cursor to the window
|
|
|
|
// Clip cursor to the window
|
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
if (GetWindowRect(_glfwWin.window, &ClipWindowRect)) |
|
|
|
{ |
|
|
|
|
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
ClipCursor(&ClipWindowRect); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Capture cursor to user window
|
|
|
|
// Capture cursor to user window
|
|
|
|
SetCapture(_glfwWin.window); |
|
|
|
SetCapture(_glfwWin.window); |
|
|
|