1 // Created on: 2014-03-17
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef OpenGl_GlCore11Fwd_HeaderFile
17 #define OpenGl_GlCore11Fwd_HeaderFile
19 #include <OpenGl_GlFunctions.hxx>
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
28 public: //! @name Miscellaneous
30 inline void glClearColor (GLclampf theRed, GLclampf theGreen, GLclampf theBlue, GLclampf theAlpha)
32 ::glClearColor (theRed, theGreen, theBlue, theAlpha);
33 OpenGl_TRACE(glClearColor)
36 inline void glClear (GLbitfield theMask)
42 inline void glColorMask (GLboolean theRed, GLboolean theGreen, GLboolean theBlue, GLboolean theAlpha)
44 ::glColorMask (theRed, theGreen, theBlue, theAlpha);
45 OpenGl_TRACE(glColorMask)
48 inline void glBlendFunc (GLenum sfactor, GLenum dfactor)
50 ::glBlendFunc(sfactor, dfactor);
51 OpenGl_TRACE(glBlendFunc)
54 inline void glCullFace (GLenum theMode)
56 ::glCullFace (theMode);
57 OpenGl_TRACE(glCullFace)
60 inline void glFrontFace (GLenum theMode)
62 ::glFrontFace (theMode);
63 OpenGl_TRACE(glFrontFace)
66 inline void glLineWidth (GLfloat theWidth)
68 ::glLineWidth (theWidth);
69 OpenGl_TRACE(glLineWidth)
72 inline void glPolygonOffset (GLfloat theFactor, GLfloat theUnits)
74 ::glPolygonOffset (theFactor, theUnits);
75 OpenGl_TRACE(glPolygonOffset)
78 inline void glScissor (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight)
80 ::glScissor (theX, theY, theWidth, theHeight);
81 OpenGl_TRACE(glScissor)
84 inline void glEnable (GLenum theCap)
87 OpenGl_TRACE(glEnable)
90 inline void glDisable (GLenum theCap)
93 OpenGl_TRACE(glDisable)
96 inline GLboolean glIsEnabled (GLenum theCap)
98 return ::glIsEnabled (theCap);
101 inline void glGetBooleanv (GLenum theParamName, GLboolean* theValues)
103 ::glGetBooleanv (theParamName, theValues);
104 OpenGl_TRACE(glGetBooleanv)
107 inline void glGetFloatv (GLenum theParamName, GLfloat* theValues)
109 ::glGetFloatv (theParamName, theValues);
110 OpenGl_TRACE(glGetFloatv)
113 inline void glGetIntegerv (GLenum theParamName, GLint* theValues)
115 ::glGetIntegerv (theParamName, theValues);
116 OpenGl_TRACE(glGetIntegerv)
119 inline GLenum glGetError()
121 return ::glGetError();
124 inline const GLubyte* glGetString (GLenum theName)
126 const GLubyte* aRes = ::glGetString (theName);
127 OpenGl_TRACE(glGetString)
131 inline void glFinish()
134 OpenGl_TRACE(glFinish)
137 inline void glFlush()
140 OpenGl_TRACE(glFlush)
143 inline void glHint (GLenum theTarget, GLenum theMode)
145 ::glHint (theTarget, theMode);
149 public: //! @name Depth Buffer
151 inline void glClearDepth (GLclampd theDepth)
153 #if defined(GL_ES_VERSION_2_0)
154 ::glClearDepthf ((GLfloat )theDepth);
156 ::glClearDepth (theDepth);
158 OpenGl_TRACE(glClearDepth)
161 inline void glClearDepthf (GLfloat theDepth)
163 #if defined(GL_ES_VERSION_2_0)
164 ::glClearDepthf (theDepth);
166 ::glClearDepth ((GLclampd )theDepth);
168 OpenGl_TRACE(glClearDepthf)
171 inline void glDepthFunc (GLenum theFunc)
173 ::glDepthFunc (theFunc);
174 OpenGl_TRACE(glDepthFunc)
177 inline void glDepthMask (GLboolean theFlag)
179 ::glDepthMask (theFlag);
180 OpenGl_TRACE(glDepthMask)
183 inline void glDepthRange (GLclampd theNearValue,
184 GLclampd theFarValue)
186 #if defined(GL_ES_VERSION_2_0)
187 ::glDepthRangef ((GLfloat )theNearValue, (GLfloat )theFarValue);
189 ::glDepthRange (theNearValue, theFarValue);
191 OpenGl_TRACE(glDepthRange)
194 inline void glDepthRangef (GLfloat theNearValue,
197 #if defined(GL_ES_VERSION_2_0)
198 ::glDepthRangef (theNearValue, theFarValue);
200 ::glDepthRange ((GLclampd )theNearValue, (GLclampd )theFarValue);
202 OpenGl_TRACE(glDepthRangef)
205 public: //! @name Transformation
207 inline void glViewport (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight)
209 ::glViewport (theX, theY, theWidth, theHeight);
210 OpenGl_TRACE(glViewport)
213 public: //! @name Vertex Arrays
215 inline void glDrawArrays (GLenum theMode, GLint theFirst, GLsizei theCount)
217 ::glDrawArrays (theMode, theFirst, theCount);
218 OpenGl_TRACE(glDrawArrays)
221 inline void glDrawElements (GLenum theMode, GLsizei theCount, GLenum theType, const GLvoid* theIndices)
223 ::glDrawElements (theMode, theCount, theType, theIndices);
224 OpenGl_TRACE(glDrawElements)
227 public: //! @name Raster functions
229 inline void glPixelStorei (GLenum theParamName, GLint theParam)
231 ::glPixelStorei (theParamName, theParam);
232 OpenGl_TRACE(glPixelStorei)
235 inline void glReadPixels (GLint x, GLint y,
236 GLsizei width, GLsizei height,
237 GLenum format, GLenum type,
240 ::glReadPixels (x, y, width, height, format, type, pixels);
241 OpenGl_TRACE(glReadPixels)
244 public: //! @name Stenciling
246 inline void glStencilFunc (GLenum func, GLint ref, GLuint mask)
248 ::glStencilFunc (func, ref, mask);
249 OpenGl_TRACE(glStencilFunc)
252 inline void glStencilMask (GLuint mask)
254 ::glStencilMask (mask);
255 OpenGl_TRACE(glStencilMask)
258 inline void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass)
260 ::glStencilOp (fail, zfail, zpass);
261 OpenGl_TRACE(glStencilOp)
264 inline void glClearStencil (GLint s)
266 ::glClearStencil (s);
267 OpenGl_TRACE(glClearStencil)
270 public: //! @name Texture mapping
272 inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param)
274 ::glTexParameterf (target, pname, param);
275 OpenGl_TRACE(glTexParameterf)
278 inline void glTexParameteri (GLenum target, GLenum pname, GLint param)
280 ::glTexParameteri (target, pname, param);
281 OpenGl_TRACE(glTexParameteri)
284 inline void glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params)
286 ::glTexParameterfv (target, pname, params);
287 OpenGl_TRACE(glTexParameterfv)
290 inline void glTexParameteriv (GLenum target, GLenum pname, const GLint* params)
292 ::glTexParameteriv (target, pname, params);
293 OpenGl_TRACE(glTexParameteriv)
296 inline void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params)
298 ::glGetTexParameterfv (target, pname, params);
299 OpenGl_TRACE(glGetTexParameterfv)
302 inline void glGetTexParameteriv (GLenum target, GLenum pname, GLint* params)
304 ::glGetTexParameteriv (target, pname, params);
305 OpenGl_TRACE(glGetTexParameteriv)
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)
314 ::glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
315 OpenGl_TRACE(glTexImage2D)
318 inline void glGenTextures (GLsizei n, GLuint* textures)
320 ::glGenTextures(n, textures);
321 OpenGl_TRACE(glGenTextures)
324 inline void glDeleteTextures (GLsizei n, const GLuint* textures)
326 ::glDeleteTextures(n, textures);
327 OpenGl_TRACE(glDeleteTextures)
330 inline void glBindTexture (GLenum target, GLuint texture)
332 ::glBindTexture(target, texture);
333 OpenGl_TRACE(glBindTexture)
336 inline GLboolean glIsTexture (GLuint texture)
338 const GLboolean aRes = ::glIsTexture (texture);
339 OpenGl_TRACE(glIsTexture)
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)
349 ::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
350 OpenGl_TRACE(glTexSubImage2D)
353 inline void glCopyTexImage2D (GLenum target, GLint level,
354 GLenum internalformat,
356 GLsizei width, GLsizei height,
359 ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
360 OpenGl_TRACE(glCopyTexImage2D)
363 inline void glCopyTexSubImage2D (GLenum target, GLint level,
364 GLint xoffset, GLint yoffset,
366 GLsizei width, GLsizei height)
368 ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
369 OpenGl_TRACE(glCopyTexSubImage2D)
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)
379 ::glTexImage1D(target, level, internalFormat, width, border, format, type, pixels);
380 OpenGl_TRACE(glTexImage1D)
383 inline void glTexSubImage1D (GLenum target, GLint level,
385 GLsizei width, GLenum format,
386 GLenum type, const GLvoid* pixels)
388 ::glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
389 OpenGl_TRACE(glTexSubImage1D)
392 inline void glCopyTexImage1D (GLenum target, GLint level,
393 GLenum internalformat,
395 GLsizei width, GLint border)
397 ::glCopyTexImage1D(target, level, internalformat, x, y, width, border);
398 OpenGl_TRACE(glCopyTexImage1D)
401 inline void glCopyTexSubImage1D (GLenum target, GLint level,
402 GLint xoffset, GLint x, GLint y,
405 ::glCopyTexSubImage1D(target, level, xoffset, x, y, width);
406 OpenGl_TRACE(glCopyTexSubImage1D)
409 inline void glGetTexImage (GLenum target, GLint level,
410 GLenum format, GLenum type,
413 ::glGetTexImage (target, level, format, type, pixels);
414 OpenGl_TRACE(glGetTexImage)
418 #if !defined(GL_ES_VERSION_2_0)
420 inline void glAlphaFunc (GLenum theFunc, GLclampf theRef)
422 ::glAlphaFunc (theFunc, theRef);
423 OpenGl_TRACE(glAlphaFunc)
426 inline void glPointSize (GLfloat theSize)
428 ::glPointSize (theSize);
429 OpenGl_TRACE(glPointSize)
434 /*#if !defined(GL_ES_VERSION_2_0)
436 inline void glTexEnvf (GLenum target, GLenum pname, GLfloat param)
438 ::glTexEnvf (target, pname, param);
441 inline void glTexEnvi (GLenum target, GLenum pname, GLint param)
443 ::glTexEnvi (target, pname, param);
446 inline void glTexEnvfv (GLenum target, GLenum pname, const GLfloat* params)
448 ::glTexEnvfv (target, pname, params);
451 inline void glTexEnviv (GLenum target, GLenum pname, const GLint* params)
453 ::glTexEnviv (target, pname, params);
456 inline void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat* params)
458 ::glGetTexEnvfv (target, pname, params);
461 inline void glGetTexEnviv (GLenum target, GLenum pname, GLint* params)
463 ::glGetTexEnviv (target, pname, params);
466 inline void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat* params)
468 ::glGetTexLevelParameterfv (target, level, pname, params);
471 inline void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint* params)
473 ::glGetTexLevelParameteriv (target, level, pname, params);
476 inline void glClearIndex (GLfloat c)
481 inline void glIndexMask (GLuint theMask)
483 ::glIndexMask (theMask);
486 inline void glLogicOp (GLenum opcode)
491 inline void glPolygonMode (GLenum theFace, GLenum theMode)
493 ::glPolygonMode (theFace, theMode);
496 inline void glDrawBuffer (GLenum theMode)
498 ::glDrawBuffer (theMode);
501 inline void glReadBuffer (GLenum theMode)
503 ::glReadBuffer (theMode);
506 inline void glGetDoublev (GLenum theParamName, GLdouble* theValues)
508 ::glGetDoublev (theParamName, theValues);
511 inline GLint glRenderMode (GLenum theMode)
513 return ::glRenderMode (theMode);
516 inline void glArrayElement (GLint i)
518 ::glArrayElement (i);
521 inline void glPixelStoref (GLenum theParamName, GLfloat theParam)
523 ::glPixelStoref (theParamName, theParam);
526 inline void glPixelTransferf (GLenum theParamName, GLfloat theParam)
528 ::glPixelTransferf (theParamName, theParam);
531 inline void glPixelTransferi (GLenum theParamName, GLint theParam)
533 ::glPixelTransferi (theParamName, theParam);
536 inline void glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat* values)
538 ::glPixelMapfv (map, mapsize, values);
541 inline void glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint* values)
543 ::glPixelMapuiv (map, mapsize, values);
546 inline void glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort* values)
548 ::glPixelMapusv (map, mapsize, values);
551 inline void glGetPixelMapfv (GLenum map, GLfloat* values)
553 ::glGetPixelMapfv (map, values);
556 inline void glGetPixelMapuiv (GLenum map, GLuint* values)
558 ::glGetPixelMapuiv (map, values);
561 inline void glGetPixelMapusv (GLenum map, GLushort* values)
563 ::glGetPixelMapusv (map, values);
569 #endif // _OpenGl_GlCore11Fwd_Header