Remove unnecessary function calls

glfwSetInputMode is a no-op if the passed in mode is the same as the
current mode anyway.
This commit is contained in:
Kovid Goyal
2018-04-09 19:40:14 +05:30
parent 955ead05be
commit 785937ecfc

View File

@@ -74,7 +74,7 @@ is_window_ready_for_callbacks() {
static inline void
show_mouse_cursor(GLFWwindow *w) {
if (glfwGetInputMode(w, GLFW_CURSOR) != GLFW_CURSOR_NORMAL) { glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_NORMAL); }
glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
}
static void
@@ -620,9 +620,7 @@ set_os_window_title(OSWindow *w, const char *title) {
void
hide_mouse(OSWindow *w) {
if (glfwGetInputMode(w->handle, GLFW_CURSOR) != GLFW_CURSOR_HIDDEN) {
glfwSetInputMode(w->handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
}
glfwSetInputMode(w->handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
}
void