Replaced glfwGetMonitorParam with glfwGetMonitor*.

Having one way to retrieve the cursor position and another (more
verbose) way to retrieve the monitor position is inconsistent.  Having
them both work the same way is the least surprising thing.

The expected glfwGetMonitorSize function gets an added Physical in its
name so users won't confuse it with glfwGetVideoMode.
This commit is contained in:
Camilla Berglund
2013-01-24 19:10:17 +01:00
parent cb02a693b4
commit ee5f30ea8f
5 changed files with 44 additions and 45 deletions
+19 -14
View File
@@ -312,31 +312,36 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
return (GLFWmonitor*) primary;
}
GLFWAPI int glfwGetMonitorParam(GLFWmonitor* handle, int param)
GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return 0;
return;
}
switch (param)
if (xpos)
*xpos = monitor->positionX;
if (ypos)
*ypos = monitor->positionY;
}
GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* width, int* height)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
if (!_glfwInitialized)
{
case GLFW_MONITOR_WIDTH_MM:
return monitor->widthMM;
case GLFW_MONITOR_HEIGHT_MM:
return monitor->heightMM;
case GLFW_POSITION_X:
return monitor->positionX;
case GLFW_POSITION_Y:
return monitor->positionY;
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_glfwInputError(GLFW_INVALID_ENUM,
"glfwGetMonitorParam: Invalid enum value for 'param' parameter");
return 0;
if (width)
*width = monitor->widthMM;
if (height)
*height = monitor->heightMM;
}
GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle)