mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 21:37:27 +00:00
Clarified names of gamma array helper functions.
This commit is contained in:
parent
209a470a5f
commit
d7512f529c
@ -52,7 +52,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
|||||||
values + size * 2,
|
values + size * 2,
|
||||||
&size);
|
&size);
|
||||||
|
|
||||||
_glfwAllocGammaRamp(ramp, size);
|
_glfwAllocGammaArrays(ramp, size);
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
////// GLFW internal API //////
|
////// GLFW internal API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void _glfwAllocGammaRamp(GLFWgammaramp* ramp, unsigned int size)
|
void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size)
|
||||||
{
|
{
|
||||||
ramp->red = (unsigned short*) calloc(size, sizeof(unsigned short));
|
ramp->red = (unsigned short*) calloc(size, sizeof(unsigned short));
|
||||||
ramp->green = (unsigned short*) calloc(size, sizeof(unsigned short));
|
ramp->green = (unsigned short*) calloc(size, sizeof(unsigned short));
|
||||||
@ -50,7 +50,7 @@ void _glfwAllocGammaRamp(GLFWgammaramp* ramp, unsigned int size)
|
|||||||
ramp->size = size;
|
ramp->size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwFreeGammaRamp(GLFWgammaramp* ramp)
|
void _glfwFreeGammaArrays(GLFWgammaramp* ramp)
|
||||||
{
|
{
|
||||||
free(ramp->red);
|
free(ramp->red);
|
||||||
free(ramp->green);
|
free(ramp->green);
|
||||||
@ -111,7 +111,7 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle)
|
|||||||
|
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
|
||||||
_glfwFreeGammaRamp(&monitor->currentRamp);
|
_glfwFreeGammaArrays(&monitor->currentRamp);
|
||||||
_glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp);
|
_glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp);
|
||||||
|
|
||||||
return &monitor->currentRamp;
|
return &monitor->currentRamp;
|
||||||
|
@ -735,11 +735,11 @@ GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);
|
|||||||
|
|
||||||
/*! @ingroup utility
|
/*! @ingroup utility
|
||||||
*/
|
*/
|
||||||
void _glfwAllocGammaRamp(GLFWgammaramp* ramp, unsigned int size);
|
void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
|
||||||
|
|
||||||
/*! @ingroup utility
|
/*! @ingroup utility
|
||||||
*/
|
*/
|
||||||
void _glfwFreeGammaRamp(GLFWgammaramp* ramp);
|
void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
|
||||||
|
|
||||||
/*! @ingroup utility
|
/*! @ingroup utility
|
||||||
*/
|
*/
|
||||||
|
@ -193,8 +193,8 @@ void _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
|||||||
if (monitor == NULL)
|
if (monitor == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_glfwFreeGammaRamp(&monitor->originalRamp);
|
_glfwFreeGammaArrays(&monitor->originalRamp);
|
||||||
_glfwFreeGammaRamp(&monitor->currentRamp);
|
_glfwFreeGammaArrays(&monitor->currentRamp);
|
||||||
|
|
||||||
free(monitor->modes);
|
free(monitor->modes);
|
||||||
free(monitor->name);
|
free(monitor->name);
|
||||||
|
@ -50,7 +50,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
|||||||
GetDeviceGammaRamp(dc, values);
|
GetDeviceGammaRamp(dc, values);
|
||||||
DeleteDC(dc);
|
DeleteDC(dc);
|
||||||
|
|
||||||
_glfwAllocGammaRamp(ramp, 256);
|
_glfwAllocGammaArrays(ramp, 256);
|
||||||
|
|
||||||
memcpy(ramp->red, values + 0, 256 * sizeof(unsigned short));
|
memcpy(ramp->red, values + 0, 256 * sizeof(unsigned short));
|
||||||
memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short));
|
memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short));
|
||||||
|
@ -79,7 +79,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
|||||||
XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfw.x11.display,
|
XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfw.x11.display,
|
||||||
monitor->x11.crtc);
|
monitor->x11.crtc);
|
||||||
|
|
||||||
_glfwAllocGammaRamp(ramp, size);
|
_glfwAllocGammaArrays(ramp, size);
|
||||||
|
|
||||||
memcpy(ramp->red, gamma->red, size * sizeof(unsigned short));
|
memcpy(ramp->red, gamma->red, size * sizeof(unsigned short));
|
||||||
memcpy(ramp->green, gamma->green, size * sizeof(unsigned short));
|
memcpy(ramp->green, gamma->green, size * sizeof(unsigned short));
|
||||||
@ -92,7 +92,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
|||||||
int size;
|
int size;
|
||||||
XF86VidModeGetGammaRampSize(_glfw.x11.display, _glfw.x11.screen, &size);
|
XF86VidModeGetGammaRampSize(_glfw.x11.display, _glfw.x11.screen, &size);
|
||||||
|
|
||||||
_glfwAllocGammaRamp(ramp, size);
|
_glfwAllocGammaArrays(ramp, size);
|
||||||
|
|
||||||
XF86VidModeGetGammaRamp(_glfw.x11.display,
|
XF86VidModeGetGammaRamp(_glfw.x11.display,
|
||||||
_glfw.x11.screen,
|
_glfw.x11.screen,
|
||||||
|
Loading…
Reference in New Issue
Block a user