[gtk+/wip/gdk-gl: 28/31] gdk/x11: Respect GdkGLPixelFormat:accum-size



commit cf0b1771da029c389ce23f3be7f78b46484bd904
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Aug 14 11:29:43 2014 +0100

    gdk/x11: Respect GdkGLPixelFormat:accum-size
    
    We are currently ignoring it.

 gdk/x11/gdkglcontext-x11.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 9a22c1f..e6bf166 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -375,6 +375,18 @@ get_glx_attributes_for_pixel_format (GdkDisplay       *display,
       attrs[i++] = format->stencil_size;
     }
 
+  if (format->accum_size > 0)
+    {
+      attrs[i++] = GLX_ACCUM_RED_SIZE;
+      attrs[i++] = format->accum_size;
+      attrs[i++] = GLX_ACCUM_GREEN_SIZE;
+      attrs[i++] = format->accum_size;
+      attrs[i++] = GLX_ACCUM_BLUE_SIZE;
+      attrs[i++] = format->accum_size;
+      attrs[i++] = GLX_ACCUM_ALPHA_SIZE;
+      attrs[i++] = format->accum_size;
+    }
+
   display_x11 = GDK_X11_DISPLAY (display);
   if (display_x11->glx_version >= 14 && format->multi_sample)
     {
@@ -480,17 +492,25 @@ update_pixel_format (GdkDisplay       *display,
 
   glXGetFBConfigAttrib (dpy, config, GLX_RED_SIZE, &value);
   format->color_size = value;
-
   glXGetFBConfigAttrib (dpy, config, GLX_GREEN_SIZE, &value);
   format->color_size = MIN (format->color_size, value);
-
   glXGetFBConfigAttrib (dpy, config, GLX_BLUE_SIZE, &value);
   format->color_size = MIN (format->color_size, value);
 
   glXGetFBConfigAttrib (dpy, config, GLX_ALPHA_SIZE, &format->alpha_size);
+
   glXGetFBConfigAttrib (dpy, config, GLX_AUX_BUFFERS, &format->aux_buffers);
   glXGetFBConfigAttrib (dpy, config, GLX_DEPTH_SIZE, &format->depth_size);
   glXGetFBConfigAttrib (dpy, config, GLX_STENCIL_SIZE, &format->stencil_size);
+
+  glXGetFBConfigAttrib (dpy, config, GLX_ACCUM_RED_SIZE, &value);
+  format->accum_size = value;
+  glXGetFBConfigAttrib (dpy, config, GLX_ACCUM_GREEN_SIZE, &value);
+  format->accum_size = MIN (format->accum_size, value);
+  glXGetFBConfigAttrib (dpy, config, GLX_ACCUM_BLUE_SIZE, &value);
+  format->accum_size = MIN (format->accum_size, value);
+  glXGetFBConfigAttrib (dpy, config, GLX_ACCUM_ALPHA_SIZE, &value);
+  format->accum_size = MIN (format->accum_size, value);
 }
 
 static GLXContext


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]