Go to the documentation of this file.
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;
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);
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);
502 "Invalid gamma ramp size %i",
const GLFWAPI GLFWvidmode * glfwGetVideoMode(GLFWmonitor *handle)
Returns the current mode of the specified monitor.
static int compareVideoModes(const void *fp, const void *sp)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *count)
struct _GLFWlibrary::@9 callbacks
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function signature for monitor configuration callbacks.
const GLFWvidmode * _glfwChooseVideoMode(_GLFWmonitor *monitor, const GLFWvidmode *desired)
GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor *handle, int *widthMM, int *heightMM)
Returns the physical size of the monitor.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
GLFWAPI void glfwGetMonitorPos(GLFWmonitor *handle, int *xpos, int *ypos)
Returns the position of the monitor's viewport on the virtual screen.
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwInputError(int code, const char *format,...)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
const GLFWAPI GLFWvidmode * glfwGetVideoModes(GLFWmonitor *handle, int *count)
Returns the available video modes for the specified monitor.
GLFWAPI void glfwSetGamma(GLFWmonitor *handle, float gamma)
Generates a gamma ramp and sets it for the specified monitor.
#define _GLFW_INSERT_FIRST
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
GLFWAPI GLFWmonitor * glfwGetPrimaryMonitor(void)
Returns the primary monitor.
GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)
Sets the monitor configuration callback.
GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor *handle, void *pointer)
Sets the user pointer of the specified monitor.
void _glfwSplitBPP(int bpp, int *red, int *green, int *blue)
#define GLFW_DISCONNECTED
GLFWAPI void glfwSetGammaRamp(GLFWmonitor *handle, const GLFWgammaramp *ramp)
Sets the current gamma ramp for the specified monitor.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
GLFWgammaramp currentRamp
#define _GLFW_REQUIRE_INIT()
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
char * _glfw_strdup(const char *source)
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
GLFWAPI GLFWmonitor ** glfwGetMonitors(int *count)
Returns the currently connected monitors.
#define _GLFW_SWAP_POINTERS(x, y)
struct _GLFWwindow * next
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
std::vector< double > values
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
const GLFWAPI char * glfwGetMonitorName(GLFWmonitor *handle)
Returns the name of the specified monitor.
float _glfw_fminf(float a, float b)
static GLFWbool refreshVideoModes(_GLFWmonitor *monitor)
const GLFWAPI GLFWgammaramp * glfwGetGammaRamp(GLFWmonitor *handle)
Returns the current gamma ramp for the specified monitor.
_GLFWwindow * windowListHead
GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor *handle, float *xscale, float *yscale)
Retrieves the content scale for the specified monitor.
GLFWgammaramp originalRamp
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
int _glfwCompareVideoModes(const GLFWvidmode *fm, const GLFWvidmode *sm)
GLFWAPI void * glfwGetMonitorUserPointer(GLFWmonitor *handle)
Returns the user pointer of the specified monitor.
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08