aboutsummaryrefslogtreecommitdiff
path: root/samples/OpenGL/x11argb_opengl/x11argb_opengl.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenGL/x11argb_opengl/x11argb_opengl.c')
-rw-r--r--samples/OpenGL/x11argb_opengl/x11argb_opengl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/samples/OpenGL/x11argb_opengl/x11argb_opengl.c b/samples/OpenGL/x11argb_opengl/x11argb_opengl.c
index bf470b6..fb1b54c 100644
--- a/samples/OpenGL/x11argb_opengl/x11argb_opengl.c
+++ b/samples/OpenGL/x11argb_opengl/x11argb_opengl.c
@@ -160,6 +160,7 @@ static void createTheWindow()
if(pict_format->direct.alphaMask > 0) {
break;
}
+ XFree(visual);
}
if(!fbconfig) {
@@ -253,7 +254,7 @@ static void createTheWindow()
static int ctxErrorHandler( Display *dpy, XErrorEvent *ev )
{
- fputs("Error at context creation", stderr);
+ fputs("Error at context creation\n", stderr);
return 0;
}
@@ -270,12 +271,12 @@ static void createTheRenderContext()
render_context = NULL;
if( isExtensionSupported( glXQueryExtensionsString(Xdisplay, DefaultScreen(Xdisplay)), "GLX_ARB_create_context" ) ) {
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
- glXCreateContextAttribsARBProc glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
+ glXCreateContextAttribsARBProc glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)glXGetProcAddressARB("glXCreateContextAttribsARB" );
if( glXCreateContextAttribsARB ) {
int context_attribs[] =
{
- GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
- GLX_CONTEXT_MINOR_VERSION_ARB, 0,
+ GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
+ GLX_CONTEXT_MINOR_VERSION_ARB, 1,
//GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
None
};
@@ -286,17 +287,16 @@ static void createTheRenderContext()
XSync( Xdisplay, False );
XSetErrorHandler( oldHandler );
-
- fputs("glXCreateContextAttribsARB failed", stderr);
} else {
- fputs("glXCreateContextAttribsARB could not be retrieved", stderr);
+ fputs("glXCreateContextAttribsARB could not be retrieved\n", stderr);
}
} else {
- fputs("glXCreateContextAttribsARB not supported", stderr);
+ fputs("glXCreateContextAttribsARB not supported\n", stderr);
}
if(!render_context)
{
+ fputs("using fallback\n", stderr);
#else
{
#endif