1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

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

@ -674,12 +674,9 @@ extern "C" {
* more specific categories. * more specific categories.
*/ */
#define GLFW_PLATFORM_ERROR 0x00070008 #define GLFW_PLATFORM_ERROR 0x00070008
/*! @brief The specified window needed to be focused for the call to succeed.
*/
#define GLFW_WINDOW_NOT_FOCUSED 0x00070009
/*! @brief The clipboard did not contain data in the requested format. /*! @brief The clipboard did not contain data in the requested format.
*/ */
#define GLFW_FORMAT_UNAVAILABLE 0x0007000A #define GLFW_FORMAT_UNAVAILABLE 0x00070009
/*! @} */ /*! @} */
/*! @brief The number of entries in the gamma ramp. /*! @brief The number of entries in the gamma ramp.

View File

@ -228,8 +228,6 @@ GLFWAPI const char* glfwErrorString(int error)
return "The requested OpenGL version is unavailable"; return "The requested OpenGL version is unavailable";
case GLFW_PLATFORM_ERROR: case GLFW_PLATFORM_ERROR:
return "A platform-specific error occurred"; return "A platform-specific error occurred";
case GLFW_WINDOW_NOT_FOCUSED:
return "The specified window is not focused";
case GLFW_FORMAT_UNAVAILABLE: case GLFW_FORMAT_UNAVAILABLE:
return "The requested format is 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) if (_glfwLibrary.focusedWindow != window)
{
_glfwSetError(GLFW_WINDOW_NOT_FOCUSED, NULL);
return; return;
}
// Don't do anything if the cursor position did not change // Don't do anything if the cursor position did not change
if (xpos == window->cursorPosX && ypos == window->cursorPosY) if (xpos == window->cursorPosX && ypos == window->cursorPosY)