diff --git a/.gitignore b/.gitignore index 9df01be7..acba2420 100644 --- a/.gitignore +++ b/.gitignore @@ -22,13 +22,18 @@ Makefile *.resource.txt *.so src/config.h +src/libglfw.a +src/libglfw.pc +src/libglfw.so *.swp tests/accuracy tests/defaults +tests/dynamic tests/events tests/fsaa tests/fsfocus tests/gamma +tests/glfwinfo tests/iconify tests/joysticks tests/listmodes @@ -38,5 +43,3 @@ tests/sharing tests/tearing tests/version tests/windows -tests/dynamic -tests/glfwinfo diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 35a5d80a..93cc11a0 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -39,16 +39,6 @@ extern "C" { * Global definitions *************************************************************************/ -/* We need a NULL pointer from time to time */ -#ifndef NULL - #ifdef __cplusplus - #define NULL 0 - #else - #define NULL ((void*) 0) - #endif -#endif /* NULL */ - - /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ /* Please report any probles that you find with your compiler, which may @@ -75,7 +65,6 @@ extern "C" { #else #define APIENTRY #endif - #define GLFW_APIENTRY_DEFINED #endif /* APIENTRY */ @@ -640,11 +629,6 @@ GLFWAPI void glfwDisable(GLFWwindow window, int token); /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ -#ifdef GLFW_APIENTRY_DEFINED - #undef APIENTRY - #undef GLFW_APIENTRY_DEFINED -#endif - #ifdef GLFW_WINGDIAPI_DEFINED #undef WINGDIAPI #undef GLFW_WINGDIAPI_DEFINED diff --git a/readme.html b/readme.html index 175e3b81..ede37bdc 100644 --- a/readme.html +++ b/readme.html @@ -314,6 +314,7 @@ version of GLFW.

  • [X11] Added support for the GLX_EXT_swap_control extension as an alternative to GLX_SGI_swap_control
  • [X11] Added the POSIX CLOCK_MONOTONIC time source as the preferred method
  • [X11] Bugfix: Calling glXCreateContextAttribsARB with an unavailable OpenGL version caused the application to terminate with a BadMatch Xlib error
  • +
  • [X11] Bugfix: A synchronization point necessary for jitter-free locked cursor mode was incorrectly removed
  • [Win32] Removed explicit support for versions of Windows older than Windows XP
  • [Win32] Bugfix: Window activation and iconification did not work as expected
  • [Win32] Bugfix: Software rasterizer pixel formats were not discarded by the WGL_ARB_pixel_format code path
  • diff --git a/src/cocoa_gamma.m b/src/cocoa_gamma.m index 4f21314a..eb291082 100644 --- a/src/cocoa_gamma.m +++ b/src/cocoa_gamma.m @@ -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); } diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 785cd267..4370249f 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -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; } diff --git a/src/error.c b/src/error.c index 574f84cd..2b46a72c 100644 --- a/src/error.c +++ b/src/error.c @@ -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) diff --git a/src/win32_init.c b/src/win32_init.c index 9ef800d4..0f1c27c0 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -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__) diff --git a/src/win32_platform.h b/src/win32_platform.h index 91c71fbe..3c2892c7 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -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 #include #include diff --git a/src/x11_init.c b/src/x11_init.c index 08008fbb..5697eb37 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -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) diff --git a/src/x11_window.c b/src/x11_window.c index 61e39583..641b3c84 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -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 ); } } }