Made glfwSetCursorPos fail silently if lacking focus.

This commit is contained in:
Camilla Berglund
2012-11-22 17:20:16 +01:00
parent c479124e69
commit 998cb5144e
3 changed files with 1 additions and 9 deletions

View File

@@ -228,8 +228,6 @@ GLFWAPI const char* glfwErrorString(int error)
return "The requested OpenGL version is unavailable";
case GLFW_PLATFORM_ERROR:
return "A platform-specific error occurred";
case GLFW_WINDOW_NOT_FOCUSED:
return "The specified window is not focused";
case GLFW_FORMAT_UNAVAILABLE:
return "The requested format is unavailable";
}

View File

@@ -408,10 +408,7 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow handle, int xpos, int ypos)
}
if (_glfwLibrary.focusedWindow != window)
{
_glfwSetError(GLFW_WINDOW_NOT_FOCUSED, NULL);
return;
}
// Don't do anything if the cursor position did not change
if (xpos == window->cursorPosX && ypos == window->cursorPosY)