78 monitor->
modes = modes;
116 if (window->
monitor == monitor)
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;
239 sizeDiff = abs((current->
width - desired->
width) *
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);
352 float* xscale,
float* yscale)
372 return monitor->
name;
414 return monitor->
modes;
431 unsigned short values[256];
440 if (gamma != gamma || gamma <= 0.f || gamma > FLT_MAX)
446 for (i = 0; i < 256; i++)
453 value = powf(value, 1.
f / gamma) * 65535.f + 0.5f;
459 values[
i] = (
unsigned short) value;
496 "Invalid gamma ramp size %i",
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
GLenum GLsizei const void * pointer
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
GLFWgammaramp currentRamp
GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)
Sets the monitor configuration callback.
GLuint const GLchar * name
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()
static GLFWwindow * window
GLuint64 GLenum void * handle
GLFWAPI const GLFWvidmode * glfwGetVideoMode(GLFWmonitor *handle)
Returns the current mode of the specified monitor.
struct GLFWmonitor GLFWmonitor
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.
GLFWAPI void * glfwGetMonitorUserPointer(GLFWmonitor *handle)
Returns the user pointer of the specified monitor.
void _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)
GLint GLsizei GLsizei height
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
GLsizei const GLfloat * values
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)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
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.
struct _GLFWlibrary::@30 callbacks
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)