GLFW: input & timeGLFW 3.3

glfwRawMouseMotionSupported

Asks whether this system can deliver raw (unaccelerated) mouse motion.

Signature

int glfwRawMouseMotionSupported(void);

How it works

The operating system normally adds "pointer acceleration": a fast flick moves the cursor further than a slow one over the same distance. Good for a desktop, bad for aiming in a game, where the same hand movement should always turn the camera by the same angle.

Raw motion skips that. It only works with the cursor disabled, and only where the platform offers it (Windows and X11 yes, macOS no).

Return value

GLFW_TRUE if raw motion is available, otherwise GLFW_FALSE.

Errors

When the call is invalid it does nothing and sets an error, which glGetError returns:

GLFW_NOT_INITIALIZED
Called before glfwInit or after glfwTerminate.

Example

example.cpp
1if (glfwRawMouseMotionSupported())
2    glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
Official GLFW documentation