mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
parent
8dab9f6ab1
commit
ce4672d74b
@ -406,16 +406,16 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
|
|||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
double value;
|
float value;
|
||||||
|
|
||||||
// Calculate intensity
|
// Calculate intensity
|
||||||
value = i / 255.0;
|
value = i / 255.f;
|
||||||
// Apply gamma curve
|
// Apply gamma curve
|
||||||
value = pow(value, 1.0 / gamma) * 65535.0 + 0.5;
|
value = powf(value, 1.f / gamma) * 65535.f + 0.5f;
|
||||||
|
|
||||||
// Clamp to value range
|
// Clamp to value range
|
||||||
if (value > 65535.0)
|
if (value > 65535.f)
|
||||||
value = 65535.0;
|
value = 65535.f;
|
||||||
|
|
||||||
values[i] = (unsigned short) value;
|
values[i] = (unsigned short) value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user