Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
C/glue/gl.h
1 #ifndef COIN_GLUE_GL_H
2 #define COIN_GLUE_GL_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 /* Documentation for the cc_glglue OpenGL wrapper abstraction
37  interface can be found at the top of the Coin/src/glue/gl.cpp source
38  code file. */
39 
40 /* ********************************************************************** */
41 
42 #include <Inventor/system/gl.h>
43 #include <Inventor/C/basic.h>
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48 
49 #if 0 /* to get proper auto-indentation in emacs */
50 }
51 #endif /* emacs indentation */
52 
53 /* ********************************************************************** */
54 
55 /* Pre-declare this. Actual definition of struct is hidden in
56  implementation. Client code must treat structure as opaque. */
57 typedef struct cc_glglue cc_glglue;
58 
59 /* ********************************************************************** */
60 
61 
62 /* Singleton functions for getting hold of cc_glglue instance for
63  context. ***/
64 
65 /*
66  Returns the glue instance for the given context ID.
67 
68  The context ID can be any number chosen to match the current OpenGL
69  context in a _unique_ manner (this is important!).
70 
71  (Note: internally in Coin, we use the context ids defined by
72  SoGLCacheContextElement. Make sure context ids from external code
73  doesn't crash with those.)
74 */
75 COIN_DLL_API const cc_glglue * cc_glglue_instance(int contextid);
76 
77 /*** General interface. ***********************************************/
78 
79 /*
80  Fetch version number information for the underlying OpenGL
81  implementation.
82 */
83 COIN_DLL_API void cc_glglue_glversion(const cc_glglue * glue,
84  unsigned int * major,
85  unsigned int * minor,
86  unsigned int * release);
87 
88 /*
89  Returns TRUE if the OpenGL implementation of the wrapper context is
90  at least as "late" as what is given with the input
91  arguments. Otherwise returns FALSE.
92 */
93 COIN_DLL_API SbBool cc_glglue_glversion_matches_at_least(const cc_glglue * glue,
94  unsigned int major,
95  unsigned int minor,
96  unsigned int release);
97 
98 /*
99  Returns TRUE if the GLX implementation of the wrapper context is at
100  least as "late" as what is given with the input arguments. Otherwise
101  returns FALSE.
102 */
103 COIN_DLL_API SbBool cc_glglue_glxversion_matches_at_least(const cc_glglue * glue,
104  int major,
105  int minor);
106 /*
107  Returns TRUE if the given extension is supported by this context,
108  FALSE if not.
109 */
110 COIN_DLL_API SbBool cc_glglue_glext_supported(const cc_glglue * glue, const char * extname);
111 
112 /*
113  Returns address of the symbol (usually a function) named by
114  "symname".
115 
116  Note that you should also check that the extension(s) needed are
117  properly defined before using the symbol, as a symbol can be present
118  in a GL library without being implemented, or being partly
119  implemented, or being implemented but not active for your particular
120  hardware card (for "unified" drivers from vendors with many
121  different types or generations of graphics cards).
122  */
123 COIN_DLL_API void * cc_glglue_getprocaddress(const cc_glglue * glue, const char * symname);
124 
125 /* Returns TRUE if rendering is done directly on the display (ie not
126  through any software indirection layer over GLX). */
127 COIN_DLL_API SbBool cc_glglue_isdirect(const cc_glglue * w);
128 
129 
130 /*** Wrapped OpenGL 1.1+ features and extensions. *********************/
131 
132 /* Z-buffer offsetting ***/
133 
134 COIN_DLL_API SbBool cc_glglue_has_polygon_offset(const cc_glglue * glue);
135 /* Bitflags for the last argument of cc_glglue_glPolygonOffsetEnable(). */
136 enum cc_glglue_Primitives { cc_glglue_FILLED = 1 << 0,
137  cc_glglue_LINES = 1 << 1,
138  cc_glglue_POINTS = 1 << 2 };
139 COIN_DLL_API void cc_glglue_glPolygonOffsetEnable(const cc_glglue * glue,
140  SbBool enable, int m);
141 COIN_DLL_API void cc_glglue_glPolygonOffset(const cc_glglue * glue,
142  GLfloat factor,
143  GLfloat units);
144 
145 /* Texture objects ***/
146 
147 COIN_DLL_API SbBool cc_glglue_has_texture_objects(const cc_glglue * glue);
148 COIN_DLL_API void cc_glglue_glGenTextures(const cc_glglue * glue,
149  GLsizei n,
150  GLuint *textures);
151 COIN_DLL_API void cc_glglue_glBindTexture(const cc_glglue * glue,
152  GLenum target,
153  GLuint texture);
154 COIN_DLL_API void cc_glglue_glDeleteTextures(const cc_glglue * glue,
155  GLsizei n,
156  const GLuint * textures);
157 
158 /* 3D textures ***/
159 
160 COIN_DLL_API SbBool cc_glglue_has_3d_textures(const cc_glglue * glue);
161 COIN_DLL_API void cc_glglue_glTexImage3D(const cc_glglue * glue,
162  GLenum target,
163  GLint level,
164  GLenum internalformat,
165  GLsizei width,
166  GLsizei height,
167  GLsizei depth,
168  GLint border,
169  GLenum format,
170  GLenum type,
171  const GLvoid *pixels);
172 COIN_DLL_API void cc_glglue_glTexSubImage3D(const cc_glglue * glue,
173  GLenum target,
174  GLint level,
175  GLint xoffset,
176  GLint yoffset,
177  GLint zoffset,
178  GLsizei width,
179  GLsizei height,
180  GLsizei depth,
181  GLenum format,
182  GLenum type,
183  const GLvoid * pixels);
184 COIN_DLL_API void cc_glglue_glCopyTexSubImage3D(const cc_glglue * glue,
185  GLenum target,
186  GLint level,
187  GLint xoffset,
188  GLint yoffset,
189  GLint zoffset,
190  GLint x,
191  GLint y,
192  GLsizei width,
193  GLsizei height);
194 
195 /* Multi-texturing ***/
196 
197 COIN_DLL_API SbBool cc_glglue_has_multitexture(const cc_glglue * glue);
198 COIN_DLL_API void cc_glglue_glMultiTexCoord2f(const cc_glglue * glue,
199  GLenum target,
200  GLfloat s,
201  GLfloat t);
202 COIN_DLL_API void cc_glglue_glMultiTexCoord2fv(const cc_glglue * glue,
203  GLenum target,
204  const GLfloat * v);
205 COIN_DLL_API void cc_glglue_glMultiTexCoord3fv(const cc_glglue * glue,
206  GLenum target,
207  const GLfloat * v);
208 COIN_DLL_API void cc_glglue_glMultiTexCoord4fv(const cc_glglue * glue,
209  GLenum target,
210  const GLfloat * v);
211 
212 COIN_DLL_API void cc_glglue_glActiveTexture(const cc_glglue * glue,
213  GLenum texture);
214 COIN_DLL_API void cc_glglue_glClientActiveTexture(const cc_glglue * glue,
215  GLenum texture);
216 
217 /* Sub-texture operations ***/
218 
219 COIN_DLL_API SbBool cc_glglue_has_texsubimage(const cc_glglue * glue);
220 COIN_DLL_API void cc_glglue_glTexSubImage2D(const cc_glglue * glue,
221  GLenum target,
222  GLint level,
223  GLint xoffset,
224  GLint yoffset,
225  GLsizei width,
226  GLsizei height,
227  GLenum format,
228  GLenum type,
229  const GLvoid * pixels);
230 
231 /* Misc texture operations ***/
232 
233 COIN_DLL_API SbBool cc_glglue_has_2d_proxy_textures(const cc_glglue * glue);
234 
235 COIN_DLL_API SbBool cc_glglue_has_texture_edge_clamp(const cc_glglue * glue);
236 
237 COIN_DLL_API void cc_glglue_glPushClientAttrib(const cc_glglue * glue, GLbitfield mask);
238 COIN_DLL_API void cc_glglue_glPopClientAttrib(const cc_glglue * glue);
239 
240 
241 /* Texture compression ***/
242 
243 COIN_DLL_API SbBool cc_glue_has_texture_compression(const cc_glglue * glue);
244 
245 COIN_DLL_API void cc_glglue_glCompressedTexImage3D(const cc_glglue * glue,
246  GLenum target,
247  GLint level,
248  GLenum internalformat,
249  GLsizei width,
250  GLsizei height,
251  GLsizei depth,
252  GLint border,
253  GLsizei imageSize,
254  const GLvoid * data);
255 COIN_DLL_API void cc_glglue_glCompressedTexImage2D(const cc_glglue * glue,
256  GLenum target,
257  GLint level,
258  GLenum internalformat,
259  GLsizei width,
260  GLsizei height,
261  GLint border,
262  GLsizei imageSize,
263  const GLvoid *data);
264 COIN_DLL_API void cc_glglue_glCompressedTexImage1D(const cc_glglue * glue,
265  GLenum target,
266  GLint level,
267  GLenum internalformat,
268  GLsizei width,
269  GLint border,
270  GLsizei imageSize,
271  const GLvoid *data);
272 COIN_DLL_API void cc_glglue_glCompressedTexSubImage3D(const cc_glglue * glue,
273  GLenum target,
274  GLint level,
275  GLint xoffset,
276  GLint yoffset,
277  GLint zoffset,
278  GLsizei width,
279  GLsizei height,
280  GLsizei depth,
281  GLenum format,
282  GLsizei imageSize,
283  const GLvoid *data);
284 COIN_DLL_API void cc_glglue_glCompressedTexSubImage2D(const cc_glglue * glue,
285  GLenum target,
286  GLint level,
287  GLint xoffset,
288  GLint yoffset,
289  GLsizei width,
290  GLsizei height,
291  GLenum format,
292  GLsizei imageSize,
293  const GLvoid *data);
294 COIN_DLL_API void cc_glglue_glCompressedTexSubImage1D(const cc_glglue * glue,
295  GLenum target,
296  GLint level,
297  GLint xoffset,
298  GLsizei width,
299  GLenum format,
300  GLsizei imageSize,
301  const GLvoid *data);
302 COIN_DLL_API void cc_glglue_glGetCompressedTexImage(const cc_glglue * glue,
303  GLenum target,
304  GLint level,
305  void *img);
306 
307 
308 /* Palette textures ***/
309 
310 COIN_DLL_API SbBool cc_glglue_has_color_tables(const cc_glglue * glue);
311 COIN_DLL_API SbBool cc_glglue_has_color_subtables(const cc_glglue * glue);
312 /* TRUE from the next check also guarantees that the two color table
313  checks above returns TRUE. */
314 COIN_DLL_API SbBool cc_glglue_has_paletted_textures(const cc_glglue * glue);
315 
316 COIN_DLL_API void cc_glglue_glColorTable(const cc_glglue * glue,
317  GLenum target,
318  GLenum internalFormat,
319  GLsizei width,
320  GLenum format,
321  GLenum type,
322  const GLvoid *table);
323 COIN_DLL_API void cc_glglue_glColorSubTable(const cc_glglue * glue,
324  GLenum target,
325  GLsizei start,
326  GLsizei count,
327  GLenum format,
328  GLenum type,
329  const GLvoid * data);
330 COIN_DLL_API void cc_glglue_glGetColorTable(const cc_glglue * glue,
331  GLenum target,
332  GLenum format,
333  GLenum type,
334  GLvoid *data);
335 COIN_DLL_API void cc_glglue_glGetColorTableParameteriv(const cc_glglue * glue,
336  GLenum target,
337  GLenum pname,
338  GLint *params);
339 COIN_DLL_API void cc_glglue_glGetColorTableParameterfv(const cc_glglue * glue,
340  GLenum target,
341  GLenum pname,
342  GLfloat *params);
343 
344 
345 /* Texture blending settings ***/
346 
347 COIN_DLL_API SbBool cc_glglue_has_blendequation(const cc_glglue * glue);
348 COIN_DLL_API void cc_glglue_glBlendEquation(const cc_glglue * glue, GLenum mode);
349 
350 /* Texture blend separate */
351 COIN_DLL_API SbBool cc_glglue_has_blendfuncseparate(const cc_glglue * glue);
352 COIN_DLL_API void cc_glglue_glBlendFuncSeparate(const cc_glglue * glue,
353  GLenum srgb, GLenum drgb,
354  GLenum salpha, GLenum dalpha);
355 
356 /* OpenGL vertex array ***/
357 
358 COIN_DLL_API SbBool cc_glglue_has_vertex_array(const cc_glglue * glue);
359 COIN_DLL_API void cc_glglue_glVertexPointer(const cc_glglue * glue,
360  GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
361 COIN_DLL_API void cc_glglue_glTexCoordPointer(const cc_glglue * glue,
362  GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
363 COIN_DLL_API void cc_glglue_glNormalPointer(const cc_glglue * glue,
364  GLenum type, GLsizei stride, const GLvoid *pointer);
365 COIN_DLL_API void cc_glglue_glColorPointer(const cc_glglue * glue,
366  GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
367 COIN_DLL_API void cc_glglue_glIndexPointer (const cc_glglue * glue,
368  GLenum type, GLsizei stride, const GLvoid * pointer);
369 COIN_DLL_API void cc_glglue_glEnableClientState(const cc_glglue * glue, GLenum array);
370 COIN_DLL_API void cc_glglue_glDisableClientState(const cc_glglue * glue, GLenum array);
371 COIN_DLL_API void cc_glglue_glInterleavedArrays(const cc_glglue * glue,
372  GLenum format, GLsizei stride, const GLvoid * pointer);
373 COIN_DLL_API void cc_glglue_glDrawArrays(const cc_glglue * glue,
374  GLenum mode, GLint first, GLsizei count);
375 COIN_DLL_API void cc_glglue_glDrawElements(const cc_glglue * glue,
376  GLenum mode, GLsizei count, GLenum type, const GLvoid * indices);
377 COIN_DLL_API void cc_glglue_glDrawRangeElements(const cc_glglue * glue,
378  GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
379 COIN_DLL_API void cc_glglue_glArrayElement(const cc_glglue * glue, GLint i);
380 
381 COIN_DLL_API int cc_glglue_max_texture_units(const cc_glglue * glue);
382 COIN_DLL_API int cc_glglue_has_multidraw_vertex_arrays(const cc_glglue * glue);
383 
384 COIN_DLL_API void cc_glglue_glMultiDrawArrays(const cc_glglue * glue, GLenum mode, const GLint * first,
385  const GLsizei * count, GLsizei primcount);
386 COIN_DLL_API void cc_glglue_glMultiDrawElements(const cc_glglue * glue, GLenum mode, const GLsizei * count,
387  GLenum type, const GLvoid ** indices, GLsizei primcount);
388 
389 /* NV_vertex_array_range */
390 COIN_DLL_API SbBool cc_glglue_has_nv_vertex_array_range(const cc_glglue * glue);
391 COIN_DLL_API void cc_glglue_glFlushVertexArrayRangeNV(const cc_glglue * glue);
392 COIN_DLL_API void cc_glglue_glVertexArrayRangeNV(const cc_glglue * glue, GLsizei size, const GLvoid * pointer);
393 COIN_DLL_API void * cc_glglue_glAllocateMemoryNV(const cc_glglue * glue,
394  GLsizei size, GLfloat readfreq,
395  GLfloat writefreq, GLfloat priority);
396 COIN_DLL_API void cc_glglue_glFreeMemoryNV(const cc_glglue * glue, GLvoid * buffer);
397 
398 /* ARB_vertex_buffer_object */
399 COIN_DLL_API SbBool cc_glglue_has_vertex_buffer_object(const cc_glglue * glue);
400 COIN_DLL_API void cc_glglue_glBindBuffer(const cc_glglue * glue, GLenum target, GLuint buffer);
401 COIN_DLL_API void cc_glglue_glDeleteBuffers(const cc_glglue * glue, GLsizei n, const GLuint *buffers);
402 COIN_DLL_API void cc_glglue_glGenBuffers(const cc_glglue * glue, GLsizei n, GLuint *buffers);
403 COIN_DLL_API GLboolean cc_glglue_glIsBuffer(const cc_glglue * glue, GLuint buffer);
404 COIN_DLL_API void cc_glglue_glBufferData(const cc_glglue * glue,
405  GLenum target,
406  intptr_t size, /* 64 bit on 64 bit systems */
407  const GLvoid *data,
408  GLenum usage);
409 COIN_DLL_API void cc_glglue_glBufferSubData(const cc_glglue * glue,
410  GLenum target,
411  intptr_t offset, /* 64 bit */
412  intptr_t size, /* 64 bit */
413  const GLvoid * data);
414 COIN_DLL_API void cc_glglue_glGetBufferSubData(const cc_glglue * glue,
415  GLenum target,
416  intptr_t offset, /* 64 bit */
417  intptr_t size, /* 64 bit */
418  GLvoid *data);
419 COIN_DLL_API GLvoid * cc_glglue_glMapBuffer(const cc_glglue * glue,
420  GLenum target, GLenum access);
421 COIN_DLL_API GLboolean cc_glglue_glUnmapBuffer(const cc_glglue * glue,
422  GLenum target);
423 COIN_DLL_API void cc_glglue_glGetBufferParameteriv(const cc_glglue * glue,
424  GLenum target,
425  GLenum pname,
426  GLint * params);
427 COIN_DLL_API void cc_glglue_glGetBufferPointerv(const cc_glglue * glue,
428  GLenum target,
429  GLenum pname,
430  GLvoid ** params);
431 
432 /* GL_ARB_fragment_program */
433 COIN_DLL_API SbBool cc_glglue_has_arb_fragment_program(const cc_glglue * glue);
434 COIN_DLL_API void cc_glglue_glProgramString(const cc_glglue * glue, GLenum target, GLenum format,
435  GLsizei len, const GLvoid *string);
436 COIN_DLL_API void cc_glglue_glBindProgram(const cc_glglue * glue, GLenum target,
437  GLuint program);
438 COIN_DLL_API void cc_glglue_glDeletePrograms(const cc_glglue * glue, GLsizei n,
439  const GLuint *programs);
440 COIN_DLL_API void cc_glglue_glGenPrograms(const cc_glglue * glue, GLsizei n, GLuint *programs);
441 COIN_DLL_API void cc_glglue_glProgramEnvParameter4d(const cc_glglue * glue, GLenum target,
442  GLuint index, GLdouble x, GLdouble y,
443  GLdouble z, GLdouble w);
444 COIN_DLL_API void cc_glglue_glProgramEnvParameter4dv(const cc_glglue * glue, GLenum target,
445  GLuint index, const GLdouble *params);
446 COIN_DLL_API void cc_glglue_glProgramEnvParameter4f(const cc_glglue * glue, GLenum target,
447  GLuint index, GLfloat x,
448  GLfloat y, GLfloat z,
449  GLfloat w);
450 COIN_DLL_API void cc_glglue_glProgramEnvParameter4fv(const cc_glglue * glue, GLenum target,
451  GLuint index, const GLfloat *params);
452 COIN_DLL_API void cc_glglue_glProgramLocalParameter4d(const cc_glglue * glue, GLenum target,
453  GLuint index, GLdouble x,
454  GLdouble y, GLdouble z,
455  GLdouble w);
456 COIN_DLL_API void cc_glglue_glProgramLocalParameter4dv(const cc_glglue * glue, GLenum target,
457  GLuint index, const GLdouble *params);
458 COIN_DLL_API void cc_glglue_glProgramLocalParameter4f(const cc_glglue * glue, GLenum target,
459  GLuint index, GLfloat x, GLfloat y,
460  GLfloat z, GLfloat w);
461 COIN_DLL_API void cc_glglue_glProgramLocalParameter4fv(const cc_glglue * glue, GLenum target,
462  GLuint index, const GLfloat *params);
463 COIN_DLL_API void cc_glglue_glGetProgramEnvParameterdv(const cc_glglue * glue, GLenum target,
464  GLuint index, GLdouble *params);
465 COIN_DLL_API void cc_glglue_glGetProgramEnvParameterfv(const cc_glglue * glue, GLenum target,
466  GLuint index, GLfloat *params);
467 COIN_DLL_API void cc_glglue_glGetProgramLocalParameterdv(const cc_glglue * glue, GLenum target,
468  GLuint index, GLdouble *params);
469 COIN_DLL_API void cc_glglue_glGetProgramLocalParameterfv(const cc_glglue * glue, GLenum target,
470  GLuint index, GLfloat *params);
471 COIN_DLL_API void cc_glglue_glGetProgramiv(const cc_glglue * glue, GLenum target,
472  GLenum pname, GLint *params);
473 COIN_DLL_API void cc_glglue_glGetProgramString(const cc_glglue * glue, GLenum target,
474  GLenum pname, GLvoid *string);
475 COIN_DLL_API SbBool cc_glglue_glIsProgram(const cc_glglue * glue, GLuint program);
476 
477 /* ARB_vertex_program */
478 COIN_DLL_API SbBool cc_glglue_has_arb_vertex_program(const cc_glglue * glue);
479 COIN_DLL_API void cc_glglue_glVertexAttrib1s(const cc_glglue * glue, GLuint index, GLshort x);
480 COIN_DLL_API void cc_glglue_glVertexAttrib1f(const cc_glglue * glue, GLuint index, GLfloat x);
481 COIN_DLL_API void cc_glglue_glVertexAttrib1d(const cc_glglue * glue, GLuint index, GLdouble x);
482 COIN_DLL_API void cc_glglue_glVertexAttrib2s(const cc_glglue * glue, GLuint index, GLshort x, GLshort y);
483 COIN_DLL_API void cc_glglue_glVertexAttrib2f(const cc_glglue * glue, GLuint index, GLfloat x, GLfloat y);
484 COIN_DLL_API void cc_glglue_glVertexAttrib2d(const cc_glglue * glue, GLuint index, GLdouble x, GLdouble y);
485 COIN_DLL_API void cc_glglue_glVertexAttrib3s(const cc_glglue * glue, GLuint index,
486  GLshort x, GLshort y, GLshort z);
487 COIN_DLL_API void cc_glglue_glVertexAttrib3f(const cc_glglue * glue, GLuint index,
488  GLfloat x, GLfloat y, GLfloat z);
489 COIN_DLL_API void cc_glglue_glVertexAttrib3d(const cc_glglue * glue, GLuint index,
490  GLdouble x, GLdouble y, GLdouble z);
491 COIN_DLL_API void cc_glglue_glVertexAttrib4s(const cc_glglue * glue, GLuint index, GLshort x,
492  GLshort y, GLshort z, GLshort w);
493 COIN_DLL_API void cc_glglue_glVertexAttrib4f(const cc_glglue * glue, GLuint index, GLfloat x,
494  GLfloat y, GLfloat z, GLfloat w);
495 COIN_DLL_API void cc_glglue_glVertexAttrib4d(const cc_glglue * glue, GLuint index, GLdouble x,
496  GLdouble y, GLdouble z, GLdouble w);
497 COIN_DLL_API void cc_glglue_glVertexAttrib4Nub(const cc_glglue * glue, GLuint index, GLubyte x,
498  GLubyte y, GLubyte z, GLubyte w);
499 COIN_DLL_API void cc_glglue_glVertexAttrib1sv(const cc_glglue * glue, GLuint index, const GLshort *v);
500 COIN_DLL_API void cc_glglue_glVertexAttrib1fv(const cc_glglue * glue, GLuint index, const GLfloat *v);
501 COIN_DLL_API void cc_glglue_glVertexAttrib1dv(const cc_glglue * glue, GLuint index, const GLdouble *v);
502 COIN_DLL_API void cc_glglue_glVertexAttrib2sv(const cc_glglue * glue, GLuint index, const GLshort *v);
503 COIN_DLL_API void cc_glglue_glVertexAttrib2fv(const cc_glglue * glue, GLuint index, const GLfloat *v);
504 COIN_DLL_API void cc_glglue_glVertexAttrib2dv(const cc_glglue * glue, GLuint index, const GLdouble *v);
505 COIN_DLL_API void cc_glglue_glVertexAttrib3sv(const cc_glglue * glue, GLuint index, const GLshort *v);
506 COIN_DLL_API void cc_glglue_glVertexAttrib3fv(const cc_glglue * glue, GLuint index, const GLfloat *v);
507 COIN_DLL_API void cc_glglue_glVertexAttrib3dv(const cc_glglue * glue, GLuint index, const GLdouble *v);
508 COIN_DLL_API void cc_glglue_glVertexAttrib4bv(const cc_glglue * glue, GLuint index, const GLbyte *v);
509 COIN_DLL_API void cc_glglue_glVertexAttrib4sv(const cc_glglue * glue, GLuint index, const GLshort *v);
510 COIN_DLL_API void cc_glglue_glVertexAttrib4iv(const cc_glglue * glue, GLuint index, const GLint *v);
511 COIN_DLL_API void cc_glglue_glVertexAttrib4ubv(const cc_glglue * glue, GLuint index, const GLubyte *v);
512 COIN_DLL_API void cc_glglue_glVertexAttrib4usv(const cc_glglue * glue, GLuint index, const GLushort *v);
513 COIN_DLL_API void cc_glglue_glVertexAttrib4uiv(const cc_glglue * glue, GLuint index, const GLuint *v);
514 COIN_DLL_API void cc_glglue_glVertexAttrib4fv(const cc_glglue * glue, GLuint index, const GLfloat *v);
515 COIN_DLL_API void cc_glglue_glVertexAttrib4dv(const cc_glglue * glue, GLuint index, const GLdouble *v);
516 COIN_DLL_API void cc_glglue_glVertexAttrib4Nbv(const cc_glglue * glue, GLuint index, const GLbyte *v);
517 COIN_DLL_API void cc_glglue_glVertexAttrib4Nsv(const cc_glglue * glue, GLuint index, const GLshort *v);
518 COIN_DLL_API void cc_glglue_glVertexAttrib4Niv(const cc_glglue * glue, GLuint index, const GLint *v);
519 COIN_DLL_API void cc_glglue_glVertexAttrib4Nubv(const cc_glglue * glue, GLuint index, const GLubyte *v);
520 COIN_DLL_API void cc_glglue_glVertexAttrib4Nusv(const cc_glglue * glue, GLuint index, const GLushort *v);
521 COIN_DLL_API void cc_glglue_glVertexAttrib4Nuiv(const cc_glglue * glue, GLuint index, const GLuint *v);
522 COIN_DLL_API void cc_glglue_glVertexAttribPointer(const cc_glglue * glue, GLuint index, GLint size,
523  GLenum type, GLboolean normalized, GLsizei stride,
524  const GLvoid *pointer);
525 COIN_DLL_API void cc_glglue_glEnableVertexAttribArray(const cc_glglue * glue, GLuint index);
526 COIN_DLL_API void cc_glglue_glDisableVertexAttribArray(const cc_glglue * glue, GLuint index);
527 COIN_DLL_API void cc_glglue_glGetVertexAttribdv(const cc_glglue * glue, GLuint index, GLenum pname,
528  GLdouble *params);
529 COIN_DLL_API void cc_glglue_glGetVertexAttribfv(const cc_glglue * glue, GLuint index, GLenum pname,
530  GLfloat *params);
531 COIN_DLL_API void cc_glglue_glGetVertexAttribiv(const cc_glglue * glue, GLuint index, GLenum pname,
532  GLint *params);
533 COIN_DLL_API void cc_glglue_glGetVertexAttribPointerv(const cc_glglue * glue, GLuint index, GLenum pname,
534  GLvoid **pointer);
535 
536 /* ARB_vertex_shader */
537 COIN_DLL_API SbBool cc_glglue_has_arb_vertex_shader(const cc_glglue * glue);
538 
539 /* ARB_occlusion_query */
540 COIN_DLL_API SbBool cc_glglue_has_occlusion_query(const cc_glglue * glue);
541 COIN_DLL_API void cc_glglue_glGenQueries(const cc_glglue * glue,
542  GLsizei n, GLuint * ids);
543 COIN_DLL_API void cc_glglue_glDeleteQueries(const cc_glglue * glue,
544  GLsizei n, const GLuint *ids);
545 COIN_DLL_API GLboolean cc_glglue_glIsQuery(const cc_glglue * glue,
546  GLuint id);
547 COIN_DLL_API void cc_glglue_glBeginQuery(const cc_glglue * glue,
548  GLenum target, GLuint id);
549 COIN_DLL_API void cc_glglue_glEndQuery(const cc_glglue * glue,
550  GLenum target);
551 COIN_DLL_API void cc_glglue_glGetQueryiv(const cc_glglue * glue,
552  GLenum target, GLenum pname,
553  GLint * params);
554 COIN_DLL_API void cc_glglue_glGetQueryObjectiv(const cc_glglue * glue,
555  GLuint id, GLenum pname,
556  GLint * params);
557 COIN_DLL_API void cc_glglue_glGetQueryObjectuiv(const cc_glglue * glue,
558  GLuint id, GLenum pname,
559  GLuint * params);
560 
561 /* framebuffer_object */
562 COIN_DLL_API void cc_glglue_glIsRenderbuffer(const cc_glglue * glue, GLuint renderbuffer);
563 COIN_DLL_API void cc_glglue_glBindRenderbuffer(const cc_glglue * glue, GLenum target, GLuint renderbuffer);
564 COIN_DLL_API void cc_glglue_glDeleteRenderbuffers(const cc_glglue * glue, GLsizei n, const GLuint *renderbuffers);
565 COIN_DLL_API void cc_glglue_glGenRenderbuffers(const cc_glglue * glue, GLsizei n, GLuint *renderbuffers);
566 COIN_DLL_API void cc_glglue_glRenderbufferStorage(const cc_glglue * glue, GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
567 COIN_DLL_API void cc_glglue_glGetRenderbufferParameteriv(const cc_glglue * glue, GLenum target, GLenum pname, GLint *params);
568 COIN_DLL_API GLboolean cc_glglue_glIsFramebuffer(const cc_glglue * glue, GLuint framebuffer);
569 COIN_DLL_API void cc_glglue_glBindFramebuffer(const cc_glglue * glue, GLenum target, GLuint framebuffer);
570 COIN_DLL_API void cc_glglue_glDeleteFramebuffers(const cc_glglue * glue, GLsizei n, const GLuint *framebuffers);
571 COIN_DLL_API void cc_glglue_glGenFramebuffers(const cc_glglue * glue, GLsizei n, GLuint *framebuffers);
572 COIN_DLL_API GLenum cc_glglue_glCheckFramebufferStatus(const cc_glglue * glue, GLenum target);
573 COIN_DLL_API void cc_glglue_glFramebufferTexture1D(const cc_glglue * glue, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
574 COIN_DLL_API void cc_glglue_glFramebufferTexture2D(const cc_glglue * glue, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
575 COIN_DLL_API void cc_glglue_glFramebufferTexture3D(const cc_glglue * glue, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
576 COIN_DLL_API void cc_glglue_glFramebufferRenderbuffer(const cc_glglue * glue, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
577 COIN_DLL_API void cc_glglue_glGetFramebufferAttachmentParameteriv(const cc_glglue * glue, GLenum target, GLenum attachment, GLenum pname, GLint *params);
578 COIN_DLL_API void cc_glglue_glGenerateMipmap(const cc_glglue * glue, GLenum target);
579 COIN_DLL_API SbBool cc_glglue_has_framebuffer_objects(const cc_glglue * glue);
580 
581 
582 /* GL feature queries */
583 COIN_DLL_API SbBool cc_glglue_can_do_bumpmapping(const cc_glglue * glue);
584 COIN_DLL_API SbBool cc_glglue_can_do_sortedlayersblend(const cc_glglue * glue);
585 COIN_DLL_API SbBool cc_glglue_can_do_anisotropic_filtering(const cc_glglue * glue);
586 COIN_DLL_API SbBool cc_glglue_has_framebuffer_objects(const cc_glglue * glue);
587 
588 /* GL limits */
589 COIN_DLL_API int cc_glglue_get_max_lights(const cc_glglue * glue);
590 COIN_DLL_API const float * cc_glglue_get_line_width_range(const cc_glglue * glue);
591 COIN_DLL_API const float * cc_glglue_get_point_size_range(const cc_glglue * glue);
592 
593 COIN_DLL_API float cc_glglue_get_max_anisotropy(const cc_glglue * glue);
594 
595 /* ********************************************************************** */
596 
597 /* GLX extensions ***/
598 
599 COIN_DLL_API void * cc_glglue_glXGetCurrentDisplay(const cc_glglue * w);
600 
601 
602 /* ********************************************************************** */
603 
604 /* Offscreen buffer creation ***/
605 
606 /* Functions to make and handle offscreen contexts. The interface is a
607  common interface which provides an abstraction over the
608  system-specific implementations on GLX, WGL and AGL.
609 
610  It also hides whether or not hardware-acceleration is employed
611  (which is automatically done if the driver is found capable of
612  doing that.
613 
614  Note that these does not need a cc_glglue instance.
615 */
616 
617 COIN_DLL_API void cc_glglue_context_max_dimensions(unsigned int * width, unsigned int * height);
618 
619 COIN_DLL_API void * cc_glglue_context_create_offscreen(unsigned int width, unsigned int height);
620 COIN_DLL_API SbBool cc_glglue_context_make_current(void * ctx);
621 COIN_DLL_API void cc_glglue_context_reinstate_previous(void * ctx);
622 COIN_DLL_API void cc_glglue_context_destruct(void * ctx);
623 
624 COIN_DLL_API void cc_glglue_context_bind_pbuffer(void * ctx);
625 COIN_DLL_API void cc_glglue_context_release_pbuffer(void * ctx);
626 COIN_DLL_API SbBool cc_glglue_context_pbuffer_is_bound(void * ctx);
627 COIN_DLL_API SbBool cc_glglue_context_can_render_to_texture(void * ctx);
628 
629 /* This abomination is needed to support SoOffscreenRenderer::getDC(). */
630 COIN_DLL_API const void * cc_glglue_win32_HDC(void * ctx);
631 COIN_DLL_API void cc_glglue_win32_updateHDCBitmap(void * ctx);
632 
633 /* ********************************************************************** */
634 
635 /* Interface for setting external offscreen renderer functionality:
636  * Makes it possible to provide an external implementation for doing
637  * offscreen rendering (such as accelerated rendering into a hidden
638  * window). This is useful to avoid having to do slow software
639  * rendering when pBuffers cannot be used (not available on the
640  * system, buggy implementation, mismatch of onscreen context and
641  * offscreen context).
642  */
643 
644 typedef void * cc_glglue_offscreen_data;
645 
647  cc_glglue_offscreen_data (*create_offscreen)(unsigned int width, unsigned int height);
648  SbBool (*make_current)(cc_glglue_offscreen_data context);
649  void (*reinstate_previous)(cc_glglue_offscreen_data context);
650  void (*destruct)(cc_glglue_offscreen_data context);
652 
653 /* Set callback functions for external offscreen rendering. Pass NULL
654  to restore default, built-in offscreen rendering.
655  */
656 COIN_DLL_API void cc_glglue_context_set_offscreen_cb_functions(cc_glglue_offscreen_cb_functions* p);
657 
658 #ifdef __cplusplus
659 }
660 #endif /* __cplusplus */
661 
662 #endif /* !COIN_GLUE_GL_H */
Definition: C/glue/gl.h:646