Lines Matching defs:monitor
65 // Retrieves the available modes for the specified monitor
67 static GLFWbool refreshVideoModes(_GLFWmonitor* monitor)
72 if (monitor->modes)
75 modes = _glfw.platform.getVideoModes(monitor, &modeCount);
81 _glfw_free(monitor->modes);
82 monitor->modes = modes;
83 monitor->modeCount = modeCount;
93 // Notifies shared code of a monitor connection or disconnection
95 void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement)
97 assert(monitor != NULL);
113 _glfw.monitors[0] = monitor;
116 _glfw.monitors[_glfw.monitorCount - 1] = monitor;
125 if (window->monitor == monitor)
137 if (_glfw.monitors[i] == monitor)
148 if (_glfw.callbacks.monitor)
149 _glfw.callbacks.monitor((GLFWmonitor*) monitor, action);
152 _glfwFreeMonitor(monitor);
156 // a monitor
158 void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window)
160 assert(monitor != NULL);
161 monitor->window = window;
169 // Allocates and returns a monitor object with the specified name and dimensions
173 _GLFWmonitor* monitor = _glfw_calloc(1, sizeof(_GLFWmonitor));
174 monitor->widthMM = widthMM;
175 monitor->heightMM = heightMM;
177 strncpy(monitor->name, name, sizeof(monitor->name) - 1);
179 return monitor;
182 // Frees a monitor object and any data associated with it
184 void _glfwFreeMonitor(_GLFWmonitor* monitor)
186 if (monitor == NULL)
189 _glfw.platform.freeMonitor(monitor);
191 _glfwFreeGammaArrays(&monitor->originalRamp);
192 _glfwFreeGammaArrays(&monitor->currentRamp);
194 _glfw_free(monitor->modes);
195 _glfw_free(monitor);
221 const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
231 if (!refreshVideoModes(monitor))
234 for (i = 0; i < monitor->modeCount; i++)
236 current = monitor->modes + i;
335 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
336 assert(monitor != NULL);
338 _glfw.platform.getMonitorPos(monitor, xpos, ypos);
356 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
357 assert(monitor != NULL);
359 _glfw.platform.getMonitorWorkarea(monitor, xpos, ypos, width, height);
371 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
372 assert(monitor != NULL);
375 *widthMM = monitor->widthMM;
377 *heightMM = monitor->heightMM;
390 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
391 assert(monitor != NULL);
393 _glfw.platform.getMonitorContentScale(monitor, xscale, yscale);
400 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
401 assert(monitor != NULL);
403 return monitor->name;
410 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
411 assert(monitor != NULL);
413 monitor->userPointer = pointer;
420 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
421 assert(monitor != NULL);
423 return monitor->userPointer;
429 _GLFW_SWAP(GLFWmonitorfun, _glfw.callbacks.monitor, cbfun);
441 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
442 assert(monitor != NULL);
444 if (!refreshVideoModes(monitor))
447 *count = monitor->modeCount;
448 return monitor->modes;
455 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
456 assert(monitor != NULL);
458 if (!_glfw.platform.getVideoMode(monitor, &monitor->currentMode))
461 return &monitor->currentMode;
516 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
517 assert(monitor != NULL);
519 _glfwFreeGammaArrays(&monitor->currentRamp);
520 if (!_glfw.platform.getGammaRamp(monitor, &monitor->currentRamp))
523 return &monitor->currentRamp;
536 _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
537 assert(monitor != NULL);
547 if (!monitor->originalRamp.size)
549 if (!_glfw.platform.getGammaRamp(monitor, &monitor->originalRamp))
553 _glfw.platform.setGammaRamp(monitor, ramp);