0024975: Improve of preprocessor directives in header files to be equal to the file...
[occt.git] / src / OpenGl / OpenGl_GlCore11Fwd.hxx
1 // Created on: 2014-03-17
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef OpenGl_GlCore11Fwd_HeaderFile
17 #define OpenGl_GlCore11Fwd_HeaderFile
18
19 #include <OpenGl_GlFunctions.hxx>
20
21 //! OpenGL 1.1 core without deprecated Fixed Pipeline entry points.
22 //! Notice that all functions within this structure are actually exported by system GL library.
23 //! The main purpose for these hint - to control visibility of functions per GL version
24 //! (global functions should not be used directly to achieve this effect!).
25 struct OpenGl_GlCore11Fwd : protected OpenGl_GlFunctions
26 {
27
28 public: //! @name Miscellaneous
29
30   inline void glClearColor (GLclampf theRed, GLclampf theGreen, GLclampf theBlue, GLclampf theAlpha)
31   {
32     ::glClearColor  (theRed, theGreen, theBlue, theAlpha);
33     OpenGl_TRACE(glClearColor)
34   }
35
36   inline void glClear (GLbitfield theMask)
37   {
38     ::glClear (theMask);
39     OpenGl_TRACE(glClear)
40   }
41
42   inline void glColorMask (GLboolean theRed, GLboolean theGreen, GLboolean theBlue, GLboolean theAlpha)
43   {
44     ::glColorMask (theRed, theGreen, theBlue, theAlpha);
45     OpenGl_TRACE(glColorMask)
46   }
47
48   inline void glBlendFunc (GLenum sfactor, GLenum dfactor)
49   {
50     ::glBlendFunc(sfactor, dfactor);
51     OpenGl_TRACE(glBlendFunc)
52   }
53
54   inline void glCullFace (GLenum theMode)
55   {
56     ::glCullFace (theMode);
57     OpenGl_TRACE(glCullFace)
58   }
59
60   inline void glFrontFace (GLenum theMode)
61   {
62     ::glFrontFace (theMode);
63     OpenGl_TRACE(glFrontFace)
64   }
65
66   inline void glLineWidth (GLfloat theWidth)
67   {
68     ::glLineWidth (theWidth);
69     OpenGl_TRACE(glLineWidth)
70   }
71
72   inline void glPolygonOffset (GLfloat theFactor, GLfloat theUnits)
73   {
74     ::glPolygonOffset (theFactor, theUnits);
75     OpenGl_TRACE(glPolygonOffset)
76   }
77
78   inline void glScissor (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight)
79   {
80     ::glScissor (theX, theY, theWidth, theHeight);
81     OpenGl_TRACE(glScissor)
82   }
83
84   inline void glEnable (GLenum theCap)
85   {
86     ::glEnable (theCap);
87     OpenGl_TRACE(glEnable)
88   }
89
90   inline void glDisable (GLenum theCap)
91   {
92     ::glDisable (theCap);
93     OpenGl_TRACE(glDisable)
94   }
95
96   inline GLboolean glIsEnabled (GLenum theCap)
97   {
98     return ::glIsEnabled (theCap);
99   }
100
101   inline void glGetBooleanv (GLenum theParamName, GLboolean* theValues)
102   {
103     ::glGetBooleanv (theParamName, theValues);
104     OpenGl_TRACE(glGetBooleanv)
105   }
106
107   inline void glGetFloatv (GLenum theParamName, GLfloat* theValues)
108   {
109     ::glGetFloatv (theParamName, theValues);
110     OpenGl_TRACE(glGetFloatv)
111   }
112
113   inline void glGetIntegerv (GLenum theParamName, GLint* theValues)
114   {
115     ::glGetIntegerv (theParamName, theValues);
116     OpenGl_TRACE(glGetIntegerv)
117   }
118
119   inline GLenum glGetError()
120   {
121     return ::glGetError();
122   }
123
124   inline const GLubyte* glGetString (GLenum theName)
125   {
126     const GLubyte* aRes = ::glGetString (theName);
127     OpenGl_TRACE(glGetString)
128     return aRes;
129   }
130
131   inline void glFinish()
132   {
133     ::glFinish();
134     OpenGl_TRACE(glFinish)
135   }
136
137   inline void glFlush()
138   {
139     ::glFlush();
140     OpenGl_TRACE(glFlush)
141   }
142
143   inline void glHint (GLenum theTarget, GLenum theMode)
144   {
145     ::glHint (theTarget, theMode);
146     OpenGl_TRACE(glHint)
147   }
148
149 public: //! @name Depth Buffer
150
151   inline void glClearDepth (GLclampd theDepth)
152   {
153   #if defined(GL_ES_VERSION_2_0)
154     ::glClearDepthf ((GLfloat )theDepth);
155   #else
156     ::glClearDepth (theDepth);
157   #endif
158     OpenGl_TRACE(glClearDepth)
159   }
160
161   inline void glClearDepthf (GLfloat theDepth)
162   {
163   #if defined(GL_ES_VERSION_2_0)
164     ::glClearDepthf (theDepth);
165   #else
166     ::glClearDepth ((GLclampd )theDepth);
167   #endif
168     OpenGl_TRACE(glClearDepthf)
169   }
170
171   inline void glDepthFunc (GLenum theFunc)
172   {
173     ::glDepthFunc (theFunc);
174     OpenGl_TRACE(glDepthFunc)
175   }
176
177   inline void glDepthMask (GLboolean theFlag)
178   {
179     ::glDepthMask (theFlag);
180     OpenGl_TRACE(glDepthMask)
181   }
182
183   inline void glDepthRange (GLclampd theNearValue,
184                             GLclampd theFarValue)
185   {
186   #if defined(GL_ES_VERSION_2_0)
187     ::glDepthRangef ((GLfloat )theNearValue, (GLfloat )theFarValue);
188   #else
189     ::glDepthRange (theNearValue, theFarValue);
190   #endif
191     OpenGl_TRACE(glDepthRange)
192   }
193
194   inline void glDepthRangef (GLfloat theNearValue,
195                              GLfloat theFarValue)
196   {
197   #if defined(GL_ES_VERSION_2_0)
198     ::glDepthRangef (theNearValue, theFarValue);
199   #else
200     ::glDepthRange ((GLclampd )theNearValue, (GLclampd )theFarValue);
201   #endif
202     OpenGl_TRACE(glDepthRangef)
203   }
204
205 public: //! @name Transformation
206
207   inline void glViewport (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight)
208   {
209     ::glViewport (theX, theY, theWidth, theHeight);
210     OpenGl_TRACE(glViewport)
211   }
212
213 public: //! @name Vertex Arrays
214
215   inline void glDrawArrays (GLenum theMode, GLint theFirst, GLsizei theCount)
216   {
217     ::glDrawArrays (theMode, theFirst, theCount);
218     OpenGl_TRACE(glDrawArrays)
219   }
220
221   inline void glDrawElements (GLenum theMode, GLsizei theCount, GLenum theType, const GLvoid* theIndices)
222   {
223     ::glDrawElements (theMode, theCount, theType, theIndices);
224     OpenGl_TRACE(glDrawElements)
225   }
226
227 public: //! @name Raster functions
228
229   inline void glPixelStorei (GLenum theParamName, GLint   theParam)
230   {
231     ::glPixelStorei (theParamName, theParam);
232     OpenGl_TRACE(glPixelStorei)
233   }
234
235   inline void glReadPixels (GLint x, GLint y,
236                             GLsizei width, GLsizei height,
237                             GLenum format, GLenum type,
238                             GLvoid* pixels)
239   {
240     ::glReadPixels (x, y, width, height, format, type, pixels);
241     OpenGl_TRACE(glReadPixels)
242   }
243
244 public: //! @name Stenciling
245
246   inline void glStencilFunc (GLenum func, GLint ref, GLuint mask)
247   {
248     ::glStencilFunc (func, ref, mask);
249     OpenGl_TRACE(glStencilFunc)
250   }
251
252   inline void glStencilMask (GLuint mask)
253   {
254     ::glStencilMask (mask);
255     OpenGl_TRACE(glStencilMask)
256   }
257
258   inline void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass)
259   {
260     ::glStencilOp (fail, zfail, zpass);
261     OpenGl_TRACE(glStencilOp)
262   }
263
264   inline void glClearStencil (GLint s)
265   {
266     ::glClearStencil (s);
267     OpenGl_TRACE(glClearStencil)
268   }
269
270 public: //! @name Texture mapping
271
272   inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param)
273   {
274     ::glTexParameterf (target, pname, param);
275     OpenGl_TRACE(glTexParameterf)
276   }
277
278   inline void glTexParameteri (GLenum target, GLenum pname, GLint param)
279   {
280     ::glTexParameteri (target, pname, param);
281     OpenGl_TRACE(glTexParameteri)
282   }
283
284   inline void glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params)
285   {
286     ::glTexParameterfv (target, pname, params);
287     OpenGl_TRACE(glTexParameterfv)
288   }
289
290   inline void glTexParameteriv (GLenum target, GLenum pname, const GLint* params)
291   {
292     ::glTexParameteriv (target, pname, params);
293     OpenGl_TRACE(glTexParameteriv)
294   }
295
296   inline void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params)
297   {
298     ::glGetTexParameterfv (target, pname, params);
299     OpenGl_TRACE(glGetTexParameterfv)
300   }
301
302   inline void glGetTexParameteriv (GLenum target, GLenum pname, GLint* params)
303   {
304     ::glGetTexParameteriv (target, pname, params);
305     OpenGl_TRACE(glGetTexParameteriv)
306   }
307
308   inline void glTexImage2D (GLenum target, GLint level,
309                             GLint internalFormat,
310                             GLsizei width, GLsizei height,
311                             GLint border, GLenum format, GLenum type,
312                             const GLvoid* pixels)
313   {
314     ::glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
315     OpenGl_TRACE(glTexImage2D)
316   }
317
318   inline void glGenTextures (GLsizei n, GLuint* textures)
319   {
320     ::glGenTextures(n, textures);
321     OpenGl_TRACE(glGenTextures)
322   }
323
324   inline void glDeleteTextures (GLsizei n, const GLuint* textures)
325   {
326     ::glDeleteTextures(n, textures);
327     OpenGl_TRACE(glDeleteTextures)
328   }
329
330   inline void glBindTexture (GLenum target, GLuint texture)
331   {
332     ::glBindTexture(target, texture);
333     OpenGl_TRACE(glBindTexture)
334   }
335
336   inline GLboolean glIsTexture (GLuint texture)
337   {
338     const GLboolean aRes = ::glIsTexture (texture);
339     OpenGl_TRACE(glIsTexture)
340     return aRes;
341   }
342
343   inline void glTexSubImage2D (GLenum target, GLint level,
344                                GLint xoffset, GLint yoffset,
345                                GLsizei width, GLsizei height,
346                                GLenum format, GLenum type,
347                                const GLvoid* pixels)
348   {
349     ::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
350     OpenGl_TRACE(glTexSubImage2D)
351   }
352
353   inline void glCopyTexImage2D (GLenum target, GLint level,
354                                 GLenum internalformat,
355                                 GLint x, GLint y,
356                                 GLsizei width, GLsizei height,
357                                 GLint border)
358   {
359     ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
360     OpenGl_TRACE(glCopyTexImage2D)
361   }
362
363   inline void glCopyTexSubImage2D (GLenum target, GLint level,
364                                    GLint xoffset, GLint yoffset,
365                                    GLint x, GLint y,
366                                    GLsizei width, GLsizei height)
367   {
368     ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
369     OpenGl_TRACE(glCopyTexSubImage2D)
370   }
371
372 #if !defined(GL_ES_VERSION_2_0)
373   inline void glTexImage1D (GLenum target, GLint level,
374                             GLint internalFormat,
375                             GLsizei width, GLint border,
376                             GLenum format, GLenum type,
377                             const GLvoid* pixels)
378   {
379     ::glTexImage1D(target, level, internalFormat, width, border, format, type, pixels);
380     OpenGl_TRACE(glTexImage1D)
381   }
382
383   inline void glTexSubImage1D (GLenum target, GLint level,
384                                GLint xoffset,
385                                GLsizei width, GLenum format,
386                                GLenum type, const GLvoid* pixels)
387   {
388     ::glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
389     OpenGl_TRACE(glTexSubImage1D)
390   }
391
392   inline void glCopyTexImage1D (GLenum target, GLint level,
393                                 GLenum internalformat,
394                                 GLint x, GLint y,
395                                 GLsizei width, GLint border)
396   {
397     ::glCopyTexImage1D(target, level, internalformat, x, y, width, border);
398     OpenGl_TRACE(glCopyTexImage1D)
399   }
400
401   inline void glCopyTexSubImage1D (GLenum target, GLint level,
402                                    GLint xoffset, GLint x, GLint y,
403                                    GLsizei width)
404   {
405     ::glCopyTexSubImage1D(target, level, xoffset, x, y, width);
406     OpenGl_TRACE(glCopyTexSubImage1D)
407   }
408
409   inline void glGetTexImage (GLenum target, GLint level,
410                              GLenum format, GLenum type,
411                              GLvoid* pixels)
412   {
413     ::glGetTexImage (target, level, format, type, pixels);
414     OpenGl_TRACE(glGetTexImage)
415   }
416 #endif
417
418 #if !defined(GL_ES_VERSION_2_0)
419
420   inline void glAlphaFunc (GLenum theFunc, GLclampf theRef)
421   {
422     ::glAlphaFunc (theFunc, theRef);
423     OpenGl_TRACE(glAlphaFunc)
424   }
425
426   inline void glPointSize (GLfloat theSize)
427   {
428     ::glPointSize (theSize);
429     OpenGl_TRACE(glPointSize)
430   }
431
432 #endif
433
434 /*#if !defined(GL_ES_VERSION_2_0)
435
436   inline void glTexEnvf (GLenum target, GLenum pname, GLfloat param)
437   {
438     ::glTexEnvf (target, pname, param);
439   }
440
441   inline void glTexEnvi (GLenum target, GLenum pname, GLint param)
442   {
443     ::glTexEnvi (target, pname, param);
444   }
445
446   inline void glTexEnvfv (GLenum target, GLenum pname, const GLfloat* params)
447   {
448     ::glTexEnvfv (target, pname, params);
449   }
450
451   inline void glTexEnviv (GLenum target, GLenum pname, const GLint* params)
452   {
453     ::glTexEnviv (target, pname, params);
454   }
455
456   inline void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat* params)
457   {
458     ::glGetTexEnvfv (target, pname, params);
459   }
460
461   inline void glGetTexEnviv (GLenum target, GLenum pname, GLint* params)
462   {
463     ::glGetTexEnviv (target, pname, params);
464   }
465
466   inline void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat* params)
467   {
468     ::glGetTexLevelParameterfv (target, level, pname, params);
469   }
470
471   inline void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint* params)
472   {
473     ::glGetTexLevelParameteriv (target, level, pname, params);
474   }
475
476   inline void glClearIndex (GLfloat c)
477   {
478     ::glClearIndex(c);
479   }
480
481   inline void glIndexMask (GLuint theMask)
482   {
483     ::glIndexMask (theMask);
484   }
485
486   inline void glLogicOp (GLenum opcode)
487   {
488     ::glLogicOp(opcode);
489   }
490
491   inline void glPolygonMode (GLenum theFace, GLenum theMode)
492   {
493     ::glPolygonMode (theFace, theMode);
494   }
495
496   inline void glDrawBuffer (GLenum theMode)
497   {
498     ::glDrawBuffer (theMode);
499   }
500
501   inline void glReadBuffer (GLenum theMode)
502   {
503     ::glReadBuffer (theMode);
504   }
505
506   inline void glGetDoublev (GLenum theParamName, GLdouble* theValues)
507   {
508     ::glGetDoublev (theParamName, theValues);
509   }
510
511   inline GLint glRenderMode (GLenum theMode)
512   {
513     return ::glRenderMode (theMode);
514   }
515
516   inline void glArrayElement (GLint i)
517   {
518     ::glArrayElement (i);
519   }
520
521   inline void glPixelStoref (GLenum theParamName, GLfloat theParam)
522   {
523     ::glPixelStoref (theParamName, theParam);
524   }
525
526   inline void glPixelTransferf (GLenum theParamName, GLfloat theParam)
527   {
528     ::glPixelTransferf (theParamName, theParam);
529   }
530
531   inline void glPixelTransferi (GLenum theParamName, GLint   theParam)
532   {
533     ::glPixelTransferi (theParamName, theParam);
534   }
535
536   inline void glPixelMapfv  (GLenum map, GLsizei mapsize, const GLfloat*  values)
537   {
538     ::glPixelMapfv (map, mapsize, values);
539   }
540
541   inline void glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint*   values)
542   {
543     ::glPixelMapuiv (map, mapsize, values);
544   }
545
546   inline void glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort* values)
547   {
548     ::glPixelMapusv (map, mapsize, values);
549   }
550
551   inline void glGetPixelMapfv  (GLenum map, GLfloat*  values)
552   {
553     ::glGetPixelMapfv (map, values);
554   }
555
556   inline void glGetPixelMapuiv (GLenum map, GLuint*   values)
557   {
558     ::glGetPixelMapuiv (map, values);
559   }
560
561   inline void glGetPixelMapusv (GLenum map, GLushort* values)
562   {
563     ::glGetPixelMapusv (map, values);
564   }
565 #endif*/
566
567 };
568
569 #endif // _OpenGl_GlCore11Fwd_Header