Make glfwSetGamma use powf instead of pow

Related to #1125.
master
Camilla Löwy ago%!(EXTRA string=8 years)
parent 8dab9f6ab1
commit ce4672d74b
  1. 10
      src/monitor.c

@ -406,16 +406,16 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
for (i = 0; i < 256; i++)
{
double value;
float value;
// Calculate intensity
value = i / 255.0;
value = i / 255.f;
// 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
if (value > 65535.0)
value = 65535.0;
if (value > 65535.f)
value = 65535.f;
values[i] = (unsigned short) value;
}

Loading…
Cancel
Save