From 1b25323fe4b80205efac2a0514f4c3ad138d2007 Mon Sep 17 00:00:00 2001 From: Serguei Date: Sun, 12 Jan 2020 02:01:53 -0500 Subject: [PATCH] toggle raw input IF SUPPORTED --- src/game.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 5c999ad..4474991 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -516,8 +516,10 @@ void App::onKey(GLFWwindow* window, int key, int scancode, int action, int mods) // R = toggle raw input if (key == GLFW_KEY_R) { - const bool raw_motion = glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION); - glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, !raw_motion); + if (glfwRawMouseMotionSupported()) { + const bool raw_motion = glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION); + glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, !raw_motion); + } } }