Made glfwGetPrimaryMonitor always return a handle.

Replaced the primary flag with the convention of putting the primary
monitor first in the returned array.
This commit is contained in:
Camilla Berglund
2013-02-17 19:09:22 +01:00
parent eb80266d89
commit 1961cecb7c
5 changed files with 35 additions and 33 deletions
+1 -21
View File
@@ -156,7 +156,6 @@ void _glfwInputMonitorChange(void)
//////////////////////////////////////////////////////////////////////////
_GLFWmonitor* _glfwCreateMonitor(const char* name,
GLboolean primary,
int widthMM, int heightMM,
int x, int y)
{
@@ -168,7 +167,6 @@ _GLFWmonitor* _glfwCreateMonitor(const char* name,
}
monitor->name = strdup(name);
monitor->primary = primary;
monitor->widthMM = widthMM;
monitor->heightMM = heightMM;
monitor->positionX = x;
@@ -280,31 +278,13 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count)
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
{
int i;
_GLFWmonitor* primary = NULL;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return NULL;
}
for (i = 0; i < _glfw.monitorCount; i++)
{
if (_glfw.monitors[i]->primary)
{
primary = _glfw.monitors[i];
break;
}
}
if (!primary)
{
_glfwInputError(GLFW_PLATFORM_ERROR, NULL);
return NULL;
}
return (GLFWmonitor*) primary;
return (GLFWmonitor*) _glfw.monitors[0];
}
GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos)