Merge branch 'master' into multi-monitor

This commit is contained in:
Camilla Berglund 2012-07-20 01:05:09 +02:00
commit f559b217af
10 changed files with 39 additions and 4 deletions

View File

@ -11,7 +11,7 @@ To use these files you add a special parameter when configuring the source tree:
For example, to use the Debian GNU/Linux MinGW package, run CMake like this: For example, to use the Debian GNU/Linux MinGW package, run CMake like this:
cmake -DCMAKE_TOOLCHAIN_FILE=CMake/linux-i586-mingw32msvc.cmake . cmake -DCMAKE_TOOLCHAIN_FILE=CMake/i586-mingw32msvc.cmake .
For more details see this article: For more details see this article:

View File

@ -54,6 +54,21 @@ if (_GLFW_WIN32_WGL)
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
if (MSVC)
option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
foreach (flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if (${flag} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
endif()
if (${flag} MATCHES "/MDd")
string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
endif()
endforeach()
endif()
endif()
set(_GLFW_NO_DLOAD_WINMM ${BUILD_SHARED_LIBS}) set(_GLFW_NO_DLOAD_WINMM ${BUILD_SHARED_LIBS})
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
@ -178,7 +193,7 @@ if (_GLFW_COCOA_NSGL)
set(CMAKE_OSX_ARCHITECTURES ppc;i386;ppc64;x86_64) set(CMAKE_OSX_ARCHITECTURES ppc;i386;ppc64;x86_64)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
set(CMAKE_C_FLAGS "-mmacosx-version-min=10.5") set(CMAKE_C_FLAGS "-mmacosx-version-min=10.5")
else(GLFW_BUILD_UNIVERSAL) else()
message(STATUS "Building GLFW only for the native architecture") message(STATUS "Building GLFW only for the native architecture")
endif() endif()

View File

@ -335,7 +335,7 @@ version of GLFW.</p>
<li>[Cocoa] Bugfix: The cursor position incorrectly rounded during conversion</li> <li>[Cocoa] Bugfix: The cursor position incorrectly rounded during conversion</li>
<li>[Cocoa] Bugfix: Cursor positioning led to nonsensical results for fullscreen windows</li> <li>[Cocoa] Bugfix: Cursor positioning led to nonsensical results for fullscreen windows</li>
<li>[Cocoa] Bugfix: The GLFW window was flagged as restorable</li> <li>[Cocoa] Bugfix: The GLFW window was flagged as restorable</li>
<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 support for the <code>GLX_EXT_swap_control</code> and <code>GLX_MESA_swap_control</code> extensions as alternatives 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] Added the POSIX <code>CLOCK_MONOTONIC</code> time source as the preferred method</li>
<li>[X11] Added dependency on libm, where present</li> <li>[X11] Added dependency on libm, where present</li>
<li>[X11] Added support for the <code>_NET_WM_NAME</code> and <code>_NET_WM_ICON_NAME</code> EWMH window properties</li> <li>[X11] Added support for the <code>_NET_WM_NAME</code> and <code>_NET_WM_ICON_NAME</code> EWMH window properties</li>

View File

@ -544,6 +544,15 @@ int _glfwInitOpenGL(void)
_glfwLibrary.GLX.SGI_swap_control = GL_TRUE; _glfwLibrary.GLX.SGI_swap_control = GL_TRUE;
} }
if (_glfwPlatformExtensionSupported("GLX_MESA_swap_control"))
{
_glfwLibrary.GLX.SwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)
_glfwPlatformGetProcAddress("glXSwapIntervalMESA");
if (_glfwLibrary.GLX.SwapIntervalMESA)
_glfwLibrary.GLX.MESA_swap_control = GL_TRUE;
}
if (_glfwPlatformExtensionSupported("GLX_SGIX_fbconfig")) if (_glfwPlatformExtensionSupported("GLX_SGIX_fbconfig"))
{ {
_glfwLibrary.GLX.GetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC) _glfwLibrary.GLX.GetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)
@ -722,9 +731,14 @@ void _glfwPlatformSwapInterval(int interval)
window->X11.handle, window->X11.handle,
interval); interval);
} }
else if (_glfwLibrary.GLX.MESA_swap_control)
_glfwLibrary.GLX.SwapIntervalMESA(interval);
else if (_glfwLibrary.GLX.SGI_swap_control) else if (_glfwLibrary.GLX.SGI_swap_control)
{
if (interval > 0)
_glfwLibrary.GLX.SwapIntervalSGI(interval); _glfwLibrary.GLX.SwapIntervalSGI(interval);
} }
}
//======================================================================== //========================================================================

View File

@ -100,6 +100,10 @@
#define _GLFW_CONVERSION_SUCCEEDED 1 #define _GLFW_CONVERSION_SUCCEEDED 1
#define _GLFW_CONVERSION_FAILED 2 #define _GLFW_CONVERSION_FAILED 2
#ifndef GLX_MESA_swap_control
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int);
#endif
//======================================================================== //========================================================================
// GLFW platform specific types // GLFW platform specific types
@ -245,6 +249,7 @@ typedef struct _GLFWlibraryGLX
// GLX extensions // GLX extensions
PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI; PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI;
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT; PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA;
PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX; PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX;
PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX; PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX;
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX; PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
@ -253,6 +258,7 @@ typedef struct _GLFWlibraryGLX
GLboolean SGIX_fbconfig; GLboolean SGIX_fbconfig;
GLboolean SGI_swap_control; GLboolean SGI_swap_control;
GLboolean EXT_swap_control; GLboolean EXT_swap_control;
GLboolean MESA_swap_control;
GLboolean ARB_multisample; GLboolean ARB_multisample;
GLboolean ARB_create_context; GLboolean ARB_create_context;
GLboolean ARB_create_context_profile; GLboolean ARB_create_context_profile;