mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Merged with master.
This commit is contained in:
commit
c7a5474bfc
7
.gitignore
vendored
7
.gitignore
vendored
@ -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
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -50,8 +50,6 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
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;
|
||||
|
||||
@ -80,8 +78,6 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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__)
|
||||
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user