Make it compile with EGL
This commit is contained in:
parent
b145ad6065
commit
0f0509cbd9
2 changed files with 10 additions and 0 deletions
|
@ -119,6 +119,7 @@ void CompositingPrefs::detect()
|
|||
}
|
||||
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
// HACK: This is needed for AIGLX
|
||||
if( qstrcmp( qgetenv( "KWIN_DIRECT_GL" ), "1" ) != 0 )
|
||||
{
|
||||
|
@ -160,12 +161,14 @@ void CompositingPrefs::detect()
|
|||
else
|
||||
glXMakeCurrent( display(), olddrawable, oldcontext );
|
||||
deleteGLXContext();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CompositingPrefs::initGLXContext()
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
mGLContext = NULL;
|
||||
KXErrorHandler handler;
|
||||
// Most of this code has been taken from glxinfo.c
|
||||
|
@ -209,6 +212,9 @@ bool CompositingPrefs::initGLXContext()
|
|||
visinfo->visual, mask, &attr );
|
||||
|
||||
return glXMakeCurrent( display(), mGLWindow, mGLContext ) && !handler.error( true );
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -217,11 +223,13 @@ bool CompositingPrefs::initGLXContext()
|
|||
void CompositingPrefs::deleteGLXContext()
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
if( mGLContext == NULL )
|
||||
return;
|
||||
glXDestroyContext( display(), mGLContext );
|
||||
XDestroyWindow( display(), mGLWindow );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void CompositingPrefs::detectDriverAndVersion()
|
||||
|
|
|
@ -67,9 +67,11 @@ private:
|
|||
bool mStrictBinding;
|
||||
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
GLXContext mGLContext;
|
||||
Window mGLWindow;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue