Search
lxdream.org :: lxdream/src/drivers/video_glx.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_glx.c
changeset 1134:f502f3d32f90
prev1076:18c164e8aec4
next1159:580436b01b6c
author nkeynes
date Fri Oct 22 20:55:32 2010 +1000 (11 years ago)
permissions -rw-r--r--
last change Dump more information with --gl-info, and print it a little more nicely
file annotate diff log raw
1.1 --- a/src/drivers/video_glx.c Mon Aug 03 08:41:11 2009 +1000
1.2 +++ b/src/drivers/video_glx.c Fri Oct 22 20:55:32 2010 +1000
1.3 @@ -43,6 +43,7 @@
1.4 static GLuint glx_pbuffer_texture = 0;
1.5
1.6 static void video_glx_swap_buffers( void );
1.7 +static void video_glx_print_info( FILE *out );
1.8
1.9 /* Prototypes for pbuffer support methods */
1.10 static void glx_pbuffer_init( display_driver_t driver );
1.11 @@ -167,6 +168,27 @@
1.12 return TRUE;
1.13 }
1.14
1.15 +static void video_glx_print_info( FILE *out )
1.16 +{
1.17 + XWindowAttributes attr;
1.18 +
1.19 + if( !XGetWindowAttributes(video_x11_display, video_x11_window, &attr) )
1.20 + return; /* Failed */
1.21 + int screen = XScreenNumberOfScreen(attr.screen);
1.22 +
1.23 + fprintf( out, "GLX Server: %s %s\n", glXQueryServerString(video_x11_display, screen, GLX_VENDOR),
1.24 + glXQueryServerString(video_x11_display, screen, GLX_VERSION) );
1.25 + fprintf( out, "GLX Client: %s %s\n", glXGetClientString(video_x11_display, GLX_VENDOR),
1.26 + glXGetClientString(video_x11_display, GLX_VERSION) );
1.27 + fprintf( out, "GLX Server Extensions:\n" );
1.28 + fprint_extensions( out, glXQueryServerString(video_x11_display, screen, GLX_EXTENSIONS) );
1.29 + fprintf( out, "GLX Client Extensions:\n" );
1.30 + fprint_extensions( out, glXGetClientString(video_x11_display, GLX_EXTENSIONS) );
1.31 + fprintf( out, "GLX Extensions:\n" );
1.32 + fprint_extensions( out, glXQueryExtensionsString(video_x11_display, screen) );
1.33 +
1.34 +}
1.35 +
1.36 gboolean video_glx_init_context( Display *display, Window window )
1.37 {
1.38 if( glx_fbconfig_supported ) {
1.39 @@ -210,6 +232,8 @@
1.40 gboolean video_glx_init_driver( display_driver_t driver )
1.41 {
1.42 driver->swap_buffers = video_glx_swap_buffers;
1.43 + driver->print_info = video_glx_print_info;
1.44 + driver->capabilities.has_gl = TRUE;
1.45 if( gl_fbo_is_supported() ) { // First preference
1.46 gl_fbo_init(driver);
1.47 } else if( glx_pbuffer_supported ) {
.