Merged with master.

This commit is contained in:
Marcel Metz
2012-01-24 18:00:51 +01:00
10 changed files with 29 additions and 30 deletions
+5 -8
View File
@@ -48,13 +48,11 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
CGGammaValue red[GLFW_GAMMA_RAMP_SIZE];
CGGammaValue green[GLFW_GAMMA_RAMP_SIZE];
CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE];
// For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE
// i.e. 256. I don't think anyone would want to change the gamma on
// Mac anyway...
if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE)
return;
CGGetDisplayTransferByTable(CGMainDisplayID(), GLFW_GAMMA_RAMP_SIZE, red, green, blue,
&sampleCount);
@@ -78,13 +76,11 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
CGGammaValue red[GLFW_GAMMA_RAMP_SIZE];
CGGammaValue green[GLFW_GAMMA_RAMP_SIZE];
CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE];
// For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE
// i.e. 256. I don't think anyone would want to change the gamma on
// Mac anyway...
if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE)
return;
// Convert to float & take the difference of the original gamma and
// the linear function.
for (i = 0; i < size; i++)
@@ -93,6 +89,7 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
green[i] = ramp->green[i] / 65535.f;
blue[i] = ramp->blue[i] / 65535.f;
}
CGSetDisplayTransferByTable(CGMainDisplayID(), GLFW_GAMMA_RAMP_SIZE, red, green, blue);
}
+1 -1
View File
@@ -261,7 +261,7 @@ int _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void)
{
const char* version = "GLFW " _GLFW_VERSION_FULL " Cocoa";
const char* version = _GLFW_VERSION_FULL " Cocoa";
return version;
}
+1
View File
@@ -117,6 +117,7 @@ GLFWAPI const char* glfwErrorString(int error)
//========================================================================
// Sets the callback function for GLFW errors
// This function may be called without GLFW having been initialized
//========================================================================
GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun)
+1 -1
View File
@@ -209,7 +209,7 @@ int _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void)
{
const char* version = "GLFW " _GLFW_VERSION_FULL
const char* version = _GLFW_VERSION_FULL
#if defined(__MINGW32__)
" MinGW"
#elif defined(__CYGWIN__)
+5
View File
@@ -40,6 +40,11 @@
#define WIN32_LEAN_AND_MEAN
#endif
// This is a workaround for the fact that glfw3.h needs to export APIENTRY (to
// correctly declare a GL_ARB_debug_output callback, for example) but windows.h
// thinks it is the only one that gets to do so
#undef APIENTRY
#include <windows.h>
#include <mmsystem.h>
#include <Dbt.h>
+5 -2
View File
@@ -366,7 +366,7 @@ static void updateKeyCodeLUT(void)
static GLboolean initDisplay(void)
{
_glfwLibrary.X11.display = XOpenDisplay(0);
_glfwLibrary.X11.display = XOpenDisplay(NULL);
if (!_glfwLibrary.X11.display)
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11/GLX: Failed to open X display");
@@ -624,7 +624,7 @@ int _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void)
{
const char* version = "GLFW " _GLFW_VERSION_FULL
const char* version = _GLFW_VERSION_FULL
#if defined(_GLFW_HAS_XRANDR)
" XRandR"
#endif
@@ -634,6 +634,9 @@ const char* _glfwPlatformGetVersionString(void)
#if !defined(_GLFW_HAS_XRANDR) && !defined(_GLFW_HAS_XF86VIDMODE)
" no-mode-switching-support"
#endif
#if defined(_GLFW_HAS_XKB)
" Xkb"
#endif
#if defined(_GLFW_HAS_GLXGETPROCADDRESS)
" glXGetProcAddress"
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSARB)
+5
View File
@@ -1736,6 +1736,11 @@ void _glfwPlatformPollEvents(void)
window->width / 2,
window->height / 2);
window->X11.cursorCentered = GL_TRUE;
// NOTE: This is a temporary fix. It works as long as you use
// offsets accumulated over the course of a frame, instead of
// performing the necessary actions per callback call.
XFlush( _glfwLibrary.X11.display );
}
}
}