diff options
author | Sven Gothel <[email protected]> | 2012-09-29 03:14:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-09-29 03:14:30 +0200 |
commit | e0904a65bcf87ea0fd41d76cc1af7ad29daaefb5 (patch) | |
tree | 009fe4b34f9ec24c0059e4ea6294f23e7bb61bf3 /src/test-native/glExtensionsListGL3.c | |
parent | 18ae6451a5531f46f56389bd7071db1d988e80d7 (diff) |
Misc X11: Add GLX_MESA_swap_control; GLXExtensions (private); X11GLXContext commented out GLX_MESA_swap_control; native test of Mesa context-retarget bug, cannot reproduce yet.
Diffstat (limited to 'src/test-native/glExtensionsListGL3.c')
-rw-r--r-- | src/test-native/glExtensionsListGL3.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/test-native/glExtensionsListGL3.c b/src/test-native/glExtensionsListGL3.c index c531577e8..5875c10bc 100644 --- a/src/test-native/glExtensionsListGL3.c +++ b/src/test-native/glExtensionsListGL3.c @@ -59,6 +59,8 @@ void dumpGLExtension() { int i, n; fprintf(stderr, "GL_VENDOR: %s\n", glGetString(GL_VENDOR)); + fprintf(stderr, "GL_VERSION: %s\n", glGetString(GL_VERSION)); + fprintf(stderr, "GL_RENDERER: %s\n", glGetString(GL_RENDERER)); glGetIntegerv(GL_NUM_EXTENSIONS, &n); fprintf(stderr, "GL_NUM_EXTENSIONS: %d\n", n); @@ -153,9 +155,6 @@ int main (int argc, char ** argv) GLXFBConfig bestFbc = fbc[ best_fbc ]; - // Be sure to free the FBConfig list allocated by glXChooseFBConfig() - XFree( fbc ); - // Get a visual XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc ); printf( "Chosen visual ID = 0x%x\n", (int) vi->visualid ); @@ -190,8 +189,9 @@ int main (int argc, char ** argv) XMapWindow( display, win ); // Get the default screen's GLX extension list - const char *glxExts = glXQueryExtensionsString( display, - DefaultScreen( display ) ); + const char *glxExts01 = glXQueryExtensionsString( display, DefaultScreen( display ) ); + const char *glxExts02 = glXGetClientString( display, GLX_EXTENSIONS); + const char *glxExts03 = glXQueryServerString( display, DefaultScreen( display ), GLX_EXTENSIONS); // NOTE: It is not necessary to create or make current to a context before // calling glXGetProcAddressARB @@ -213,11 +213,16 @@ int main (int argc, char ** argv) // Check for the GLX_ARB_create_context extension string and the function. // If either is not present, use GLX 1.3 context creation method. - if ( !isExtensionSupported( glxExts, "GLX_ARB_create_context" ) || - !glXCreateContextAttribsARB ) + bool isGLX_ARB_create_contextAvail = isExtensionSupported( glxExts01, "GLX_ARB_create_context" ) || + isExtensionSupported( glxExts02, "GLX_ARB_create_context" ) || + isExtensionSupported( glxExts03, "GLX_ARB_create_context" ); + if ( !isGLX_ARB_create_contextAvail || !glXCreateContextAttribsARB ) { printf( "glXCreateContextAttribsARB() not found" " ... using old-style GLX context\n" ); + printf( "extensions 01: %s\n", glxExts01); + printf( "extensions 02: %s\n", glxExts02); + printf( "extensions 03: %s\n", glxExts03); ctx = glXCreateNewContext( display, bestFbc, GLX_RGBA_TYPE, 0, True ); } @@ -229,7 +234,8 @@ int main (int argc, char ** argv) GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 0, GLX_RENDER_TYPE , GLX_RGBA_TYPE, - GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + // GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + // GLX_CONTEXT_PROFILE_MASK_ARB , GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB None }; @@ -261,6 +267,9 @@ int main (int argc, char ** argv) } } + // Be sure to free the FBConfig list allocated by glXChooseFBConfig() + XFree( fbc ); + // Sync to ensure any errors generated are processed. XSync( display, False ); |