56 const float dpi = 141.f;
59 (
int) (mode.
width * 25.4f / dpi),
60 (
int) (mode.
height * 25.4f / dpi));
82 float* xscale,
float* yscale)
92 int* width,
int* height)
103 *height = mode.
height - 10;
109 *mode = getVideoMode();
116 *mode = getVideoMode();
121 if (!monitor->null.ramp.size)
125 for (
unsigned int i = 0; i < monitor->null.ramp.size; i++)
127 const float gamma = 2.2f;
129 value = i / (float) (monitor->null.ramp.size - 1);
130 value = powf(value, 1.f / gamma) * 65535.f + 0.5f;
133 monitor->null.ramp.red[i] = (
unsigned short) value;
134 monitor->null.ramp.green[i] = (
unsigned short) value;
135 monitor->null.ramp.blue[i] = (
unsigned short) value;
140 memcpy(ramp->
red, monitor->null.ramp.red,
sizeof(
short) * ramp->
size);
141 memcpy(ramp->
green, monitor->null.ramp.green,
sizeof(
short) * ramp->
size);
142 memcpy(ramp->
blue, monitor->null.ramp.blue,
sizeof(
short) * ramp->
size);
148 if (monitor->null.ramp.size != ramp->
size)
151 "Null: Gamma ramp size must match current ramp size");
155 memcpy(monitor->null.ramp.red, ramp->
red,
sizeof(
short) * ramp->
size);
156 memcpy(monitor->null.ramp.green, ramp->
green,
sizeof(
short) * ramp->
size);
157 memcpy(monitor->null.ramp.blue, ramp->
blue,
sizeof(
short) * ramp->
size);
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
void _glfwInputError(int code, const char *format,...)
float _glfw_fminf(float a, float b)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
#define _GLFW_INSERT_FIRST
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwPollMonitorsNull(void)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *found)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor *monitor, int *xpos, int *ypos, int *width, int *height)