1 /* GdkGLExt - OpenGL Extension to GDK
2  * Copyright (C) 2002-2004  Naofumi Yasufuku
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
17  */
18 
19 #ifndef __GDK_GL_TOKENS_H__
20 #define __GDK_GL_TOKENS_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
26 /*
27  * Success return value
28  */
29 #define GDK_GL_SUCCESS          0  /* same as 'Success' of X11 */
30 
31 /*
32  * Attribute list terminator
33  */
34 #define GDK_GL_ATTRIB_LIST_NONE 0  /* same as 'None' of X11 */
35 
36 /*
37  * This source is based on the OpenGL(R) Sample Implementation by SGI.
38  */
39 
40 /*
41 ** License Applicability. Except to the extent portions of this file are
42 ** made subject to an alternative license as permitted in the SGI Free
43 ** Software License B, Version 1.1 (the "License"), the contents of this
44 ** file are subject only to the provisions of the License. You may not use
45 ** this file except in compliance with the License. You may obtain a copy
46 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
47 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
48 **
49 ** http://oss.sgi.com/projects/FreeB
50 **
51 ** Note that, as provided in the License, the Software is distributed on an
52 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
53 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
54 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
55 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
56 **
57 ** Original Code. The Original Code is: OpenGL Sample Implementation,
58 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
59 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
60 ** Copyright in any portions created by third parties is as indicated
61 ** elsewhere herein. All Rights Reserved.
62 **
63 ** Additional Notice Provisions: The application programming interfaces
64 ** established by SGI in conjunction with the Original Code are The
65 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
66 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
67 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
68 ** Window System(R) (Version 1.3), released October 19, 1998. This software
69 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
70 ** published by SGI, but has not been independently verified as being
71 ** compliant with the OpenGL(R) version 1.2.1 Specification.
72 */
73 
74 /*
75  * Visual Config Attributes.
76  */
77 typedef enum
78 {
79   GDK_GL_USE_GL                     = 1,  /* support GLX rendering */
80   GDK_GL_BUFFER_SIZE                = 2,  /* depth of the color buffer */
81   GDK_GL_LEVEL                      = 3,  /* level in plane stacking */
82   GDK_GL_RGBA                       = 4,  /* true if RGBA mode */
83   GDK_GL_DOUBLEBUFFER               = 5,  /* double buffering supported */
84   GDK_GL_STEREO                     = 6,  /* stereo buffering supported */
85   GDK_GL_AUX_BUFFERS                = 7,  /* number of aux buffers */
86   GDK_GL_RED_SIZE                   = 8,  /* number of red component bits */
87   GDK_GL_GREEN_SIZE                 = 9,  /* number of green component bits */
88   GDK_GL_BLUE_SIZE                  = 10, /* number of blue component bits */
89   GDK_GL_ALPHA_SIZE                 = 11, /* number of alpha component bits */
90   GDK_GL_DEPTH_SIZE                 = 12, /* number of depth bits */
91   GDK_GL_STENCIL_SIZE               = 13, /* number of stencil bits */
92   GDK_GL_ACCUM_RED_SIZE             = 14, /* number of red accum bits */
93   GDK_GL_ACCUM_GREEN_SIZE           = 15, /* number of green accum bits */
94   GDK_GL_ACCUM_BLUE_SIZE            = 16, /* number of blue accum bits */
95   GDK_GL_ACCUM_ALPHA_SIZE           = 17, /* number of alpha accum bits */
96 
97   /*
98    * FBConfig-specific attributes.
99    * [ GLX 1.3 and later ]
100    */
101   GDK_GL_CONFIG_CAVEAT              = 0x20,
102   GDK_GL_X_VISUAL_TYPE              = 0x22,
103   GDK_GL_TRANSPARENT_TYPE           = 0x23,
104   GDK_GL_TRANSPARENT_INDEX_VALUE    = 0x24,
105   GDK_GL_TRANSPARENT_RED_VALUE      = 0x25,
106   GDK_GL_TRANSPARENT_GREEN_VALUE    = 0x26,
107   GDK_GL_TRANSPARENT_BLUE_VALUE     = 0x27,
108   GDK_GL_TRANSPARENT_ALPHA_VALUE    = 0x28,
109   GDK_GL_DRAWABLE_TYPE              = 0x8010,
110   GDK_GL_RENDER_TYPE                = 0x8011,
111   GDK_GL_X_RENDERABLE               = 0x8012,
112   GDK_GL_FBCONFIG_ID                = 0x8013,
113   GDK_GL_MAX_PBUFFER_WIDTH          = 0x8016,
114   GDK_GL_MAX_PBUFFER_HEIGHT         = 0x8017,
115   GDK_GL_MAX_PBUFFER_PIXELS         = 0x8018,
116   GDK_GL_VISUAL_ID                  = 0x800B,
117   GDK_GL_SCREEN                     = 0x800C,
118 
119   /*
120    * Multisampling configuration attributes.
121    * [ GLX 1.4 and later ]
122    */
123   GDK_GL_SAMPLE_BUFFERS             = 100000,
124   GDK_GL_SAMPLES                    = 100001
125 
126 } GdkGLConfigAttrib;
127 
128 /*
129  * Generic "don't care" value.
130  * [ GLX 1.3 and later ]
131  */
132 #define GDK_GL_DONT_CARE              0xFFFFFFFF
133 
134 /*
135  * "none" value.
136  * [ GLX 1.3 and later ]
137  */
138 #define GDK_GL_NONE                   0x8000
139 
140 /*
141  * GLX_CONFIG_CAVEAT attribute values.
142  * [ GLX 1.3 and later ]
143  */
144 typedef enum
145 {
146   GDK_GL_CONFIG_CAVEAT_DONT_CARE    = 0xFFFFFFFF, /* GDK_GL_DONT_CARE */
147   GDK_GL_CONFIG_CAVEAT_NONE         = 0x8000,     /* GDK_GL_NONE */
148   GDK_GL_SLOW_CONFIG                = 0x8001,
149   GDK_GL_NON_CONFORMANT_CONFIG      = 0x800D
150 } GdkGLConfigCaveat;
151 
152 /*
153  * GLX_X_VISUAL_TYPE attribute values.
154  * [ GLX 1.3 and later ]
155  */
156 typedef enum
157 {
158   GDK_GL_VISUAL_TYPE_DONT_CARE      = 0xFFFFFFFF, /* GDK_GL_DONT_CARE */
159   GDK_GL_TRUE_COLOR                 = 0x8002,
160   GDK_GL_DIRECT_COLOR               = 0x8003,
161   GDK_GL_PSEUDO_COLOR               = 0x8004,
162   GDK_GL_STATIC_COLOR               = 0x8005,
163   GDK_GL_GRAY_SCALE                 = 0x8006,
164   GDK_GL_STATIC_GRAY                = 0x8007
165 } GdkGLVisualType;
166 
167 /*
168  * GLX_TRANSPARENT_TYPE attribute values.
169  * [ GLX 1.3 and later ]
170  */
171 typedef enum
172 {
173   GDK_GL_TRANSPARENT_NONE           = 0x8000, /* GDK_GL_NONE */
174   GDK_GL_TRANSPARENT_RGB            = 0x8008,
175   GDK_GL_TRANSPARENT_INDEX          = 0x8009
176 } GdkGLTransparentType;
177 
178 /*
179  * GLX_DRAWABLE_TYPE bits.
180  * [ GLX 1.3 and later ]
181  */
182 typedef enum
183 {
184   GDK_GL_WINDOW_BIT                 = 1 << 0, /* 0x00000001 */
185   GDK_GL_PIXMAP_BIT                 = 1 << 1, /* 0x00000002 */
186   GDK_GL_PBUFFER_BIT                = 1 << 2  /* 0x00000004 */
187 } GdkGLDrawableTypeMask;
188 
189 /*
190  * GLX_RENDER_TYPE bits.
191  * [ GLX 1.3 and later ]
192  */
193 typedef enum
194 {
195   GDK_GL_RGBA_BIT                   = 1 << 0, /* 0x00000001 */
196   GDK_GL_COLOR_INDEX_BIT            = 1 << 1  /* 0x00000002 */
197 } GdkGLRenderTypeMask;
198 
199 /*
200  * Buffer mask bits.
201  * [ GLX 1.3 and later ]
202  */
203 typedef enum
204 {
205   GDK_GL_FRONT_LEFT_BUFFER_BIT      = 1 << 0, /* 0x00000001 */
206   GDK_GL_FRONT_RIGHT_BUFFER_BIT     = 1 << 1, /* 0x00000002 */
207   GDK_GL_BACK_LEFT_BUFFER_BIT       = 1 << 2, /* 0x00000004 */
208   GDK_GL_BACK_RIGHT_BUFFER_BIT      = 1 << 3, /* 0x00000008 */
209   GDK_GL_AUX_BUFFERS_BIT            = 1 << 4, /* 0x00000010 */
210   GDK_GL_DEPTH_BUFFER_BIT           = 1 << 5, /* 0x00000020 */
211   GDK_GL_STENCIL_BUFFER_BIT         = 1 << 6, /* 0x00000040 */
212   GDK_GL_ACCUM_BUFFER_BIT           = 1 << 7  /* 0x00000080 */
213 } GdkGLBufferMask;
214 
215 /*
216  * Error return values from glXGetConfig.  Success is indicated by
217  * a value of 0.
218  */
219 typedef enum
220 {
221   GDK_GL_BAD_SCREEN                 = 1, /* screen # is bad */
222   GDK_GL_BAD_ATTRIBUTE              = 2, /* attribute to get is bad */
223   GDK_GL_NO_EXTENSION               = 3, /* no glx extension on server */
224   GDK_GL_BAD_VISUAL                 = 4, /* visual # not known by GLX */
225   GDK_GL_BAD_CONTEXT                = 5, /* returned only by import_context EXT? */
226   GDK_GL_BAD_VALUE                  = 6, /* returned only by glXSwapIntervalSGI? */
227   GDK_GL_BAD_ENUM                   = 7  /* unused? */
228 } GdkGLConfigError;
229 
230 /*
231  * glXCreateNewContext render_type attribute values.
232  * [ GLX 1.3 and later ]
233  */
234 typedef enum
235 {
236   GDK_GL_RGBA_TYPE                  = 0x8014,
237   GDK_GL_COLOR_INDEX_TYPE           = 0x8015
238 } GdkGLRenderType;
239 
240 /*
241  * glXQueryDrawable attributes.
242  * [ GLX 1.3 and later ]
243  */
244 typedef enum
245 {
246   GDK_GL_PRESERVED_CONTENTS         = 0x801B,
247   GDK_GL_LARGEST_PBUFFER            = 0x801C,
248   GDK_GL_WIDTH                      = 0x801D,
249   GDK_GL_HEIGHT                     = 0x801E,
250   GDK_GL_EVENT_MASK                 = 0x801F
251 } GdkGLDrawableAttrib;
252 
253 /*
254  * glXCreatePbuffer attributes.
255  * [ GLX 1.3 and later ]
256  */
257 typedef enum
258 {
259   GDK_GL_PBUFFER_PRESERVED_CONTENTS = 0x801B, /* GDK_GL_PRESERVED_CONTENTS */
260   GDK_GL_PBUFFER_LARGEST_PBUFFER    = 0x801C, /* GDK_GL_LARGEST_PBUFFER */
261   GDK_GL_PBUFFER_HEIGHT             = 0x8040,
262   GDK_GL_PBUFFER_WIDTH              = 0x8041
263 } GdkGLPbufferAttrib;
264 
265 /*
266  * glXSelectEvent event mask bits.
267  * [ GLX 1.3 and later ]
268  */
269 typedef enum
270 {
271   GDK_GL_PBUFFER_CLOBBER_MASK       = 1 << 27  /* 0x08000000 */
272 } GdkGLEventMask;
273 
274 /*
275  * GLXPbufferClobberEvent event_type values.
276  * [ GLX 1.3 and later ]
277  */
278 typedef enum
279 {
280   GDK_GL_DAMAGED                    = 0x8020,
281   GDK_GL_SAVED                      = 0x8021
282 } GdkGLEventType;
283 
284 /*
285  * GLXPbufferClobberEvent draw_type values.
286  * [ GLX 1.3 and later ]
287  */
288 typedef enum
289 {
290   GDK_GL_WINDOW                     = 0x8022,
291   GDK_GL_PBUFFER                    = 0x8023
292 } GdkGLDrawableType;
293 
294 #ifdef __cplusplus
295 }
296 #endif /* __cplusplus */
297 
298 #endif /* __GDK_GL_TOKENS_H__ */
299