mirror of
https://github.com/glfw/glfw.git
synced 2024-11-23 02:25:10 +00:00
Cleanup.
This commit is contained in:
parent
dcb4d8ee32
commit
763ec6cbcb
12
src/gamma.c
12
src/gamma.c
@ -81,18 +81,16 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
|
|||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
float value;
|
double value;
|
||||||
|
|
||||||
// Calculate intensity
|
// Calculate intensity
|
||||||
value = i / 255.f;
|
value = i / 255.0;
|
||||||
// Apply gamma curve
|
// Apply gamma curve
|
||||||
value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f;
|
value = pow(value, 1.0 / gamma) * 65535.0 + 0.5;
|
||||||
|
|
||||||
// Clamp to value range
|
// Clamp to value range
|
||||||
if (value < 0.f)
|
if (value > 65535.0)
|
||||||
value = 0.f;
|
value = 65535.0;
|
||||||
else if (value > 65535.f)
|
|
||||||
value = 65535.f;
|
|
||||||
|
|
||||||
values[i] = (unsigned short) value;
|
values[i] = (unsigned short) value;
|
||||||
}
|
}
|
||||||
|
@ -191,15 +191,13 @@ static GLXContext createLegacyContext(_GLFWwindow* window,
|
|||||||
share,
|
share,
|
||||||
True);
|
True);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return glXCreateNewContext(_glfw.x11.display,
|
return glXCreateNewContext(_glfw.x11.display,
|
||||||
fbconfig,
|
fbconfig,
|
||||||
GLX_RGBA_TYPE,
|
GLX_RGBA_TYPE,
|
||||||
share,
|
share,
|
||||||
True);
|
True);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user