diff --git a/glutils.cpp b/glutils.cpp index 1b0b28ed84..eb74c6cd08 100644 --- a/glutils.cpp +++ b/glutils.cpp @@ -13,12 +13,15 @@ License. See the file "COPYING" for the exact licensing terms. #include +#define MAKE_GL_VERSION(major, minor, release) ( ((major) << 16) | ((minor) << 8) | (release) ) + + namespace KWinInternal { // Variables -// GL version, use MAKE_OPENGL_VERSION() macro for comparing with a specific version +// GL version, use MAKE_GL_VERSION() macro for comparing with a specific version static int glVersion; -// GLX version, use MAKE_GLX_VERSION() macro for comparing with a specific version +// GLX version, use MAKE_GL_VERSION() macro for comparing with a specific version static int glXVersion; // List of all supported GL and GLX extensions static QStringList glExtensions; @@ -56,7 +59,7 @@ void initGLX() // Get GLX version int major, minor; glXQueryVersion( display(), &major, &minor ); - glXVersion = MAKE_GLX_VERSION( major, minor, 0 ); + glXVersion = MAKE_GL_VERSION( major, minor, 0 ); // Get list of supported GLX extensions. Simply add it to the list of OpenGL extensions. glExtensions += QString((const char*)glXQueryExtensionsString( display(), DefaultScreen( display()))).split(" "); @@ -97,7 +100,7 @@ void initGL() // Get OpenGL version QString glversionstring = QString((const char*)glGetString(GL_VERSION)); QStringList glversioninfo = glversionstring.left(glversionstring.indexOf(' ')).split('.'); - glVersion = MAKE_OPENGL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), + glVersion = MAKE_GL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), glversioninfo.count() > 2 ? glversioninfo[2].toInt() : 0); // Get list of supported OpenGL extensions glExtensions = QString((const char*)glGetString(GL_EXTENSIONS)).split(" "); @@ -120,12 +123,12 @@ void initGL() bool hasGLVersion(int major, int minor, int release) { - return glVersion >= MAKE_OPENGL_VERSION(major, minor, release); + return glVersion >= MAKE_GL_VERSION(major, minor, release); } bool hasGLXVersion(int major, int minor, int release) { - return glXVersion >= MAKE_GLX_VERSION(major, minor, release); + return glXVersion >= MAKE_GL_VERSION(major, minor, release); } bool hasGLExtension(const QString& extension) diff --git a/glutils.h b/glutils.h index 1e80e09065..b72d84840e 100644 --- a/glutils.h +++ b/glutils.h @@ -22,10 +22,6 @@ License. See the file "COPYING" for the exact licensing terms. #include -#define MAKE_OPENGL_VERSION(major, minor, release) ( ((major) << 16) | ((minor) << 8) | (release) ) -#define MAKE_GLX_VERSION(major, minor, release) ( ((major) << 16) | ((minor) << 8) | (release) ) - - namespace KWinInternal {