Rename raw input to raw mouse motion, cleanup

This renames 'raw input' to 'raw mouse motion' as there are other kinds
of raw input.  The update path is restructured to avoid reinitializing
all of disabled cursor mode.  Modification of shared state is moved out
into shared code.  Raw mouse motion is disabled by default for
compatibility.

Related to #1401.
This commit is contained in:
Camilla Löwy
2019-02-11 19:10:20 +01:00
parent 9e29f556fd
commit 1155c83013
13 changed files with 196 additions and 123 deletions

View File

@@ -164,14 +164,17 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
break;
case GLFW_KEY_R:
if (glfwGetInputMode(window, GLFW_RAW_INPUT))
if (!glfwRawMouseMotionSupported())
break;
if (glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION))
{
glfwSetInputMode(window, GLFW_RAW_INPUT, GLFW_FALSE);
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_FALSE);
printf("(( raw input is disabled ))\n");
}
else
{
glfwSetInputMode(window, GLFW_RAW_INPUT, GLFW_TRUE);
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
printf("(( raw input is enabled ))\n");
}
break;