[cairo] new pattern interface and OpenGL patch

Bill Spitzak spitzak at d2.com
Thu Mar 25 19:00:15 PST 2004


On Thursday 25 March 2004 09:11 am, Carl Worth wrote:
> If so, I suppose that the options parameter cairo_set_target_glx might
> have to change to be compatible with GLX, but that seems like a good
> thing anyway. (Currently, the API exposes the GLC header file which
> would not be necessary if it did not also expose GLC options).

The GLX interface is a rather complex null-terminated vararg list. Better 
would be to use bitflags, and there appears to be a somewhat standard set 
defined by GLUT. They do not cover all the possibilities of GLX but they 
match the real things that can be turned on/off on modern hardware:
(from the header for glut-3.6):

#define GLUT_RGB                        0
#define GLUT_RGBA                       GLUT_RGB
#define GLUT_INDEX                      1
#define GLUT_SINGLE                     0
#define GLUT_DOUBLE                     2
#define GLUT_ACCUM                      4
#define GLUT_ALPHA                      8
#define GLUT_DEPTH                      16
#define GLUT_STENCIL                    32
/* I added another symbol with value 64 to indicate that 24-bit rgb is 
required, and that 12-bit is unacceptable */
#define GLUT_MULTISAMPLE                128
#define GLUT_STEREO                     256
#define GLUT_LUMINANCE                  512

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com




More information about the cairo mailing list