print the GL version in use
[gltest.git] / glxbackend.cpp
index 9f8ed3e257d5aac8ec10239ecd33b9934332028b..b2383826b66c257090493d5c530f09f27b2aa6c9 100644 (file)
 #include <GL/glxext.h>
 #include <string>
 
-/* attributes for a double buffered visual in RGBA format with at least
-* 4 bits per color */                       
+#if !defined(CON_GL1)
+#error "Valid GL contexts for GLX are: GL1"
+#endif
+
+// attributes for a double buffered visual in RGBA format with at least 4 bits per color
 static int attrList[] =                                             
-{                                                                      
+{
        GLX_RGBA, GLX_DOUBLEBUFFER,
-       GLX_RED_SIZE, 4,                                                   
-       GLX_GREEN_SIZE, 4,                                                 
+       GLX_RED_SIZE, 4,
+       GLX_GREEN_SIZE, 4,
        GLX_BLUE_SIZE, 4,
-       None                                                               
+       None
 };
 
 VisualID GLXBackend::initialize(Display *display)
@@ -42,7 +45,7 @@ VisualID GLXBackend::initialize(Display *display)
                // debugging: show version information
                int glxMajor, glxMinor;
                glXQueryVersion(display, &glxMajor, &glxMinor);
-               printf("Using GLX version %d.%d\n", glxMajor, glxMinor);
+               printf("Using GLX version: %d.%d\n", glxMajor, glxMinor);
                // check for swap control functions
                const char *extensions = glXQueryExtensionsString(display, DefaultScreen(display));
                if (std::string(extensions).find("GLX_MESA_swap_control") != std::string::npos) {