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

View File

@ -191,14 +191,12 @@ 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);
}
} }

View File

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