mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Merge branch 'master' into multi-display-support
Conflicts: src/fullscreen.c src/win32_window.c src/x11_fullscreen.c
This commit is contained in:
+46
-42
@@ -33,6 +33,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Convert BPP to RGB bits based on "best guess"
|
||||
//========================================================================
|
||||
@@ -145,48 +146,6 @@ static void setForegroundWindow(HWND hWnd)
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Hide mouse cursor (lock it)
|
||||
//========================================================================
|
||||
|
||||
static void hideMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
ShowCursor(FALSE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show mouse cursor (unlock it)
|
||||
//========================================================================
|
||||
|
||||
static void showMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
// Un-capture cursor
|
||||
ReleaseCapture();
|
||||
|
||||
// Release the cursor from the window
|
||||
ClipCursor(NULL);
|
||||
|
||||
ShowCursor(TRUE);
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Capture mouse cursor
|
||||
//========================================================================
|
||||
|
||||
static void captureMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
RECT ClipWindowRect;
|
||||
|
||||
// Clip cursor to the window
|
||||
if (GetWindowRect(window->Win32.handle, &ClipWindowRect))
|
||||
ClipCursor(&ClipWindowRect);
|
||||
|
||||
// Capture cursor to user window
|
||||
SetCapture(window->Win32.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the specified attribute of the specified pixel format
|
||||
// NOTE: Do not call this unless we have found WGL_ARB_pixel_format
|
||||
@@ -513,6 +472,50 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Hide mouse cursor
|
||||
//========================================================================
|
||||
|
||||
static void hideMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Capture mouse cursor
|
||||
//========================================================================
|
||||
|
||||
static void captureMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
RECT ClipWindowRect;
|
||||
|
||||
ShowCursor(FALSE);
|
||||
|
||||
// Clip cursor to the window
|
||||
if (GetWindowRect(window->Win32.handle, &ClipWindowRect))
|
||||
ClipCursor(&ClipWindowRect);
|
||||
|
||||
// Capture cursor to user window
|
||||
SetCapture(window->Win32.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show mouse cursor
|
||||
//========================================================================
|
||||
|
||||
static void showMouseCursor(_GLFWwindow* window)
|
||||
{
|
||||
// Un-capture cursor
|
||||
ReleaseCapture();
|
||||
|
||||
// Release the cursor from the window
|
||||
ClipCursor(NULL);
|
||||
|
||||
ShowCursor(TRUE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translates a Windows key to the corresponding GLFW key
|
||||
//========================================================================
|
||||
@@ -1903,6 +1906,7 @@ void _glfwPlatformSetMouseCursorPos(_GLFWwindow* window, int x, int y)
|
||||
SetCursorPos(pos.x, pos.y);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical mouse cursor mode
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user