mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
parent
309d79376f
commit
f4d0365a5a
24
src/input.c
24
src/input.c
|
@ -522,7 +522,9 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
|
|
||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
if (mode == GLFW_CURSOR)
|
switch (mode)
|
||||||
|
{
|
||||||
|
case GLFW_CURSOR:
|
||||||
{
|
{
|
||||||
if (value != GLFW_CURSOR_NORMAL &&
|
if (value != GLFW_CURSOR_NORMAL &&
|
||||||
value != GLFW_CURSOR_HIDDEN &&
|
value != GLFW_CURSOR_HIDDEN &&
|
||||||
|
@ -543,8 +545,10 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
&window->virtualCursorPosX,
|
&window->virtualCursorPosX,
|
||||||
&window->virtualCursorPosY);
|
&window->virtualCursorPosY);
|
||||||
_glfw.platform.setCursorMode(window, value);
|
_glfw.platform.setCursorMode(window, value);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (mode == GLFW_STICKY_KEYS)
|
|
||||||
|
case GLFW_STICKY_KEYS:
|
||||||
{
|
{
|
||||||
value = value ? GLFW_TRUE : GLFW_FALSE;
|
value = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
if (window->stickyKeys == value)
|
if (window->stickyKeys == value)
|
||||||
|
@ -563,8 +567,10 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
}
|
}
|
||||||
|
|
||||||
window->stickyKeys = value;
|
window->stickyKeys = value;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (mode == GLFW_STICKY_MOUSE_BUTTONS)
|
|
||||||
|
case GLFW_STICKY_MOUSE_BUTTONS:
|
||||||
{
|
{
|
||||||
value = value ? GLFW_TRUE : GLFW_FALSE;
|
value = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
if (window->stickyMouseButtons == value)
|
if (window->stickyMouseButtons == value)
|
||||||
|
@ -583,12 +589,16 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
}
|
}
|
||||||
|
|
||||||
window->stickyMouseButtons = value;
|
window->stickyMouseButtons = value;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (mode == GLFW_LOCK_KEY_MODS)
|
|
||||||
|
case GLFW_LOCK_KEY_MODS:
|
||||||
{
|
{
|
||||||
window->lockKeyMods = value ? GLFW_TRUE : GLFW_FALSE;
|
window->lockKeyMods = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (mode == GLFW_RAW_MOUSE_MOTION)
|
|
||||||
|
case GLFW_RAW_MOUSE_MOTION:
|
||||||
{
|
{
|
||||||
if (!_glfw.platform.rawMouseMotionSupported())
|
if (!_glfw.platform.rawMouseMotionSupported())
|
||||||
{
|
{
|
||||||
|
@ -603,8 +613,10 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||||
|
|
||||||
window->rawMouseMotion = value;
|
window->rawMouseMotion = value;
|
||||||
_glfw.platform.setRawMouseMotion(window, value);
|
_glfw.platform.setRawMouseMotion(window, value);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
34
src/window.c
34
src/window.c
|
@ -882,34 +882,40 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
|
||||||
|
|
||||||
value = value ? GLFW_TRUE : GLFW_FALSE;
|
value = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
|
|
||||||
if (attrib == GLFW_AUTO_ICONIFY)
|
switch (attrib)
|
||||||
window->autoIconify = value;
|
|
||||||
else if (attrib == GLFW_RESIZABLE)
|
|
||||||
{
|
{
|
||||||
|
case GLFW_AUTO_ICONIFY:
|
||||||
|
window->autoIconify = value;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case GLFW_RESIZABLE:
|
||||||
window->resizable = value;
|
window->resizable = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfw.platform.setWindowResizable(window, value);
|
_glfw.platform.setWindowResizable(window, value);
|
||||||
}
|
return;
|
||||||
else if (attrib == GLFW_DECORATED)
|
|
||||||
{
|
case GLFW_DECORATED:
|
||||||
window->decorated = value;
|
window->decorated = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfw.platform.setWindowDecorated(window, value);
|
_glfw.platform.setWindowDecorated(window, value);
|
||||||
}
|
return;
|
||||||
else if (attrib == GLFW_FLOATING)
|
|
||||||
{
|
case GLFW_FLOATING:
|
||||||
window->floating = value;
|
window->floating = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfw.platform.setWindowFloating(window, value);
|
_glfw.platform.setWindowFloating(window, value);
|
||||||
}
|
return;
|
||||||
else if (attrib == GLFW_FOCUS_ON_SHOW)
|
|
||||||
|
case GLFW_FOCUS_ON_SHOW:
|
||||||
window->focusOnShow = value;
|
window->focusOnShow = value;
|
||||||
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
|
return;
|
||||||
{
|
|
||||||
|
case GLFW_MOUSE_PASSTHROUGH:
|
||||||
window->mousePassthrough = value;
|
window->mousePassthrough = value;
|
||||||
_glfw.platform.setWindowMousePassthrough(window, value);
|
_glfw.platform.setWindowMousePassthrough(window, value);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user