1 module glx.glxint;
2 
3 version(linux):
4 extern(C):
5 
6 private import x11.X;
7 private import opengl.gl2;
8 
9 alias __GLXvisualConfig = __GLXvisualConfigRec;
10 alias __GLXFBConfig = __GLXFBConfigRec;
11 
12 struct __GLXvisualConfigRec
13 {
14     VisualID vid;
15     int _class;
16     bool rgba;
17     int redSize, greenSize, blueSize, alphaSize;
18     size_t redMask, greenMask, blueMask, alphaMask;
19     int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
20     bool doubleBuffer;
21     bool stereo;
22     int bufferSize;
23     int depthSize;
24     int stencilSize;
25     int auxBuffers;
26     int level;
27     /* Start of Extended Visual Properties */
28     int visualRating;		/* visual_rating extension */
29     int transparentPixel;	/* visual_info extension */
30 				/*    colors are floats scaled to ints */
31     int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
32     int transparentIndex;
33     int multiSampleSize;
34     int nMultiSampleBuffers;
35     int visualSelectGroup;
36 };
37 
38 immutable __GLX_MIN_CONFIG_PROPS = 18;
39 immutable __GLX_MAX_CONFIG_PROPS = 500;
40 
41 immutable __GLX_EXT_CONFIG_PROPS= 10;
42 
43 /*
44 ** Since we send all non-core visual properties as token, value pairs,
45 ** we require 2 words across the wire. In order to maintain backwards
46 ** compatibility, we need to send the total number of words that the
47 ** VisualConfigs are sent back in so old libraries can simply "ignore"
48 ** the new properties. 
49 */
50 
51 immutable __GLX_TOTAL_CONFIG = __GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS;
52 
53 struct __GLXFBConfigRec
54 {
55     int visualType;
56     int transparentType;
57                                 /*    colors are floats scaled to ints */
58     int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
59     int transparentIndex;
60 
61     int visualCaveat;
62 
63     int associatedVisualId;
64     int screen;
65 
66     int drawableType;
67     int renderType;
68 
69     int maxPbufferWidth, maxPbufferHeight, maxPbufferPixels;
70     int optimalPbufferWidth, optimalPbufferHeight;  /* for SGIX_pbuffer */
71 
72     int visualSelectGroup;	/* visuals grouped by select priority */
73 
74     uint id;          
75 
76     GLboolean rgbMode;
77     GLboolean colorIndexMode;
78     GLboolean doubleBufferMode;
79     GLboolean stereoMode;
80     GLboolean haveAccumBuffer;
81     GLboolean haveDepthBuffer;
82     GLboolean haveStencilBuffer;
83 
84     /* The number of bits present in various buffers */
85     GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
86     GLint depthBits;
87     GLint stencilBits;
88     GLint indexBits;
89     GLint redBits, greenBits, blueBits, alphaBits;
90     GLuint redMask, greenMask, blueMask, alphaMask;
91 
92     GLuint multiSampleSize;     /* Number of samples per pixel (0 if no ms) */
93 
94     GLuint nMultiSampleBuffers; /* Number of availble ms buffers */
95     GLint maxAuxBuffers;
96 
97     /* frame buffer level */
98     GLint level;
99 
100     /* color ranges (for SGI_color_range) */
101     GLboolean extendedRange;
102     GLdouble minRed, maxRed;
103     GLdouble minGreen, maxGreen;
104     GLdouble minBlue, maxBlue;
105     GLdouble minAlpha, maxAlpha;
106 };
107 
108 immutable __GLX_TOTAL_FBCONFIG_PROPS = 35;