mirror of
https://github.com/glfw/glfw.git
synced 2025-07-29 11:00:04 +00:00
Merge c0e8caebe6
into dcb4d8ee32
This commit is contained in:
commit
d0b706af0a
@ -88,10 +88,10 @@ 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)
|
||||
// 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;
|
||||
|
@ -191,15 +191,13 @@ static GLXContext createLegacyContext(_GLFWwindow* window,
|
||||
share,
|
||||
True);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return glXCreateNewContext(_glfw.x11.display,
|
||||
fbconfig,
|
||||
GLX_RGBA_TYPE,
|
||||
share,
|
||||
True);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user