78 monitor->
modes = modes;
116 if (window->
monitor == monitor)
118 int width, height, xoff, yoff;
185 free(monitor->
modes);
194 ramp->
red = calloc(size,
sizeof(
unsigned short));
195 ramp->
green = calloc(size,
sizeof(
unsigned short));
196 ramp->
blue = calloc(size,
sizeof(
unsigned short));
217 unsigned int sizeDiff, leastSizeDiff = UINT_MAX;
218 unsigned int rateDiff, leastRateDiff = UINT_MAX;
219 unsigned int colorDiff, leastColorDiff = UINT_MAX;
228 current = monitor->
modes + i;
249 if ((colorDiff < leastColorDiff) ||
250 (colorDiff == leastColorDiff && sizeDiff < leastSizeDiff) ||
251 (colorDiff == leastColorDiff && sizeDiff == leastSizeDiff && rateDiff < leastRateDiff))
254 leastSizeDiff = sizeDiff;
255 leastRateDiff = rateDiff;
256 leastColorDiff = colorDiff;
282 *red = *green = *blue = bpp / 3;
283 delta = bpp - (*red * 3);
298 assert(count != NULL);
321 assert(monitor != NULL);
336 assert(monitor != NULL);
352 float* xscale,
float* yscale)
355 assert(monitor != NULL);
369 assert(monitor != NULL);
372 return monitor->
name;
378 assert(monitor != NULL);
387 assert(monitor != NULL);
403 assert(monitor != NULL);
404 assert(count != NULL);
414 return monitor->
modes;
420 assert(monitor != NULL);
434 assert(handle != NULL);
436 assert(gamma <= FLT_MAX);
440 if (gamma != gamma || gamma <= 0.f || gamma > FLT_MAX)
450 values = calloc(original->
size,
sizeof(
unsigned short));
452 for (i = 0; i < original->
size; i++)
457 value = i / (float) (original->
size - 1);
459 value = powf(value, 1.
f / gamma) * 65535.f + 0.5f;
463 values[i] = (
unsigned short) value;
478 assert(monitor != NULL);
492 assert(monitor != NULL);
493 assert(ramp != NULL);
494 assert(ramp->
size > 0);
495 assert(ramp->
red != NULL);
496 assert(ramp->
green != NULL);
497 assert(ramp->
blue != NULL);
502 "Invalid gamma ramp size %i",
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
GLFWgammaramp currentRamp
float _glfw_fminf(float a, float b)
GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)
Sets the monitor configuration callback.
GLFWAPI void glfwSetGamma(GLFWmonitor *handle, float gamma)
Generates a gamma ramp and sets it for the specified monitor.
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function signature for monitor configuration callbacks.
#define _GLFW_REQUIRE_INIT()
std::vector< double > values
GLFWAPI const GLFWvidmode * glfwGetVideoMode(GLFWmonitor *handle)
Returns the current mode of the specified monitor.
static int compareVideoModes(const void *fp, const void *sp)
char * _glfw_strdup(const char *source)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
_GLFWwindow * windowListHead
GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor *handle, float *xscale, float *yscale)
Retrieves the content scale for the specified monitor.
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
GLFWAPI void * glfwGetMonitorUserPointer(GLFWmonitor *handle)
Returns the user pointer of the specified monitor.
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
#define GLFW_DISCONNECTED
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
#define _GLFW_SWAP_POINTERS(x, y)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
GLFWAPI GLFWmonitor ** glfwGetMonitors(int *count)
Returns the currently connected monitors.
GLFWAPI const char * glfwGetMonitorName(GLFWmonitor *handle)
Returns the name of the specified monitor.
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
struct _GLFWwindow * next
GLFWAPI const GLFWgammaramp * glfwGetGammaRamp(GLFWmonitor *handle)
Returns the current gamma ramp for the specified monitor.
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwInputError(int code, const char *format,...)
void _glfwSplitBPP(int bpp, int *red, int *green, int *blue)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *count)
GLFWgammaramp originalRamp
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
GLFWAPI void glfwGetMonitorPos(GLFWmonitor *handle, int *xpos, int *ypos)
Returns the position of the monitor's viewport on the virtual screen.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define _GLFW_INSERT_FIRST
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
INLINE Rall1d< T, V, S > abs(const Rall1d< T, V, S > &x)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
struct _GLFWlibrary::@9 callbacks
GLFWAPI const GLFWvidmode * glfwGetVideoModes(GLFWmonitor *handle, int *count)
Returns the available video modes for the specified monitor.
GLFWAPI GLFWmonitor * glfwGetPrimaryMonitor(void)
Returns the primary monitor.
GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor *handle, void *pointer)
Sets the user pointer of the specified monitor.
GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor *handle, int *widthMM, int *heightMM)
Returns the physical size of the monitor.
int _glfwCompareVideoModes(const GLFWvidmode *fm, const GLFWvidmode *sm)
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
static GLFWbool refreshVideoModes(_GLFWmonitor *monitor)
const GLFWvidmode * _glfwChooseVideoMode(_GLFWmonitor *monitor, const GLFWvidmode *desired)
GLFWAPI void glfwSetGammaRamp(GLFWmonitor *handle, const GLFWgammaramp *ramp)
Sets the current gamma ramp for the specified monitor.
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)