1 --- slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx.oglvsync~ 2008-07-07 20:49:22.348097043 +0200
2 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-07-07 20:53:29.174846394 +0200
5 ************************************************************************/
7 +#define GLX_GLXEXT_PROTOTYPES 1
8 #include "OGLTrans_TransitionImpl.hxx"
10 #include <com/sun/star/rendering/IntegerBitmapLayout.hpp>
11 @@ -71,6 +72,7 @@ namespace unx
13 #include <X11/keysym.h>
15 +#include <GL/glxext.h>
19 @@ -128,6 +130,9 @@ private:
23 + const char* GLXExtensions;
25 + bool HasGLXExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, (const GLubyte*) GLXExtensions ); };
28 /** OpenGL handle to the leaving slide's texture
29 @@ -295,6 +300,8 @@ void OGLTransitionerImpl::initWindowFrom
31 GLWin.dpy = reinterpret_cast<unx::Display*>(pChildSysData->pDisplay);
32 GLWin.win = pChildSysData->aWindow;
33 + GLWin.GLXExtensions = unx::glXQueryExtensionsString( GLWin.dpy, GLWin.screen );
34 + OSL_TRACE("available GLX extensions: %s", GLWin.GLXExtensions);
38 @@ -335,6 +342,15 @@ void OGLTransitionerImpl::initWindowFrom
39 wglMakeCurrent(GLWin.hDC,GLWin.hRC);
41 glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx );
42 + if(GLWin.HasGLXExtension("GLX_SGI_swap_control")) {
44 + typedef GLint (*glXSwapIntervalProc)(GLint);
45 + glXSwapIntervalProc glXSwapInterval = (glXSwapIntervalProc) unx::glXGetProcAddress( (const GLubyte*) "glXSwapIntervalSGI" );
46 + if( glXSwapInterval ) {
47 + glXSwapInterval( 1 );
48 + OSL_TRACE("set swap interval to 1 (enable vsync)");
51 /* TODO: check for version once the bug in fglrx driver is fixed */
52 bBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );