*/
#include "glxbackend.h"
+#include "glutil.h"
#include <stdio.h>
#include <assert.h>
#include <GL/glxext.h>
#include <string>
+#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[] =
{
// 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) {
context = glXCreateContext(display, vi, 0, GL_TRUE);
glXMakeCurrent(display, window, context);
assert(glXIsDirect(display, context));
+ printf("Using GL version: %s\n", glGetString(GL_VERSION));
+ // initialise GL utilities
+ resolveFunctionPointers((T_glGetProcAddress)glXGetProcAddress);
}
GLXBackend::~GLXBackend()