Merged with master.

This commit is contained in:
Marcel Metz 2012-01-24 18:00:51 +01:00
commit c7a5474bfc
10 changed files with 29 additions and 30 deletions

7
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -314,6 +314,7 @@ version of GLFW.</p>
<li>[X11] Added support for the <code>GLX_EXT_swap_control</code> extension as an alternative to <code>GLX_SGI_swap_control</code></li>
<li>[X11] Added the POSIX <code>CLOCK_MONOTONIC</code> time source as the preferred method</li>
<li>[X11] Bugfix: Calling <code>glXCreateContextAttribsARB</code> with an unavailable OpenGL version caused the application to terminate with a <code>BadMatch</code> Xlib error</li>
<li>[X11] Bugfix: A synchronization point necessary for jitter-free locked cursor mode was incorrectly removed</li>
<li>[Win32] Removed explicit support for versions of Windows older than Windows XP</li>
<li>[Win32] Bugfix: Window activation and iconification did not work as expected</li>
<li>[Win32] Bugfix: Software rasterizer pixel formats were not discarded by the WGL_ARB_pixel_format code path</li>

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);
}

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;
}

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)

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__)

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>

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)

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 );
}
}
}