mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Removed double mode for cursor mode.
This commit is contained in:
parent
2d1b835711
commit
9264b5da0e
|
@ -269,7 +269,7 @@ systems, where it uses the [soname](https://en.wikipedia.org/wiki/soname)
|
||||||
| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API |
|
| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API |
|
||||||
| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback |
|
| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback |
|
||||||
| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted |
|
| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted |
|
||||||
| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR_MODE` | Used with @ref glfwSetInputMode |
|
| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode |
|
||||||
| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | |
|
| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | |
|
||||||
| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | |
|
| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | |
|
||||||
| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | |
|
| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | |
|
||||||
|
|
|
@ -320,13 +320,13 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||||
|
|
||||||
if (action == GLFW_PRESS)
|
if (action == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_CAPTURED);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_CAPTURED);
|
||||||
locked = GL_TRUE;
|
locked = GL_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
locked = GL_FALSE;
|
locked = GL_FALSE;
|
||||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -537,7 +537,7 @@ extern "C" {
|
||||||
#define GLFW_OPENGL_CORE_PROFILE 0x00000001
|
#define GLFW_OPENGL_CORE_PROFILE 0x00000001
|
||||||
#define GLFW_OPENGL_COMPAT_PROFILE 0x00000002
|
#define GLFW_OPENGL_COMPAT_PROFILE 0x00000002
|
||||||
|
|
||||||
#define GLFW_CURSOR_MODE 0x00030001
|
#define GLFW_CURSOR 0x00030001
|
||||||
#define GLFW_STICKY_KEYS 0x00030002
|
#define GLFW_STICKY_KEYS 0x00030002
|
||||||
#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
|
#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
|
||||||
|
|
||||||
|
@ -1684,7 +1684,7 @@ GLFWAPI void glfwWaitEvents(void);
|
||||||
/*! @brief Returns the value of an input option for the specified window.
|
/*! @brief Returns the value of an input option for the specified window.
|
||||||
*
|
*
|
||||||
* @param[in] window The window to query.
|
* @param[in] window The window to query.
|
||||||
* @param[in] mode One of `GLFW_CURSOR_MODE`, `GLFW_STICKY_KEYS` or
|
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
|
||||||
* `GLFW_STICKY_MOUSE_BUTTONS`.
|
* `GLFW_STICKY_MOUSE_BUTTONS`.
|
||||||
*
|
*
|
||||||
* @sa glfwSetInputMode
|
* @sa glfwSetInputMode
|
||||||
|
@ -1695,11 +1695,11 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
|
||||||
|
|
||||||
/*! @brief Sets an input option for the specified window.
|
/*! @brief Sets an input option for the specified window.
|
||||||
* @param[in] window The window whose input mode to set.
|
* @param[in] window The window whose input mode to set.
|
||||||
* @param[in] mode One of `GLFW_CURSOR_MODE`, `GLFW_STICKY_KEYS` or
|
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
|
||||||
* `GLFW_STICKY_MOUSE_BUTTONS`.
|
* `GLFW_STICKY_MOUSE_BUTTONS`.
|
||||||
* @param[in] value The new value of the specified input mode.
|
* @param[in] value The new value of the specified input mode.
|
||||||
*
|
*
|
||||||
* If `mode` is `GLFW_CURSOR_MODE`, the value must be one of the supported input
|
* If `mode` is `GLFW_CURSOR`, the value must be one of the supported input
|
||||||
* modes:
|
* modes:
|
||||||
* - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
|
* - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
|
||||||
* - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
|
* - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
|
||||||
|
|
|
@ -223,7 +223,7 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GLFW_CURSOR_MODE:
|
case GLFW_CURSOR:
|
||||||
return window->cursorMode;
|
return window->cursorMode;
|
||||||
case GLFW_STICKY_KEYS:
|
case GLFW_STICKY_KEYS:
|
||||||
return window->stickyKeys;
|
return window->stickyKeys;
|
||||||
|
@ -243,7 +243,7 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GLFW_CURSOR_MODE:
|
case GLFW_CURSOR:
|
||||||
setCursorMode(window, value);
|
setCursorMode(window, value);
|
||||||
break;
|
break;
|
||||||
case GLFW_STICKY_KEYS:
|
case GLFW_STICKY_KEYS:
|
||||||
|
|
|
@ -41,15 +41,15 @@ static double cursor_y;
|
||||||
|
|
||||||
static void toggle_cursor(GLFWwindow* window)
|
static void toggle_cursor(GLFWwindow* window)
|
||||||
{
|
{
|
||||||
if (glfwGetInputMode(window, GLFW_CURSOR_MODE) == GLFW_CURSOR_CAPTURED)
|
if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_CAPTURED)
|
||||||
{
|
{
|
||||||
printf("Released cursor\n");
|
printf("Released cursor\n");
|
||||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Captured cursor\n");
|
printf("Captured cursor\n");
|
||||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_CAPTURED);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_CAPTURED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user