[cairo-commit] glitzinfo glitzinfo.c,1.2,1.3

David Reveman commit at pdx.freedesktop.org
Mon Aug 9 16:00:38 PDT 2004


Committed by: davidr

Update of /cvs/cairo/glitzinfo
In directory pdx:/tmp/cvs-serv10557

Modified Files:
	glitzinfo.c 
Log Message:
Find onscreen format correctly and print new glitz features

Index: glitzinfo.c
===================================================================
RCS file: /cvs/cairo/glitzinfo/glitzinfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** glitzinfo.c	20 Jul 2004 07:54:28 -0000	1.2
--- glitzinfo.c	9 Aug 2004 23:00:36 -0000	1.3
***************
*** 40,59 ****
    printf ("texture rectangle: %s\n",
            (features & GLITZ_FEATURE_TEXTURE_RECTANGLE_MASK)? "Yes": "No");
!   printf ("texture npot: %s\n",
!           (features & GLITZ_FEATURE_TEXTURE_NPOT_MASK)? "Yes": "No");
    printf ("texture mirrored repeat: %s\n",
            (features & GLITZ_FEATURE_TEXTURE_MIRRORED_REPEAT_MASK)? "Yes":
            "No");
    printf ("multitexture: %s\n",
!           (features & GLITZ_FEATURE_ARB_MULTITEXTURE_MASK)? "Yes": "No");
    printf ("texture environment combine: %s\n",
!           (features & GLITZ_FEATURE_ARB_TEXTURE_ENV_COMBINE_MASK)? "Yes":
            "No");
    printf ("texture environment dot3: %s\n",
!           (features & GLITZ_FEATURE_ARB_TEXTURE_ENV_DOT3_MASK)? "Yes": "No");
    printf ("vertex program: %s\n",
!           (features & GLITZ_FEATURE_ARB_VERTEX_PROGRAM_MASK)? "Yes": "No");
    printf ("fragment program: %s\n",
!           (features & GLITZ_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)? "Yes": "No");
    printf ("pixel buffer object: %s\n",
            (features & GLITZ_FEATURE_PIXEL_BUFFER_OBJECT_MASK)? "Yes": "No");
--- 40,62 ----
    printf ("texture rectangle: %s\n",
            (features & GLITZ_FEATURE_TEXTURE_RECTANGLE_MASK)? "Yes": "No");
!   printf ("texture non power of two: %s\n",
!           (features & GLITZ_FEATURE_TEXTURE_NON_POWER_OF_TWO_MASK)? "Yes":
!           "No");
    printf ("texture mirrored repeat: %s\n",
            (features & GLITZ_FEATURE_TEXTURE_MIRRORED_REPEAT_MASK)? "Yes":
            "No");
+   printf ("texture border clamp: %s\n",
+           (features & GLITZ_FEATURE_TEXTURE_BORDER_CLAMP_MASK)? "Yes": "No");
    printf ("multitexture: %s\n",
!           (features & GLITZ_FEATURE_MULTITEXTURE_MASK)? "Yes": "No");
    printf ("texture environment combine: %s\n",
!           (features & GLITZ_FEATURE_TEXTURE_ENV_COMBINE_MASK)? "Yes":
            "No");
    printf ("texture environment dot3: %s\n",
!           (features & GLITZ_FEATURE_TEXTURE_ENV_DOT3_MASK)? "Yes": "No");
    printf ("vertex program: %s\n",
!           (features & GLITZ_FEATURE_VERTEX_PROGRAM_MASK)? "Yes": "No");
    printf ("fragment program: %s\n",
!           (features & GLITZ_FEATURE_FRAGMENT_PROGRAM_MASK)? "Yes": "No");
    printf ("pixel buffer object: %s\n",
            (features & GLITZ_FEATURE_PIXEL_BUFFER_OBJECT_MASK)? "Yes": "No");
***************
*** 68,76 ****
    printf ("offscreen full-scene anti-aliasing: %s\n",
            (features & GLITZ_FEATURE_OFFSCREEN_MULTISAMPLE_MASK)? "Yes": "No");
! 
  }
  
  int
  main (int argc, char **argv) {
    glitz_format_t *formats;
    glitz_surface_t *surface;
--- 71,83 ----
    printf ("offscreen full-scene anti-aliasing: %s\n",
            (features & GLITZ_FEATURE_OFFSCREEN_MULTISAMPLE_MASK)? "Yes": "No");
!   printf ("full-scene anti-aliasing filter hint: %s\n",
!           (features & GLITZ_FEATURE_MULTISAMPLE_FILTER_HINT_MASK)? "Yes":
!           "No");
  }
  
  int
  main (int argc, char **argv) {
+   glitz_format_t templ;
+   unsigned long mask;
    glitz_format_t *formats;
    glitz_surface_t *surface;
***************
*** 92,115 ****
  
    glitz_glx_init (NULL);
-   
-   formats = glitz_glx_find_standard_format (display, screen,
-                                             GLITZ_FORMAT_OPTION_ONSCREEN_MASK,
-                                             GLITZ_STANDARD_ARGB32);
- 
-   if (!formats)
-     formats =
-       glitz_glx_find_standard_format (display, screen,
-                                       GLITZ_FORMAT_OPTION_ONSCREEN_MASK,
-                                       GLITZ_STANDARD_RGB24);
  
    if (!formats) {
!     fprintf (stderr, "Error: couldn't find RGB format\n");
      return 1;
    }
!   
!   vinfo = glitz_glx_get_visual_info_from_format (display, screen, formats);
!   
    if (!vinfo) {
!     fprintf (stderr, "Error: no visual info\n");
      return 1;
    }
--- 99,115 ----
  
    glitz_glx_init (NULL);
  
+   templ.draw.onscreen = 1;
+   mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+   
+   formats = glitz_glx_find_format (display, screen, mask, &templ, 0);
    if (!formats) {
!     fprintf (stderr, "Error: couldn't find onscreen format\n");
      return 1;
    }
! 
!   vinfo = glitz_glx_get_visual_info_from_format (display, screen, formats);  
    if (!vinfo) {
!     fprintf (stderr, "Error: no visual info from format\n");
      return 1;
    }
***************
*** 139,154 ****
    Rect bounds;
  
!   glitz_agl_init ();
!   
!   formats = glitz_agl_find_standard_format (GLITZ_FORMAT_OPTION_ONSCREEN_MASK,
!                                             GLITZ_STANDARD_ARGB32);
  
!   if (!formats)
!     formats =
!       glitz_agl_find_standard_format (GLITZ_FORMAT_OPTION_ONSCREEN_MASK,
!                                       GLITZ_STANDARD_RGB24);
    
!   if (!formats) {
!     fprintf (stderr, "Error: couldn't find RGB format\n");
      return 1;
    }
--- 139,150 ----
    Rect bounds;
  
!   templ.draw.onscreen = 1;
!   mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
  
!   glitz_agl_init ();
    
!   format = glitz_agl_find_format (&templ, mask, 0);
!   if (!format) {
!     fprintf (stderr, "Error: couldn't find onscreen format\n");
      return 1;
    }
***************
*** 208,211 ****
--- 204,208 ----
    
    XDestroyWindow (display, win);
+   XFreeColormap (display, xswa.colormap);
    XCloseDisplay (display);
  #endif




More information about the cairo-commit mailing list