[cairo-commit] libglc/src glc.c,1.16,1.17 glc.h,1.10,1.11 glc_agl_context.c,1.3,1.4 glc_agl_info.c,1.3,1.4 glc_agl_surface.c,1.6,1.7 glc_glx_context.c,1.8,1.9 glc_glx_extension.c,1.7,1.8 glc_glx_format.c,1.13,1.14 glc_glx_info.c,1.8,1.9 glc_glx_pbuffer.c,1.5,1.6 glc_glx_surface.c,1.13,1.14 glc_program.c,1.1,1.2 glc_surface.c,1.14,1.15 glc_texture.c,1.7,1.8 glcint.h,1.15,1.16

David Reveman commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: davidr

Update of /cvs/cairo/libglc/src
In directory pdx:/tmp/cvs-serv21282/src

Modified Files:
	glc.c glc.h glc_agl_context.c glc_agl_info.c glc_agl_surface.c 
	glc_glx_context.c glc_glx_extension.c glc_glx_format.c 
	glc_glx_info.c glc_glx_pbuffer.c glc_glx_surface.c 
	glc_program.c glc_surface.c glc_texture.c glcint.h 
Log Message:
Dynamic lookup of all GL and GLX extension symbols

Index: glc.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** glc.c	11 Feb 2004 01:42:14 -0000	1.16
--- glc.c	16 Feb 2004 22:02:40 -0000	1.17
***************
*** 74,77 ****
--- 74,79 ----
                          int height)
  {
+   
+ #if defined(GL_ARB_multitexture) && defined(GL_ARB_fragment_program)
    glc_texture_t *src_texture;
    glc_texture_t *mask_texture;
***************
*** 113,130 ****
    glc_set_operator (op);
  
!   glActiveTextureARB (GL_TEXTURE0_ARB);
    glc_texture_bind (src_texture);
  
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  
!   glc_texture_ensure_filter (src_texture, src->filter);
    glc_texture_ensure_repeat (src_texture, src->repeat);
  
!   glActiveTextureARB (GL_TEXTURE1_ARB);
    glc_texture_bind (mask_texture);
  
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  
!   glc_texture_ensure_filter (mask_texture, mask->filter);
    glc_texture_ensure_repeat (mask_texture, mask->repeat);
  
--- 115,132 ----
    glc_set_operator (op);
  
!   dst->proc_address->gl_active_texture_arb (GL_TEXTURE0_ARB);
    glc_texture_bind (src_texture);
  
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  
!   glc_texture_ensure_filter (src_texture, GLC_FILTER_NEAREST);
    glc_texture_ensure_repeat (src_texture, src->repeat);
  
!   dst->proc_address->gl_active_texture_arb (GL_TEXTURE1_ARB);
    glc_texture_bind (mask_texture);
  
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  
!   glc_texture_ensure_filter (mask_texture, GLC_FILTER_NEAREST);
    glc_texture_ensure_repeat (mask_texture, mask->repeat);
  
***************
*** 227,245 ****
    
    glBegin (GL_QUADS);
!   
!   glMultiTexCoord2dARB (GL_TEXTURE0_ARB, src_tl.x, src_tl.y);
!   glMultiTexCoord2dARB (GL_TEXTURE1_ARB, mask_tl.x, mask_tl.y);
    glVertex2i (dst_region.x1, dst_region.y1);
  
!   glMultiTexCoord2dARB (GL_TEXTURE0_ARB, src_br.x, src_tl.y);
!   glMultiTexCoord2dARB (GL_TEXTURE1_ARB, mask_br.x, mask_tl.y);
    glVertex2i (dst_region.x2, dst_region.y1);
  
!   glMultiTexCoord2dARB (GL_TEXTURE0_ARB, src_br.x, src_br.y);
!   glMultiTexCoord2dARB (GL_TEXTURE1_ARB, mask_br.x, mask_br.y);
    glVertex2i (dst_region.x2, dst_region.y2);
  
!   glMultiTexCoord2dARB (GL_TEXTURE0_ARB, src_tl.x, src_br.y);
!   glMultiTexCoord2dARB (GL_TEXTURE1_ARB, mask_tl.x, mask_br.y);
    glVertex2i (dst_region.x1, dst_region.y2);
  
--- 229,255 ----
    
    glBegin (GL_QUADS);
! 
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE0_ARB, src_tl.x, src_tl.y);
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE1_ARB, mask_tl.x, mask_tl.y);
    glVertex2i (dst_region.x1, dst_region.y1);
  
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE0_ARB, src_br.x, src_tl.y);
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE1_ARB, mask_br.x, mask_tl.y);
    glVertex2i (dst_region.x2, dst_region.y1);
  
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE0_ARB, src_br.x, src_br.y);
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE1_ARB, mask_br.x, mask_br.y);
    glVertex2i (dst_region.x2, dst_region.y2);
  
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE0_ARB, src_tl.x, src_br.y);
!   dst->proc_address->gl_multi_tex_coord_2d_arb
!     (GL_TEXTURE1_ARB, mask_tl.x, mask_br.y);
    glVertex2i (dst_region.x1, dst_region.y2);
  
***************
*** 248,252 ****
    glc_texture_unbind (mask_texture);
  
!   glActiveTextureARB (GL_TEXTURE0_ARB);
    glc_texture_unbind (src_texture);
  
--- 258,262 ----
    glc_texture_unbind (mask_texture);
  
!   dst->proc_address->gl_active_texture_arb (GL_TEXTURE0_ARB);
    glc_texture_unbind (src_texture);
  
***************
*** 258,261 ****
--- 268,274 ----
  
    return 1;
+ #endif
+ 
+   return 0;
  }
  
***************
*** 335,339 ****
      static glc_color_t clear_color = { 0x0000, 0x0000, 0x0000, 0x0000 };
  
!     if (_glc_program_composite (op,
                                  src, mask, dst,
                                  x_src, y_src,
--- 348,353 ----
      static glc_color_t clear_color = { 0x0000, 0x0000, 0x0000, 0x0000 };
  
!     if ((dst->feature_mask & GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK) &&
!         _glc_program_composite (op,
                                  src, mask, dst,
                                  x_src, y_src,
***************
*** 342,346 ****
                                  width, height))
        return;
! 
      if (!mask->implicit_mask) {
        glc_region_box_t bounds;
--- 356,360 ----
                                  width, height))
        return;
!     
      if (!mask->implicit_mask) {
        glc_region_box_t bounds;
***************
*** 428,433 ****
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  
-   glc_texture_ensure_filter (texture, src->filter);
- 
    clip.x1 = x_dst;
    clip.y1 = y_dst;
--- 442,445 ----
***************
*** 446,449 ****
--- 458,462 ----
  
      glc_texture_ensure_repeat (texture, 1);
+     glc_texture_ensure_filter (texture, GLC_FILTER_NEAREST);
      
      bl.x = tl.x = x_dst;
***************
*** 495,503 ****
  
      if (TRANSFORM (src)) {
        glc_matrix_transform_point (src->transform, &tl);
        glc_matrix_transform_point (src->transform, &bl);
        glc_matrix_transform_point (src->transform, &tr);
        glc_matrix_transform_point (src->transform, &br);
!     }
      
      /* Shift all coordinates with destination offset */
--- 508,518 ----
  
      if (TRANSFORM (src)) {
+       glc_texture_ensure_filter (texture, src->filter);
        glc_matrix_transform_point (src->transform, &tl);
        glc_matrix_transform_point (src->transform, &bl);
        glc_matrix_transform_point (src->transform, &tr);
        glc_matrix_transform_point (src->transform, &br);
!     } else
!       glc_texture_ensure_filter (texture, GLC_FILTER_NEAREST);
      
      /* Shift all coordinates with destination offset */

Index: glc.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** glc.h	12 Feb 2004 12:49:39 -0000	1.10
--- glc.h	16 Feb 2004 22:02:40 -0000	1.11
***************
*** 136,139 ****
--- 136,140 ----
  #define GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK (1L << 4)
  #define GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK  (1L << 5)
+ #define GLC_FEATURE_ATI_RENDER_TEXTURE_MASK    (1L << 6)
  
  typedef enum {  
***************
*** 395,400 ****
  glc_glx_initialize (Display *display,
                      int screen);  
    
! long int
  glc_glx_features (Display *display,
                    int screen);
--- 396,404 ----
  glc_glx_initialize (Display *display,
                      int screen);  
+ 
+ unsigned long
+ glc_glx_compiled_features (void);
    
! unsigned long
  glc_glx_features (Display *display,
                    int screen);
***************
*** 448,453 ****
  void
  glc_agl_initialize (void);
    
! long int
  glc_agl_features (void);
    
--- 452,460 ----
  void
  glc_agl_initialize (void);
+ 
+ unsigned long
+ glc_agl_compiled_features (void);
    
! unsigned long
  glc_agl_features (void);
    

Index: glc_agl_context.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_context.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glc_agl_context.c	10 Feb 2004 23:38:36 -0000	1.3
--- glc_agl_context.c	16 Feb 2004 22:02:40 -0000	1.4
***************
*** 81,84 ****
--- 81,85 ----
    surface->base.anti_aliasing = 0;
  
+ #ifdef GL_ARB_multisample
    if (surface->base.format->multisample.supported) {
      if (surface->base.polyedge == GLC_POLYEDGE_SMOOTH) {
***************
*** 91,94 ****
--- 92,97 ----
        glDisable (GL_MULTISAMPLE_ARB);
    }
+ #endif
+   
  }
  

Index: glc_agl_info.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_info.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glc_agl_info.c	10 Feb 2004 23:38:36 -0000	1.3
--- glc_agl_info.c	16 Feb 2004 22:02:40 -0000	1.4
***************
*** 32,35 ****
--- 32,46 ----
  #include "glcint.h"
  
+ glc_gl_proc_address_list_t _glc_agl_gl_proc_address = {
+   glActiveTextureARB,
+   glMultiTexCoord2dARB,
+   glGenProgramsARB,
+   glDeleteProgramsARB,
+   glProgramStringARB,
+   glBindProgramARB,
+   0
+ };
+ 
+ 
  static void
  _glc_agl_thread_info_init (glc_agl_thread_info_t *thread_info);
***************
*** 132,137 ****
  }
  slim_hidden_def(glc_agl_initialize);
    
! long int
  glc_agl_features (void)
  {
--- 143,174 ----
  }
  slim_hidden_def(glc_agl_initialize);
+ 
+ unsigned long
+ glc_agl_compiled_features (void)
+ {
+   return (GLC_FEATURE_OFFSCREEN_DRAWING_MASK
+ 
+ #ifdef GL_EXT_texture_rectangle
+           | GLC_FEATURE_EXT_TEXTURE_RECTANGLE_MASK
+ #endif
+           
+ #ifdef GL_NV_texture_rectangle
+           | GLC_FEATURE_NV_TEXTURE_RECTANGLE_MASK
+ #endif
+           
+ #ifdef GL_ARB_multisample
+           | GLC_FEATURE_MULTISAMPLE_MASK
+           | GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK
+ #endif
+           
+ #if defined(GL_ARB_multitexture) && defined(GL_ARB_fragment_program)
+           | GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK
+ #endif          
+           
+           );
+ }
+ slim_hidden_def(glc_agl_compiled_features);
    
! unsigned long
  glc_agl_features (void)
  {

Index: glc_agl_surface.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** glc_agl_surface.c	12 Feb 2004 12:49:39 -0000	1.6
--- glc_agl_surface.c	16 Feb 2004 22:02:40 -0000	1.7
***************
*** 32,35 ****
--- 32,37 ----
  #include "glcint.h"
  
+ extern glc_gl_proc_address_list_t _glc_agl_gl_proc_address;
+ 
  static glc_surface_t *
  _glc_agl_surface_create_similar (void *abstract_templ,
***************
*** 81,110 ****
  }
  
- static glc_bool_t
- _glc_agl_surface_enable_program (void *abstract_surface,
-                                  glc_texture_t *src,
-                                  glc_texture_t *mask)
- {
-   glc_agl_surface_t *surface = (glc_agl_surface_t *) abstract_surface;
-   glc_bool_t status = 0;
- 
-   if (surface->thread_info->feature_mask &
-       GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
-     status = glc_program_enable_fragment_arb (&surface->thread_info->programs,
-                                               src, mask);
- 
-   return status;
- }
- 
- static void
- _glc_agl_surface_disable_program (void *abstract_surface)
- {
-   glc_agl_surface_t *surface = (glc_agl_surface_t *) abstract_surface;
- 
-   if (surface->thread_info->feature_mask &
-       GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
-     glc_program_disable_fragment_arb ();
- }
- 
  static const struct glc_surface_backend glc_agl_surface_backend = {
    _glc_agl_surface_create_similar,
--- 83,86 ----
***************
*** 114,120 ****
    _glc_agl_surface_get_texture,
    _glc_agl_surface_realize,
!   _glc_agl_surface_show,
!   _glc_agl_surface_enable_program,
!   _glc_agl_surface_disable_program
  };
  
--- 90,94 ----
    _glc_agl_surface_get_texture,
    _glc_agl_surface_realize,
!   _glc_agl_surface_show
  };
  
***************
*** 180,184 ****
    surface->thread_info = thread_info;
    surface->context = context;
!   
    surface->base.format = format;
    surface->base.width = width;
--- 154,161 ----
    surface->thread_info = thread_info;
    surface->context = context;
! 
!   surface->base.proc_address = &_glc_agl_gl_proc_address;
!   surface->base.programs = &thread_info->programs;
!   surface->base.feature_mask = thread_info->feature_mask;
    surface->base.format = format;
    surface->base.width = width;
***************
*** 260,264 ****
    surface->thread_info = thread_info;
    surface->context = context;
!   
    surface->base.format = format;
    surface->base.width = width;
--- 237,244 ----
    surface->thread_info = thread_info;
    surface->context = context;
! 
!   surface->base.proc_address = &_glc_agl_gl_proc_address;
!   surface->base.programs = &thread_info->programs;
!   surface->base.feature_mask = thread_info->feature_mask;
    surface->base.format = format;
    surface->base.width = width;

Index: glc_glx_context.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_context.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** glc_glx_context.c	10 Feb 2004 23:38:36 -0000	1.8
--- glc_glx_context.c	16 Feb 2004 22:02:40 -0000	1.9
***************
*** 34,37 ****
--- 34,39 ----
  #include <stdlib.h>
  
+ extern glc_glx_proc_address_list_t _glc_glx_proc_address;
+ 
  static void
  _glc_glx_context_create_glx12 (glc_glx_screen_info_t *screen_info,
***************
*** 53,57 ****
--- 55,62 ----
                                         &vis_infos[i], share_list, 1);
    context->id = visualid;
+   
+ #ifdef GLX_VERSION_1_3
    context->fbconfig = (XID) 0;
+ #endif
  
    XFree (vis_infos);
***************
*** 64,85 ****
                                 glc_glx_context_t *context)
  {
    GLXFBConfig *fbconfigs;
    int i, n_fbconfigs;
  
!   fbconfigs = glXGetFBConfigs (screen_info->display_info->display,
!                                screen_info->screen, &n_fbconfigs);
    for (i = 0; i < n_fbconfigs; i++) {
      int value;
      
!     glXGetFBConfigAttrib (screen_info->display_info->display,
!                           fbconfigs[i], GLX_FBCONFIG_ID, &value);
      if (value == (int) fbconfigid)
        break;
    }
  
!   if (i < n_fbconfigs) {
      context->context =
!       glXCreateNewContext (screen_info->display_info->display,
!                            fbconfigs[i], GLX_RGBA_TYPE, share_list, 1);
      context->id = fbconfigid;
      context->fbconfig = fbconfigs[i];
--- 69,98 ----
                                 glc_glx_context_t *context)
  {
+   
+ #ifdef GLX_VERSION_1_3
    GLXFBConfig *fbconfigs;
    int i, n_fbconfigs;
+   XVisualInfo *vinfo = NULL;
  
!   fbconfigs = _glc_glx_proc_address.glx_get_fbconfigs
!     (screen_info->display_info->display, screen_info->screen, &n_fbconfigs);
    for (i = 0; i < n_fbconfigs; i++) {
      int value;
      
!     _glc_glx_proc_address.glx_get_fbconfig_attrib
!       (screen_info->display_info->display, fbconfigs[i],
!        GLX_FBCONFIG_ID, &value);
      if (value == (int) fbconfigid)
        break;
    }
  
!   if (i < n_fbconfigs)
!     vinfo = _glc_glx_proc_address.glx_get_visual_from_fbconfig
!       (screen_info->display_info->display, fbconfigs[i]);
!   
!   if (vinfo) {
      context->context =
!       context->context = glXCreateContext (screen_info->display_info->display,
!                                            vinfo, share_list, 1);    
      context->id = fbconfigid;
      context->fbconfig = fbconfigs[i];
***************
*** 92,95 ****
--- 105,110 ----
    if (fbconfigs)
      XFree (fbconfigs);
+ #endif
+   
  }
  
***************
*** 118,122 ****
    screen_info->contexts[index] = context;
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_FBCONFIG_MASK)
      _glc_glx_context_create_glx13 (screen_info,
                                     screen_info->format_ids[format->id],
--- 133,137 ----
    screen_info->contexts[index] = context;
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_GLX13_MASK)
      _glc_glx_context_create_glx13 (screen_info,
                                     screen_info->format_ids[format->id],
***************
*** 137,140 ****
--- 152,156 ----
    surface->base.anti_aliasing = 0;
  
+ #ifdef GL_ARB_multisample
    if (surface->base.format->multisample.supported) {
      if (surface->base.polyedge == GLC_POLYEDGE_SMOOTH) {
***************
*** 147,150 ****
--- 163,168 ----
        glDisable (GL_MULTISAMPLE_ARB);
    }
+ #endif
+   
  }
  

Index: glc_glx_extension.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_extension.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** glc_glx_extension.c	10 Feb 2004 23:38:36 -0000	1.7
--- glc_glx_extension.c	16 Feb 2004 22:02:40 -0000	1.8
***************
*** 32,51 ****
  #include "glcint.h"
  
  extern glc_glx_proc_address_list_t _glc_glx_proc_address;
  
  static glc_extension_map client_glx_extensions[] = {
!   { "GLX_ATI_render_texture", GLC_GLX_FEATURE_RENDER_TEXTURE_MASK },
    { "GLX_ARB_multisample", GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK },
    { NULL, 0 }
  }, gl_extensions[] = {
- 
- #if GL_EXT_texture_rectangle
    { "GL_EXT_texture_rectangle", GLC_GLX_FEATURE_EXT_TEXTURE_RECTANGLE_MASK },
- #endif
-   
- #if GL_NV_texture_rectangle
    { "GL_NV_texture_rectangle", GLC_GLX_FEATURE_NV_TEXTURE_RECTANGLE_MASK },
- #endif
- 
    { "GL_ARB_multisample", GLC_GLX_FEATURE_MULTISAMPLE_MASK },
    { "GL_NV_multisample_filter_hint", GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK },
--- 32,45 ----
  #include "glcint.h"
  
+ extern glc_gl_proc_address_list_t _glc_glx_gl_proc_address;
  extern glc_glx_proc_address_list_t _glc_glx_proc_address;
  
  static glc_extension_map client_glx_extensions[] = {
!   { "GLX_ATI_render_texture", GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK },
    { "GLX_ARB_multisample", GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK },
    { NULL, 0 }
  }, gl_extensions[] = {
    { "GL_EXT_texture_rectangle", GLC_GLX_FEATURE_EXT_TEXTURE_RECTANGLE_MASK },
    { "GL_NV_texture_rectangle", GLC_GLX_FEATURE_NV_TEXTURE_RECTANGLE_MASK },
    { "GL_ARB_multisample", GLC_GLX_FEATURE_MULTISAMPLE_MASK },
    { "GL_NV_multisample_filter_hint", GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK },
***************
*** 78,83 ****
  glc_glx_query_extensions (glc_glx_screen_info_t *screen_info)
  {
-   const char *glx_server_version, *glx_client_version;
- 
    screen_info->glx_feature_mask = 0;
  
--- 72,75 ----
***************
*** 87,116 ****
    screen_info->glx_feature_mask |= _glc_glx_extension_query_gl ();
  
!   glx_server_version =
!     glXQueryServerString (screen_info->display_info->display,
!                           screen_info->screen, GLX_VERSION);
!   glx_client_version =
!     glXGetClientString (screen_info->display_info->display, GLX_VERSION);
! 
!   if (strcmp (glx_client_version, "1.3") >= 0) {
!     if (strcmp (glx_server_version, "1.3") >= 0) {
!       screen_info->glx_feature_mask |=
!         (GLC_GLX_FEATURE_FBCONFIG_MASK | GLC_GLX_FEATURE_PBUFFER_MASK);
!     } else if (screen_info->glx_feature_mask &
!                GLC_GLX_FEATURE_RENDER_TEXTURE_MASK) {
!       /* ATI emulates GLX 1.3 in there latest drivers. If the driver
!          supports GLX_ATI_render_texture extension, GLX 1.3 emulation is
!          probably also in there. */
!       screen_info->glx_feature_mask |=
!         (GLC_GLX_FEATURE_FBCONFIG_MASK | GLC_GLX_FEATURE_PBUFFER_MASK);
!     }
!   }
  
    screen_info->feature_mask = 0;
    screen_info->texture_mask = GLC_TEXTURE_TARGET_2D_MASK;
- 
-   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_PBUFFER_MASK)
-     screen_info->feature_mask |= GLC_FEATURE_OFFSCREEN_DRAWING_MASK;
    
    if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_MULTISAMPLE_MASK &&
        screen_info->glx_feature_mask &
--- 79,98 ----
    screen_info->glx_feature_mask |= _glc_glx_extension_query_gl ();
  
! #ifdef GLX_VERSION_1_3
!   if (_glc_glx_proc_address.glx_get_fbconfigs &&
!       _glc_glx_proc_address.glx_get_fbconfig_attrib &&
!       _glc_glx_proc_address.glx_get_visual_from_fbconfig &&
!       _glc_glx_proc_address.glx_create_pbuffer &&
!       _glc_glx_proc_address.glx_destroy_pbuffer)
!     screen_info->glx_feature_mask |= GLC_GLX_FEATURE_GLX13_MASK;
! #endif
  
    screen_info->feature_mask = 0;
    screen_info->texture_mask = GLC_TEXTURE_TARGET_2D_MASK;
    
+   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_GLX13_MASK)
+     screen_info->feature_mask |= GLC_FEATURE_OFFSCREEN_DRAWING_MASK;
+ 
+ #ifdef GL_ARB_multisample
    if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_MULTISAMPLE_MASK &&
        screen_info->glx_feature_mask &
***************
*** 122,126 ****
--- 104,110 ----
        screen_info->feature_mask |= GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK;
    }
+ #endif
  
+ #ifdef GL_EXT_texture_rectangle
    if (screen_info->glx_feature_mask &
        GLC_GLX_FEATURE_EXT_TEXTURE_RECTANGLE_MASK) {
***************
*** 128,132 ****
--- 112,118 ----
      screen_info->feature_mask |= GLC_FEATURE_EXT_TEXTURE_RECTANGLE_MASK;
    }
+ #endif
  
+ #ifdef GL_NV_texture_rectangle
    if (screen_info->glx_feature_mask &
        GLC_GLX_FEATURE_NV_TEXTURE_RECTANGLE_MASK) {
***************
*** 134,145 ****
      screen_info->feature_mask |= GLC_FEATURE_NV_TEXTURE_RECTANGLE_MASK;
    }
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_RENDER_TEXTURE_MASK) {
!     screen_info->glx_feature_mask &= ~GLC_GLX_FEATURE_RENDER_TEXTURE_MASK;
  
  #ifdef GLX_ATI_render_texture
      if (_glc_glx_proc_address.glx_bind_tex_image_ati &&
          _glc_glx_proc_address.glx_release_tex_image_ati) {
!       screen_info->glx_feature_mask |= GLC_GLX_FEATURE_RENDER_TEXTURE_MASK;
  
        /* ATI render texture doesn't seem to support texture rectangle */
--- 120,134 ----
      screen_info->feature_mask |= GLC_FEATURE_NV_TEXTURE_RECTANGLE_MASK;
    }
+ #endif
  
!   if (screen_info->glx_feature_mask &
!       GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK) {
!     screen_info->glx_feature_mask &= ~GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK;
  
  #ifdef GLX_ATI_render_texture
      if (_glc_glx_proc_address.glx_bind_tex_image_ati &&
          _glc_glx_proc_address.glx_release_tex_image_ati) {
!       screen_info->glx_feature_mask |= GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK;
!       screen_info->feature_mask |= GLC_FEATURE_ATI_RENDER_TEXTURE_MASK;
  
        /* ATI render texture doesn't seem to support texture rectangle */
***************
*** 155,159 ****
    if (screen_info->glx_feature_mask &
        GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK) {
!     screen_info->feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
    }
  }
--- 144,163 ----
    if (screen_info->glx_feature_mask &
        GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK) {
!     screen_info->glx_feature_mask &=
!       ~GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
!     
! #if defined(GL_ARB_multitexture) && defined(GL_ARB_fragment_program)
!     if (_glc_glx_gl_proc_address.gl_active_texture_arb &&
!         _glc_glx_gl_proc_address.gl_multi_tex_coord_2d_arb &&
!         _glc_glx_gl_proc_address.gl_gen_programs_arb &&
!         _glc_glx_gl_proc_address.gl_delete_programs_arb &&
!         _glc_glx_gl_proc_address.gl_program_string_arb &&
!         _glc_glx_gl_proc_address.gl_bind_program_arb) {
!       screen_info->glx_feature_mask |=
!         GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
!       screen_info->feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
!     }
! #endif
!     
    }
  }

Index: glc_glx_format.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_format.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** glc_glx_format.c	12 Feb 2004 12:49:39 -0000	1.13
--- glc_glx_format.c	16 Feb 2004 22:02:40 -0000	1.14
***************
*** 35,38 ****
--- 35,40 ----
  #include <string.h>
  
+ extern glc_glx_proc_address_list_t _glc_glx_proc_address;
+ 
  static int
  _glc_glx_format_compare (const void *elem1,
***************
*** 154,161 ****
--- 156,167 ----
  
      if (screen_info->feature_mask & GLC_FEATURE_MULTISAMPLE_MASK) {
+       
+ #ifdef GL_ARB_multisample
        glXGetConfig (display, &visuals[i], GLX_SAMPLE_BUFFERS_ARB, &value);
        format.multisample.supported = (value) ? 1: 0;
        glXGetConfig (display, &visuals[i], GLX_SAMPLES_ARB, &value);
        format.multisample.samples = (unsigned short) value;
+ #endif
+       
      } else {
        format.multisample.supported = 0;
***************
*** 200,203 ****
--- 206,210 ----
  }
  
+ #ifdef GLX_VERSION_1_3
  static glc_bool_t
  glc_glx_query_formats_glx13 (glc_glx_screen_info_t *screen_info)
***************
*** 211,234 ****
    display = screen_info->display_info->display;
  
!   fbconfigs = glXGetFBConfigs (display, screen_info->screen, &num_configs);
! 
    /* GLX 1.3 is not support, falling back to GLX 1.2 */
!   if (!fbconfigs)
      return 1;
    
    for (i = 0; i < num_configs; i++) {
      int value;
      
!     if ((glXGetFBConfigAttrib (display, fbconfigs[i], GLX_RENDER_TYPE,
!                                &value) != 0) ||
          (!(value & GLX_RGBA_BIT)))
        continue;
  
      /* Stereo is not supported yet */
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_STEREO, &value);
      if (value != 0)
        continue;
  
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_DRAWABLE_TYPE, &value);
      if (!((value & GLX_WINDOW_BIT) || (value & GLX_PBUFFER_BIT)))
        continue;
--- 218,248 ----
    display = screen_info->display_info->display;
  
!   fbconfigs =
!     _glc_glx_proc_address.glx_get_fbconfigs (display,
!                                              screen_info->screen,
!                                              &num_configs);
    /* GLX 1.3 is not support, falling back to GLX 1.2 */
!   if (!fbconfigs) {
!     screen_info->glx_feature_mask &= ~GLC_GLX_FEATURE_GLX13_MASK;
!     screen_info->feature_mask &= ~GLC_FEATURE_OFFSCREEN_DRAWING_MASK;
      return 1;
+   }
    
    for (i = 0; i < num_configs; i++) {
      int value;
      
!     if ((_glc_glx_proc_address.glx_get_fbconfig_attrib
!          (display, fbconfigs[i], GLX_RENDER_TYPE, &value) != 0) ||
          (!(value & GLX_RGBA_BIT)))
        continue;
  
      /* Stereo is not supported yet */
!     _glc_glx_proc_address.glx_get_fbconfig_attrib
!       (display, fbconfigs[i], GLX_STEREO, &value);
      if (value != 0)
        continue;
  
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_DRAWABLE_TYPE, &value);
      if (!((value & GLX_WINDOW_BIT) || (value & GLX_PBUFFER_BIT)))
        continue;
***************
*** 237,262 ****
      format.drawable.offscreen = (value & GLX_PBUFFER_BIT)? 1: 0;
      
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_FBCONFIG_ID, &value);
      format.id = (XID) value;
      
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_RED_SIZE, &value);
      format.red_size = (unsigned short) value;
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_GREEN_SIZE, &value);
      format.green_size = (unsigned short) value;
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_BLUE_SIZE, &value);
      format.blue_size = (unsigned short) value;
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_ALPHA_SIZE, &value);
      format.alpha_size = (unsigned short) value;
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_DEPTH_SIZE, &value);
      format.depth_size = (unsigned short) value;
!     glXGetFBConfigAttrib (display, fbconfigs[i], GLX_DOUBLEBUFFER, &value);
      format.doublebuffer = (value) ? 1: 0;
      
      if (screen_info->feature_mask & GLC_FEATURE_MULTISAMPLE_MASK) {
!       glXGetFBConfigAttrib (display, fbconfigs[i],
!                             GLX_SAMPLE_BUFFERS_ARB, &value);
        format.multisample.supported = (value) ? 1: 0;
!       glXGetFBConfigAttrib (display, fbconfigs[i], GLX_SAMPLES_ARB, &value);
        format.multisample.samples = (unsigned short) value;
      } else {
        format.multisample.supported = 0;
--- 251,289 ----
      format.drawable.offscreen = (value & GLX_PBUFFER_BIT)? 1: 0;
      
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_FBCONFIG_ID, &value);
      format.id = (XID) value;
      
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_RED_SIZE, &value);
      format.red_size = (unsigned short) value;
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_GREEN_SIZE, &value);
      format.green_size = (unsigned short) value;
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_BLUE_SIZE, &value);
      format.blue_size = (unsigned short) value;
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_ALPHA_SIZE, &value);
      format.alpha_size = (unsigned short) value;
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_DEPTH_SIZE, &value);
      format.depth_size = (unsigned short) value;
!     _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                    GLX_DOUBLEBUFFER, &value);
      format.doublebuffer = (value) ? 1: 0;
      
      if (screen_info->feature_mask & GLC_FEATURE_MULTISAMPLE_MASK) {
! 
! #ifdef GL_ARB_multisample
!       _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                      GLX_SAMPLE_BUFFERS_ARB,
!                                                      &value);
        format.multisample.supported = (value) ? 1: 0;
!       _glc_glx_proc_address.glx_get_fbconfig_attrib (display, fbconfigs[i],
!                                                      GLX_SAMPLES_ARB, &value);
        format.multisample.samples = (unsigned short) value;
+ #endif
+       
      } else {
        format.multisample.supported = 0;
***************
*** 291,295 ****
       pixel functions and as source in composite functions. */
    if (!offscreen_argb32_format) {
-     screen_info->glx_feature_mask &= ~GLC_GLX_FEATURE_PBUFFER_MASK;
      screen_info->feature_mask &= ~GLC_FEATURE_OFFSCREEN_DRAWING_MASK;
      memset (&format, 0, sizeof (glc_format_t));
--- 318,321 ----
***************
*** 311,314 ****
--- 337,341 ----
    return 0;
  }
+ #endif
  
  void
***************
*** 316,322 ****
  {
    glc_bool_t status = 1;
!   
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_FBCONFIG_MASK)
      status = glc_glx_query_formats_glx13 (screen_info);
  
    if (status)
--- 343,351 ----
  {
    glc_bool_t status = 1;
! 
! #ifdef GLX_VERSION_1_3
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_GLX13_MASK)
      status = glc_glx_query_formats_glx13 (screen_info);
+ #endif
  
    if (status)
***************
*** 365,378 ****
      glc_glx_screen_info_get (display, screen);
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_FBCONFIG_MASK) {
      GLXFBConfig *fbconfigs;
      int i, n_fbconfigs;
      int fbconfigid = screen_info->format_ids[format->id];
  
!     fbconfigs = glXGetFBConfigs (display, screen, &n_fbconfigs);
      for (i = 0; i < n_fbconfigs; i++) {
        int value;
        
!       glXGetFBConfigAttrib (display, fbconfigs[i], GLX_FBCONFIG_ID, &value);
        if (value == fbconfigid)
          break;
--- 394,411 ----
      glc_glx_screen_info_get (display, screen);
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_GLX13_MASK) {
! 
! #ifdef GLX_VERSION_1_3
      GLXFBConfig *fbconfigs;
      int i, n_fbconfigs;
      int fbconfigid = screen_info->format_ids[format->id];
  
!     fbconfigs =
!       _glc_glx_proc_address.glx_get_fbconfigs (display, screen, &n_fbconfigs);
      for (i = 0; i < n_fbconfigs; i++) {
        int value;
        
!       _glc_glx_proc_address.glx_get_fbconfig_attrib
!         (display, fbconfigs[i], GLX_FBCONFIG_ID, &value);
        if (value == fbconfigid)
          break;
***************
*** 380,387 ****
      
      if (i < n_fbconfigs)
!       vinfo = glXGetVisualFromFBConfig (display, fbconfigs[i]);
! 
      if (fbconfigs)
        XFree (fbconfigs);
    } else {
      XVisualInfo templ;
--- 413,424 ----
      
      if (i < n_fbconfigs)
!       vinfo =
!         _glc_glx_proc_address.glx_get_visual_from_fbconfig (display,
!                                                             fbconfigs[i]);
!     
      if (fbconfigs)
        XFree (fbconfigs);
+ #endif
+     
    } else {
      XVisualInfo templ;
***************
*** 392,396 ****
      vinfo = XGetVisualInfo (display, VisualIDMask, &templ, &n_items);
    }
! 
    return vinfo;
  }
--- 429,433 ----
      vinfo = XGetVisualInfo (display, VisualIDMask, &templ, &n_items);
    }
!   
    return vinfo;
  }

Index: glc_glx_info.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_info.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** glc_glx_info.c	10 Feb 2004 23:38:36 -0000	1.8
--- glc_glx_info.c	16 Feb 2004 22:02:40 -0000	1.9
***************
*** 32,36 ****
--- 32,63 ----
  #include "glcint.h"
  
+ #include <dlfcn.h>
+ 
+ glc_gl_proc_address_list_t _glc_glx_gl_proc_address = {
+ 
+ #ifdef GL_ARB_multitexture
+   NULL,
+   NULL,
+ #endif
+ 
+ #ifdef GL_ARB_fragment_program
+   NULL,
+   NULL,
+   NULL,
+   NULL,
+ #endif
+   
+   0
+ };
+ 
  glc_glx_proc_address_list_t _glc_glx_proc_address = {
+ 
+ #ifdef GLX_VERSION_1_3
+   NULL,
+   NULL,
+   NULL,
+   NULL,
+   NULL,
+ #endif
    
  #ifdef GLX_ATI_render_texture
***************
*** 38,63 ****
    NULL,
  #endif
!   
    0
  };
  
  static void
! glc_proc_address_lookup (void)
  {
    
  #ifdef GLX_ARB_get_proc_address
!   _glc_glx_proc_address.supported = 1;
  
  #ifdef GLX_ATI_render_texture
    _glc_glx_proc_address.glx_bind_tex_image_ati =
!     (PFNGLXBINDTEXIMAGEATIPROC)
!     glXGetProcAddressARB ("glXBindTexImageATI");
    _glc_glx_proc_address.glx_release_tex_image_ati =
!     (PFNGLXRELEASETEXIMAGEATIPROC)
!     glXGetProcAddressARB ("glXReleaseTexImageATI");
! #endif
!   
! #elif
!   _glc_glx_proc_address.supported = 0;
  #endif
    
--- 65,157 ----
    NULL,
  #endif
! 
    0
  };
  
+ typedef void *(* glc_proc_ptr_get_proc_address_arb_t)(GLubyte *);
+ 
+ glc_proc_ptr_get_proc_address_arb_t glc_glx_get_proc_address_arb = NULL;
+ 
+ static void *
+ glc_glx_get_proc_address (const char *name)
+ {
+   void *address = NULL;
+   
+   if (glc_glx_get_proc_address_arb)
+     address = glc_glx_get_proc_address_arb ((GLubyte *) name);
+   
+   if (!address) {
+     void *dlhand;
+     
+     if ((dlhand = dlopen (NULL, RTLD_LAZY))) {
+       address = dlsym (dlhand, name);
+       dlclose (dlhand);
+     }
+   }
+   
+   return address;
+ }
+ 
  static void
! glc_glx_proc_address_lookup (void)
  {
+   _glc_glx_gl_proc_address.supported = 1;
+   _glc_glx_proc_address.supported = 1;
    
  #ifdef GLX_ARB_get_proc_address
!   glc_glx_get_proc_address_arb =
!     (glc_proc_ptr_get_proc_address_arb_t)
!     glc_glx_get_proc_address ("glXGetProcAddressARB");
! #endif
! 
! #ifdef GL_ARB_multitexture
!   _glc_glx_gl_proc_address.gl_active_texture_arb =
!     (glc_proc_ptr_gl_active_texture_arb_t)
!     glc_glx_get_proc_address ("glActiveTextureARB");
!   _glc_glx_gl_proc_address.gl_multi_tex_coord_2d_arb =
!     (glc_proc_ptr_gl_multi_tex_coord_2d_arb_t)
!     glc_glx_get_proc_address ("glMultiTexCoord2dARB");
! #endif
  
+ #ifdef GL_ARB_fragment_program
+   _glc_glx_gl_proc_address.gl_gen_programs_arb =
+     (glc_proc_ptr_gl_gen_programs_arb_t)
+     glc_glx_get_proc_address ("glGenProgramsARB");
+   _glc_glx_gl_proc_address.gl_delete_programs_arb =
+     (glc_proc_ptr_gl_delete_programs_arb_t)
+     glc_glx_get_proc_address ("glDeleteProgramsARB");
+   _glc_glx_gl_proc_address.gl_program_string_arb =
+     (glc_proc_ptr_gl_program_string_arb_t)
+     glc_glx_get_proc_address ("glProgramStringARB");
+   _glc_glx_gl_proc_address.gl_bind_program_arb =
+     (glc_proc_ptr_gl_bind_program_arb_t)
+     glc_glx_get_proc_address ("glBindProgramARB");
+ #endif
+ 
+ #ifdef GLX_VERSION_1_3
+   _glc_glx_proc_address.glx_get_fbconfigs =
+     (glc_proc_ptr_glx_get_fbconfigs_t)
+     glc_glx_get_proc_address ("glXGetFBConfigs");
+   _glc_glx_proc_address.glx_get_fbconfig_attrib =
+     (glc_proc_ptr_glx_get_fbconfig_attrib_t)
+     glc_glx_get_proc_address ("glXGetFBConfigAttrib");
+   _glc_glx_proc_address.glx_get_visual_from_fbconfig =
+     (glc_proc_ptr_glx_get_visual_from_fbconfig_t)
+     glc_glx_get_proc_address ("glXGetVisualFromFBConfig");
+   _glc_glx_proc_address.glx_create_pbuffer =
+     (glc_proc_ptr_glx_create_pbuffer_t)
+     glc_glx_get_proc_address ("glXCreatePbuffer");
+   _glc_glx_proc_address.glx_destroy_pbuffer =
+     (glc_proc_ptr_glx_destroy_pbuffer_t)
+     glc_glx_get_proc_address ("glXDestroyPbuffer");
+ #endif
+   
  #ifdef GLX_ATI_render_texture
    _glc_glx_proc_address.glx_bind_tex_image_ati =
!     (glc_proc_ptr_bind_tex_image_ati_t)
!     glc_glx_get_proc_address ("glXBindTexImageATI");
    _glc_glx_proc_address.glx_release_tex_image_ati =
!     (glc_proc_ptr_release_tex_image_ati_t)
!     glc_glx_get_proc_address ("glXReleaseTexImageATI");
  #endif
    
***************
*** 81,85 ****
      info->displays = NULL;
      info->n_displays = 0;
!     glc_proc_address_lookup ();
      xthread_key_create (&info_tsd, NULL);
      xthread_set_specific (info_tsd, info);
--- 175,179 ----
      info->displays = NULL;
      info->n_displays = 0;
!     glc_glx_proc_address_lookup ();
      xthread_key_create (&info_tsd, NULL);
      xthread_set_specific (info_tsd, info);
***************
*** 168,172 ****
--- 262,269 ----
      glXCreateContext (display, vinfo, NULL, 1);
  
+ #ifdef GLX_VERSION_1_3
    screen_info->root_context.fbconfig = (XID) 0;
+ #endif
+   
    screen_info->root_context.id = vinfo->visualid;
    
***************
*** 237,241 ****
  slim_hidden_def(glc_glx_initialize);
  
! long int
  glc_glx_features (Display *display,
                    int screen)
--- 334,376 ----
  slim_hidden_def(glc_glx_initialize);
  
! unsigned long
! glc_glx_compiled_features (void)
! {
!   return (0
! 
! #ifdef GLX_VERSION_1_3
!           | GLC_FEATURE_OFFSCREEN_DRAWING_MASK
! #endif
! 
! #ifdef GL_EXT_texture_rectangle
!           | GLC_FEATURE_EXT_TEXTURE_RECTANGLE_MASK
! #endif
! 
! #ifdef GL_NV_texture_rectangle
!           | GLC_FEATURE_NV_TEXTURE_RECTANGLE_MASK
! #endif
!           
! #ifdef GL_ARB_multisample
!           | GLC_FEATURE_MULTISAMPLE_MASK
!           
! #ifdef GLX_VERSION_1_3
!           | GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK
! #endif
!           
! #endif
!           
! #if defined(GL_ARB_multitexture) && defined(GL_ARB_fragment_program)
!           | GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK
! #endif
!           
! #ifdef GLX_ATI_render_texture
!           | GLC_FEATURE_ATI_RENDER_TEXTURE_MASK
! #endif
!           
!           );
! }
! slim_hidden_def(glc_glx_compiled_features);
! 
! unsigned long
  glc_glx_features (Display *display,
                    int screen)

Index: glc_glx_pbuffer.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_pbuffer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** glc_glx_pbuffer.c	10 Feb 2004 23:38:36 -0000	1.5
--- glc_glx_pbuffer.c	16 Feb 2004 22:02:40 -0000	1.6
***************
*** 32,35 ****
--- 32,38 ----
  #include "glcint.h"
  
+ extern glc_glx_proc_address_list_t _glc_glx_proc_address;
+ 
+ #ifdef GLX_VERSION_1_3
  GLXPbuffer
  glc_glx_pbuffer_create (Display *display,
***************
*** 62,66 ****
    pbuffer_attr[i++] = 0;
      
!   return glXCreatePbuffer (display, fbconfig, pbuffer_attr);
  }
  
--- 65,70 ----
    pbuffer_attr[i++] = 0;
      
!   return
!     _glc_glx_proc_address.glx_create_pbuffer (display, fbconfig, pbuffer_attr);
  }
  
***************
*** 69,73 ****
                           GLXPbuffer pbuffer)
  {
!   glXDestroyPbuffer (display, pbuffer);
  }
! 
--- 73,77 ----
                           GLXPbuffer pbuffer)
  {
!   _glc_glx_proc_address.glx_destroy_pbuffer (display, pbuffer);
  }
! #endif

Index: glc_glx_surface.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_surface.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** glc_glx_surface.c	12 Feb 2004 12:49:39 -0000	1.13
--- glc_glx_surface.c	16 Feb 2004 22:02:40 -0000	1.14
***************
*** 32,35 ****
--- 32,36 ----
  #include "glcint.h"
  
+ extern glc_gl_proc_address_list_t _glc_glx_gl_proc_address;
  extern glc_glx_proc_address_list_t _glc_glx_proc_address;
  
***************
*** 94,124 ****
  }
  
- static glc_bool_t
- _glc_glx_surface_enable_program (void *abstract_surface,
-                                  glc_texture_t *src,
-                                  glc_texture_t *mask)
- {
-   glc_glx_surface_t *surface = (glc_glx_surface_t *) abstract_surface;
-   glc_bool_t status = 0;
- 
-   if (surface->screen_info->feature_mask &
-       GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
-     status =
-       glc_program_enable_fragment_arb (&surface->screen_info->programs,
-                                        src, mask);
- 
-   return status;
- }
- 
- static void
- _glc_glx_surface_disable_program (void *abstract_surface)
- {
-   glc_glx_surface_t *surface = (glc_glx_surface_t *) abstract_surface;
- 
-   if (surface->screen_info->feature_mask &
-       GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
-     glc_program_disable_fragment_arb ();
- }
- 
  static const struct glc_surface_backend glc_glx_surface_backend = {
    _glc_glx_surface_create_similar,
--- 95,98 ----
***************
*** 128,134 ****
    _glc_glx_surface_get_texture,
    _glc_glx_surface_realize,
!   _glc_glx_surface_show,
!   _glc_glx_surface_enable_program,
!   _glc_glx_surface_disable_program
  };
  
--- 102,106 ----
    _glc_glx_surface_get_texture,
    _glc_glx_surface_realize,
!   _glc_glx_surface_show
  };
  
***************
*** 212,217 ****
    surface->screen_info = screen_info;
    surface->context = context;
!   
!   surface->base.format = format;  
    surface->base.width = width;
    surface->base.height = height;
--- 184,192 ----
    surface->screen_info = screen_info;
    surface->context = context;
! 
!   surface->base.proc_address = &_glc_glx_gl_proc_address;
!   surface->base.programs = &screen_info->programs;
!   surface->base.feature_mask = screen_info->feature_mask;
!   surface->base.format = format;
    surface->base.width = width;
    surface->base.height = height;
***************
*** 219,223 ****
    texture_format = glc_get_gl_format_from_bpp (format->bpp);
  
!   if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_RENDER_TEXTURE_MASK) {
      surface->render_texture = 1;
      if (format->red_size || format->green_size || format->blue_size)
--- 194,199 ----
    texture_format = glc_get_gl_format_from_bpp (format->bpp);
  
!   if (screen_info->glx_feature_mask &
!       GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK) {
      surface->render_texture = 1;
      if (format->red_size || format->green_size || format->blue_size)
***************
*** 237,240 ****
--- 213,217 ----
    }
  
+ #ifdef GLX_VERSION_1_3
    if (screen_info->feature_mask & GLC_FEATURE_OFFSCREEN_DRAWING_MASK)
      surface->drawable = surface->pbuffer =
***************
*** 243,246 ****
--- 220,224 ----
                                surface->base.texture,
                                surface->render_texture);
+ #endif
    
    if ((!surface->render_texture) && (!surface->pbuffer))
***************
*** 294,298 ****
    surface->screen_info = screen_info;
    surface->context = context;
!   
    surface->base.format = format;
    surface->base.width = width;
--- 272,279 ----
    surface->screen_info = screen_info;
    surface->context = context;
! 
!   surface->base.proc_address = &_glc_glx_gl_proc_address;
!   surface->base.programs = &screen_info->programs;
!   surface->base.feature_mask = screen_info->feature_mask;
    surface->base.format = format;
    surface->base.width = width;
***************
*** 313,319 ****
    glc_glx_surface_t *templ = (glc_glx_surface_t *) abstract_templ;
    
!   if (templ->screen_info->glx_feature_mask & GLC_GLX_FEATURE_PBUFFER_MASK) {
      glc_format_t *format;
! 
      format = glc_format_find_sufficient_standard
        (templ->base.format, 1, GLC_FORMAT_OPTION_OFFSCREEN_MASK, format_name);
--- 294,300 ----
    glc_glx_surface_t *templ = (glc_glx_surface_t *) abstract_templ;
    
!   if (templ->screen_info->feature_mask & GLC_FEATURE_OFFSCREEN_DRAWING_MASK) {
      glc_format_t *format;
!     
      format = glc_format_find_sufficient_standard
        (templ->base.format, 1, GLC_FORMAT_OPTION_OFFSCREEN_MASK, format_name);
***************
*** 352,359 ****
    if (surface->base.texture)
      glc_texture_destroy (surface->base.texture);
!   
    if (surface->pbuffer)
      glc_glx_pbuffer_destroy (surface->screen_info->display_info->display,
                               surface->pbuffer);
    
    glc_surface_pop_current (&surface->base);
--- 333,342 ----
    if (surface->base.texture)
      glc_texture_destroy (surface->base.texture);
! 
! #ifdef GLX_VERSION_1_3
    if (surface->pbuffer)
      glc_glx_pbuffer_destroy (surface->screen_info->display_info->display,
                               surface->pbuffer);
+ #endif
    
    glc_surface_pop_current (&surface->base);

Index: glc_program.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_program.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** glc_program.c	10 Feb 2004 23:38:36 -0000	1.1
--- glc_program.c	16 Feb 2004 22:02:40 -0000	1.2
***************
*** 32,35 ****
--- 32,36 ----
  #include "glcint.h"
  
+ #ifdef GL_ARB_fragment_program
  /*
   * ARB_fragment_program
***************
*** 71,100 ****
  
  static unsigned int
! glc_program_compile_fragment_arb (const char *program_string)
  {
    GLint error;
    GLuint program;
      
!   glGenProgramsARB (1, (GLuint *) &program);
!   glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, program);
!   glProgramStringARB (GL_FRAGMENT_PROGRAM_ARB,
!                       GL_PROGRAM_FORMAT_ASCII_ARB,
!                       strlen (program_string), program_string);
    
    glGetIntegerv (GL_PROGRAM_ERROR_POSITION_ARB, &error);
    if (error != -1) {
!     glDeleteProgramsARB (1, &program);
      program = 0;
    }
! 
    return (unsigned int) program;
  }
  
  glc_bool_t
! glc_program_enable_fragment_arb (glc_fragment_programs_t *programs,
                                   glc_texture_t *src_texture,
                                   glc_texture_t *mask_texture)
  {
!   unsigned int program = 0;
    
    if (src_texture->target == GL_TEXTURE_2D) {
--- 72,107 ----
  
  static unsigned int
! glc_program_compile_fragment_arb (glc_gl_proc_address_list_t *proc_address,
!                                   const char *program_string)
  {
    GLint error;
    GLuint program;
      
!   proc_address->gl_gen_programs_arb (1, (GLuint *) &program);
!   proc_address->gl_bind_program_arb (GL_FRAGMENT_PROGRAM_ARB, program);
!   proc_address->gl_program_string_arb (GL_FRAGMENT_PROGRAM_ARB,
!                                        GL_PROGRAM_FORMAT_ASCII_ARB,
!                                        strlen (program_string),
!                                        program_string);
    
    glGetIntegerv (GL_PROGRAM_ERROR_POSITION_ARB, &error);
    if (error != -1) {
!     proc_address->gl_delete_programs_arb (1, &program);
      program = 0;
    }
!   
    return (unsigned int) program;
  }
+ #endif
  
  glc_bool_t
! glc_program_enable_fragment_arb (glc_gl_proc_address_list_t *proc_address,
!                                  glc_fragment_programs_t *programs,
                                   glc_texture_t *src_texture,
                                   glc_texture_t *mask_texture)
  {
! 
! #ifdef GL_ARB_fragment_program
!   GLuint program;
    
    if (src_texture->target == GL_TEXTURE_2D) {
***************
*** 102,106 ****
        if (!programs->program_2d_2d)
          programs->program_2d_2d = glc_program_compile_fragment_arb
!           (GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_2D_2D);
        
        program = programs->program_2d_2d;
--- 109,113 ----
        if (!programs->program_2d_2d)
          programs->program_2d_2d = glc_program_compile_fragment_arb
!           (proc_address, GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_2D_2D);
        
        program = programs->program_2d_2d;
***************
*** 108,112 ****
        if (!programs->program_2d_rect)
          programs->program_2d_rect = glc_program_compile_fragment_arb
!           (GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_2D_RECT);
        
        program = programs->program_2d_rect;
--- 115,119 ----
        if (!programs->program_2d_rect)
          programs->program_2d_rect = glc_program_compile_fragment_arb
!           (proc_address, GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_2D_RECT);
        
        program = programs->program_2d_rect;
***************
*** 116,120 ****
        if (!programs->program_rect_2d)
          programs->program_rect_2d = glc_program_compile_fragment_arb
!           (GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_RECT_2D);
        
        program = programs->program_rect_2d;
--- 123,127 ----
        if (!programs->program_rect_2d)
          programs->program_rect_2d = glc_program_compile_fragment_arb
!           (proc_address, GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_RECT_2D);
        
        program = programs->program_rect_2d;
***************
*** 122,126 ****
        if (!programs->program_rect_rect)
          programs->program_rect_rect = glc_program_compile_fragment_arb
!           (GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_RECT_RECT);
        
        program = programs->program_rect_rect;
--- 129,133 ----
        if (!programs->program_rect_rect)
          programs->program_rect_rect = glc_program_compile_fragment_arb
!           (proc_address, GLC_PROGRAM_FRAGMENT_ARB_SRC_IN_MASK_RECT_RECT);
        
        program = programs->program_rect_rect;
***************
*** 130,137 ****
    if (program) {
      glEnable (GL_FRAGMENT_PROGRAM_ARB);
!     glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, program);
      
      return 1;
!   } 
  
    return 0;
--- 137,145 ----
    if (program) {
      glEnable (GL_FRAGMENT_PROGRAM_ARB);
!     proc_address->gl_bind_program_arb (GL_FRAGMENT_PROGRAM_ARB, program);
      
      return 1;
!   }
! #endif
  
    return 0;
***************
*** 139,145 ****
  
  void
! glc_program_disable_fragment_arb (void)
  {
!   glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, 0);
    glDisable (GL_FRAGMENT_PROGRAM_ARB);
  }
--- 147,157 ----
  
  void
! glc_program_disable_fragment_arb (glc_gl_proc_address_list_t *proc_address)
  {
!   
! #ifdef GL_ARB_fragment_program
!   proc_address->gl_bind_program_arb (GL_FRAGMENT_PROGRAM_ARB, 0);
    glDisable (GL_FRAGMENT_PROGRAM_ARB);
+ #endif
+   
  }

Index: glc_surface.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_surface.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** glc_surface.c	12 Feb 2004 12:49:39 -0000	1.14
--- glc_surface.c	16 Feb 2004 22:02:40 -0000	1.15
***************
*** 43,46 ****
--- 43,47 ----
    surface->format = NULL;
    surface->texture = NULL;
+   surface->feature_mask = 0;
    surface->repeat = 0;
    surface->transform = NULL;
***************
*** 105,109 ****
                              glc_texture_t *mask)
  {
!   return surface->backend->enable_program (surface, src, mask);
  }
  
--- 106,116 ----
                              glc_texture_t *mask)
  {
!   if (surface->feature_mask & GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
!     return
!       glc_program_enable_fragment_arb (surface->proc_address,
!                                        surface->programs,
!                                        src, mask);
!   
!   return 0;
  }
  
***************
*** 111,115 ****
  glc_surface_disable_program (glc_surface_t *surface)
  {
!   surface->backend->disable_program (surface);
  }
  
--- 118,123 ----
  glc_surface_disable_program (glc_surface_t *surface)
  {
!   if (surface->feature_mask & GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
!     glc_program_disable_fragment_arb (surface->proc_address);
  }
  

Index: glc_texture.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_texture.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** glc_texture.c	10 Feb 2004 23:38:36 -0000	1.7
--- glc_texture.c	16 Feb 2004 22:02:40 -0000	1.8
***************
*** 32,37 ****
  #include "glcint.h"
  
- #define TEXTURE_MAX_SIZE 4192
- 
  static glc_bool_t
  _glc_texture_is_power_of_two (int value)
--- 32,35 ----
***************
*** 59,63 ****
      if (target_mask & GLC_TEXTURE_TARGET_EXT_RECTANGLE_MASK) {
  
! #if GL_EXT_texture_rectangle
        *target = GL_TEXTURE_RECTANGLE_EXT;
        *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_EXT;
--- 57,61 ----
      if (target_mask & GLC_TEXTURE_TARGET_EXT_RECTANGLE_MASK) {
  
! #ifdef GL_EXT_texture_rectangle
        *target = GL_TEXTURE_RECTANGLE_EXT;
        *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_EXT;
***************
*** 66,70 ****
      } else if (target_mask & GLC_TEXTURE_TARGET_NV_RECTANGLE_MASK) {
        
! #if GL_NV_texture_rectangle
        *target = GL_TEXTURE_RECTANGLE_NV;
        *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV;
--- 64,68 ----
      } else if (target_mask & GLC_TEXTURE_TARGET_NV_RECTANGLE_MASK) {
        
! #ifdef GL_NV_texture_rectangle
        *target = GL_TEXTURE_RECTANGLE_NV;
        *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV;
***************
*** 201,209 ****
  {
  
! #if GL_EXT_texture_rectangle
    glDisable (GL_TEXTURE_RECTANGLE_EXT);
  #endif
    
! #if GL_NV_texture_rectangle
    glDisable (GL_TEXTURE_RECTANGLE_NV);
  #endif
--- 199,207 ----
  {
  
! #ifdef GL_EXT_texture_rectangle
    glDisable (GL_TEXTURE_RECTANGLE_EXT);
  #endif
    
! #ifdef GL_NV_texture_rectangle
    glDisable (GL_TEXTURE_RECTANGLE_NV);
  #endif

Index: glcint.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glcint.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** glcint.h	12 Feb 2004 12:49:39 -0000	1.15
--- glcint.h	16 Feb 2004 22:02:40 -0000	1.16
***************
*** 79,82 ****
--- 79,127 ----
  #define GLC_FORMAT_ALL_EXCEPT_ID_MASK ((1 << 16) - 2)
  
+ #ifdef LIBGLC_HAS_AGL_BACKEND
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glext.h>
+ #else
+ #include <GL/gl.h>
+ #include <GL/glext.h>
+ #endif
+ 
+ typedef void (* glc_proc_ptr_gl_active_texture_arb_t)
+      (GLenum);
+ typedef void (* glc_proc_ptr_gl_multi_tex_coord_2d_arb_t)
+      (GLenum, GLdouble, GLdouble);
+ typedef void (* glc_proc_ptr_gl_gen_programs_arb_t)
+      (GLsizei, GLuint *);
+ typedef void (* glc_proc_ptr_gl_delete_programs_arb_t)
+      (GLsizei, const GLuint *);
+ typedef void (* glc_proc_ptr_gl_program_string_arb_t)
+      (GLenum, GLenum, GLsizei, const GLvoid *);
+ typedef void (* glc_proc_ptr_gl_bind_program_arb_t)
+       (GLenum, GLuint);
+ 
+ typedef struct _glc_gl_proc_address_list_t {
+ 
+ #ifdef GL_ARB_multitexture
+   glc_proc_ptr_gl_active_texture_arb_t gl_active_texture_arb;
+   glc_proc_ptr_gl_multi_tex_coord_2d_arb_t gl_multi_tex_coord_2d_arb;
+ #endif
+     
+ #ifdef GL_ARB_fragment_program
+   glc_proc_ptr_gl_gen_programs_arb_t gl_gen_programs_arb;
+   glc_proc_ptr_gl_delete_programs_arb_t gl_delete_programs_arb;
+   glc_proc_ptr_gl_program_string_arb_t gl_program_string_arb;
+   glc_proc_ptr_gl_bind_program_arb_t gl_bind_program_arb;
+ #endif
+ 
+   glc_bool_t supported;
+ } glc_gl_proc_address_list_t;
+ 
+ typedef struct _glc_fragment_programs_t {
+   unsigned int program_2d_2d;
+   unsigned int program_rect_2d;
+   unsigned int program_2d_rect;
+   unsigned int program_rect_rect;
+ } glc_fragment_programs_t;
+ 
  typedef enum {
    GLC_CN_NONE,
***************
*** 141,152 ****
    void
    (*show) (void *surface);
- 
-   glc_bool_t
-   (*enable_program) (void *surface,
-                      glc_texture_t *src,
-                      glc_texture_t *mask);
- 
-   void
-   (*disable_program) (void *surface);
  } glc_surface_backend_t;
  
--- 186,189 ----
***************
*** 157,160 ****
--- 194,198 ----
    glc_texture_t *texture;
    long int status_mask;
+   long int feature_mask;
    glc_filter_t filter;
    glc_bool_t repeat;
***************
*** 167,170 ****
--- 205,210 ----
    glc_region_box_t dirty_region;
    glc_bool_t requires_flipping;
+   glc_gl_proc_address_list_t *proc_address;
+   glc_fragment_programs_t *programs;
  };
  
***************
*** 174,184 ****
  } glc_extension_map;
  
- typedef struct _glc_fragment_programs_t {
-   unsigned int program_2d_2d;
-   unsigned int program_rect_2d;
-   unsigned int program_2d_rect;
-   unsigned int program_rect_rect;
- } glc_fragment_programs_t;
- 
  extern void __internal_linkage
  glc_matrix_transform_point (glc_matrix_t *matrix,
--- 214,217 ----
***************
*** 313,322 ****
  
  extern glc_bool_t __internal_linkage
! glc_program_enable_fragment_arb (glc_fragment_programs_t *programs,
                                   glc_texture_t *src_texture,
                                   glc_texture_t *mask_texture);
  
  extern void __internal_linkage
! glc_program_disable_fragment_arb (void);
  
  #define MAXSHORT SHRT_MAX
--- 346,356 ----
  
  extern glc_bool_t __internal_linkage
! glc_program_enable_fragment_arb (glc_gl_proc_address_list_t *proc_address,
!                                  glc_fragment_programs_t *programs,
                                   glc_texture_t *src_texture,
                                   glc_texture_t *mask_texture);
  
  extern void __internal_linkage
! glc_program_disable_fragment_arb (glc_gl_proc_address_list_t *proc_address);
  
  #define MAXSHORT SHRT_MAX
***************
*** 403,411 ****
  #ifdef LIBGLC_HAS_GLX_BACKEND
  
- #define GL_GLEXT_PROTOTYPES   1
- #define GLX_GLXEXT_PROTOTYPES 1
- 
- #include <GL/gl.h>
- #include <GL/glext.h>     
  #include <GL/glx.h>
  #include <GL/glxext.h>
--- 437,440 ----
***************
*** 415,427 ****
  #endif
  
! #define GLC_GLX_FEATURE_FBCONFIG_MASK              (1L << 0)
! #define GLC_GLX_FEATURE_PBUFFER_MASK               (1L << 1)
! #define GLC_GLX_FEATURE_RENDER_TEXTURE_MASK        (1L << 2)
! #define GLC_GLX_FEATURE_EXT_TEXTURE_RECTANGLE_MASK (1L << 3)
! #define GLC_GLX_FEATURE_NV_TEXTURE_RECTANGLE_MASK  (1L << 4)
! #define GLC_GLX_FEATURE_MULTISAMPLE_MASK           (1L << 5)
! #define GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK    (1L << 6)
! #define GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK    (1L << 7)
! #define GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK  (1L << 8)
  
  typedef struct _glc_glx_surface glc_glx_surface_t;
--- 444,455 ----
  #endif
  
! #define GLC_GLX_FEATURE_GLX13_MASK                 (1L << 0)
! #define GLC_GLX_FEATURE_EXT_TEXTURE_RECTANGLE_MASK (1L << 1)
! #define GLC_GLX_FEATURE_NV_TEXTURE_RECTANGLE_MASK  (1L << 2)
! #define GLC_GLX_FEATURE_MULTISAMPLE_MASK           (1L << 3)
! #define GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK    (1L << 4)
! #define GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK    (1L << 5)
! #define GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK  (1L << 6)
! #define GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK    (1L << 7)
  
  typedef struct _glc_glx_surface glc_glx_surface_t;
***************
*** 429,437 ****
  typedef struct _glc_glx_display_info_t glc_glx_display_info_t;
  
  typedef struct _glc_glx_proc_address_list_t {
    
  #ifdef GLX_ATI_render_texture
!   PFNGLXBINDTEXIMAGEATIPROC glx_bind_tex_image_ati;
!   PFNGLXRELEASETEXIMAGEATIPROC glx_release_tex_image_ati;
  #endif
  
--- 457,493 ----
  typedef struct _glc_glx_display_info_t glc_glx_display_info_t;
  
+ #ifdef GLX_VERSION_1_3
+ typedef GLXFBConfig *(* glc_proc_ptr_glx_get_fbconfigs_t)
+      (Display *, int, int *);
+ typedef int (* glc_proc_ptr_glx_get_fbconfig_attrib_t)
+      (Display *, GLXFBConfig, int, int *);
+ typedef XVisualInfo *(* glc_proc_ptr_glx_get_visual_from_fbconfig_t)
+      (Display *, GLXFBConfig);
+ typedef GLXPbuffer (* glc_proc_ptr_glx_create_pbuffer_t)
+      (Display *, GLXFBConfig, const int *);
+ typedef void (* glc_proc_ptr_glx_destroy_pbuffer_t)
+      (Display *, GLXPbuffer);
+ #endif
+ 
+ #ifdef GLX_ATI_render_texture
+ typedef void (* glc_proc_ptr_bind_tex_image_ati_t)
+      (Display *, GLXPbuffer, int);
+ typedef void (* glc_proc_ptr_release_tex_image_ati_t)
+      (Display *, GLXPbuffer, int);
+ #endif
+ 
  typedef struct _glc_glx_proc_address_list_t {
+ 
+ #ifdef GLX_VERSION_1_3
+   glc_proc_ptr_glx_get_fbconfigs_t glx_get_fbconfigs;
+   glc_proc_ptr_glx_get_fbconfig_attrib_t glx_get_fbconfig_attrib;
+   glc_proc_ptr_glx_get_visual_from_fbconfig_t glx_get_visual_from_fbconfig;
+   glc_proc_ptr_glx_create_pbuffer_t glx_create_pbuffer;
+   glc_proc_ptr_glx_destroy_pbuffer_t glx_destroy_pbuffer;
+ #endif
    
  #ifdef GLX_ATI_render_texture
!   glc_proc_ptr_bind_tex_image_ati_t glx_bind_tex_image_ati;
!   glc_proc_ptr_release_tex_image_ati_t glx_release_tex_image_ati;
  #endif
  
***************
*** 459,463 ****
--- 515,523 ----
    GLXContext context;
    XID id;
+   
+ #ifdef GLX_VERSION_1_3
    GLXFBConfig fbconfig;
+ #endif
+   
  } glc_glx_context_t;
  
***************
*** 492,496 ****
    glc_glx_context_t *context;
    GLXDrawable drawable;
!   GLXPbuffer pbuffer;
    glc_bool_t render_texture;
  };
--- 552,556 ----
    glc_glx_context_t *context;
    GLXDrawable drawable;
!   GLXDrawable pbuffer;
    glc_bool_t render_texture;
  };
***************
*** 529,532 ****
--- 589,593 ----
  glc_glx_query_formats (glc_glx_screen_info_t *screen_info);
  
+ #ifdef GLX_VERSION_1_3
  extern GLXPbuffer __internal_linkage
  glc_glx_pbuffer_create (Display *display,
***************
*** 538,545 ****
--- 599,608 ----
  glc_glx_pbuffer_destroy (Display *display,
                           GLXPbuffer pbuffer);
+ #endif
  
  /* Avoid unnecessary PLT entries.  */
  
  slim_hidden_proto(glc_glx_initialize)
+ slim_hidden_proto(glc_glx_compiled_features)
  slim_hidden_proto(glc_glx_features)
  slim_hidden_proto(glc_glx_find_format)
***************
*** 555,560 ****
  
  #include <Carbon/Carbon.h>
- #include <OpenGL/gl.h>
- #include <OpenGL/glext.h>
  #include <AGL/agl.h>
  
--- 618,621 ----
***************
*** 649,652 ****
--- 710,714 ----
  
  slim_hidden_proto(glc_agl_initialize)
+ slim_hidden_proto(glc_agl_compiled_features)
  slim_hidden_proto(glc_agl_features)
  slim_hidden_proto(glc_agl_find_format)





More information about the cairo-commit mailing list