This commit is contained in:
siavashserver 2013-07-04 17:04:55 -07:00
commit d0b706af0a
3 changed files with 12 additions and 14 deletions

View File

@ -88,11 +88,11 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
// Apply gamma curve
value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f;
// Clamp to value range
if (value < 0.f)
value = 0.f;
else if (value > 65535.f)
value = 65535.f;
// Clamp to value range [0.f, 65535.f]
// There isn't any need to check for values smaller than zero.
// It is always positive and bigger than 0.5f.
if (value > 65535.f)
value = 65535.f;
values[i] = (unsigned short) value;
}

View File

@ -191,14 +191,12 @@ static GLXContext createLegacyContext(_GLFWwindow* window,
share,
True);
}
else
{
return glXCreateNewContext(_glfw.x11.display,
fbconfig,
GLX_RGBA_TYPE,
share,
True);
}
return glXCreateNewContext(_glfw.x11.display,
fbconfig,
GLX_RGBA_TYPE,
share,
True);
}

View File

@ -64,7 +64,7 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
_glfw.cursorPosY = window->cursorPosY;
_glfwPlatformGetWindowSize(window, &width, &height);
_glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0);
_glfwPlatformSetCursorPos(window, width * 0.5, height * 0.5);
}
_glfwPlatformSetCursorMode(window, newMode);