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_Header 17 #define _OpenGl_GlCore11Fwd_Header 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 glClearColorOpenGl_GlCore11Fwd30 inline void glClearColor (GLclampf theRed, GLclampf theGreen, GLclampf theBlue, GLclampf theAlpha) 31 { 32 ::glClearColor (theRed, theGreen, theBlue, theAlpha); 33 } 34 glClearOpenGl_GlCore11Fwd35 inline void glClear (GLbitfield theMask) 36 { 37 ::glClear (theMask); 38 } 39 glColorMaskOpenGl_GlCore11Fwd40 inline void glColorMask (GLboolean theRed, GLboolean theGreen, GLboolean theBlue, GLboolean theAlpha) 41 { 42 ::glColorMask (theRed, theGreen, theBlue, theAlpha); 43 } 44 glBlendFuncOpenGl_GlCore11Fwd45 inline void glBlendFunc (GLenum sfactor, GLenum dfactor) 46 { 47 ::glBlendFunc(sfactor, dfactor); 48 } 49 glCullFaceOpenGl_GlCore11Fwd50 inline void glCullFace (GLenum theMode) 51 { 52 ::glCullFace (theMode); 53 } 54 glFrontFaceOpenGl_GlCore11Fwd55 inline void glFrontFace (GLenum theMode) 56 { 57 ::glFrontFace (theMode); 58 } 59 glLineWidthOpenGl_GlCore11Fwd60 inline void glLineWidth (GLfloat theWidth) 61 { 62 ::glLineWidth (theWidth); 63 } 64 glPolygonOffsetOpenGl_GlCore11Fwd65 inline void glPolygonOffset (GLfloat theFactor, GLfloat theUnits) 66 { 67 ::glPolygonOffset (theFactor, theUnits); 68 } 69 glScissorOpenGl_GlCore11Fwd70 inline void glScissor (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight) 71 { 72 ::glScissor (theX, theY, theWidth, theHeight); 73 } 74 glEnableOpenGl_GlCore11Fwd75 inline void glEnable (GLenum theCap) 76 { 77 ::glEnable (theCap); 78 } 79 glDisableOpenGl_GlCore11Fwd80 inline void glDisable (GLenum theCap) 81 { 82 ::glDisable (theCap); 83 } 84 glIsEnabledOpenGl_GlCore11Fwd85 inline GLboolean glIsEnabled (GLenum theCap) 86 { 87 return ::glIsEnabled (theCap); 88 } 89 glGetBooleanvOpenGl_GlCore11Fwd90 inline void glGetBooleanv (GLenum theParamName, GLboolean* theValues) 91 { 92 ::glGetBooleanv (theParamName, theValues); 93 } 94 glGetFloatvOpenGl_GlCore11Fwd95 inline void glGetFloatv (GLenum theParamName, GLfloat* theValues) 96 { 97 ::glGetFloatv (theParamName, theValues); 98 } 99 glGetIntegervOpenGl_GlCore11Fwd100 inline void glGetIntegerv (GLenum theParamName, GLint* theValues) 101 { 102 ::glGetIntegerv (theParamName, theValues); 103 } 104 glGetErrorOpenGl_GlCore11Fwd105 inline GLenum glGetError() 106 { 107 return ::glGetError(); 108 } 109 glGetStringOpenGl_GlCore11Fwd110 inline const GLubyte* glGetString (GLenum theName) 111 { 112 return ::glGetString (theName); 113 } 114 glFinishOpenGl_GlCore11Fwd115 inline void glFinish() 116 { 117 ::glFinish(); 118 } 119 glFlushOpenGl_GlCore11Fwd120 inline void glFlush() 121 { 122 ::glFlush(); 123 } 124 glHintOpenGl_GlCore11Fwd125 inline void glHint (GLenum theTarget, GLenum theMode) 126 { 127 ::glHint (theTarget, theMode); 128 } 129 130 public: //! @name Depth Buffer 131 glClearDepthOpenGl_GlCore11Fwd132 inline void glClearDepth (GLclampd theDepth) 133 { 134 #if defined(GL_ES_VERSION_2_0) 135 ::glClearDepthf ((GLfloat )theDepth); 136 #else 137 ::glClearDepth (theDepth); 138 #endif 139 } 140 glClearDepthfOpenGl_GlCore11Fwd141 inline void glClearDepthf (GLfloat theDepth) 142 { 143 #if defined(GL_ES_VERSION_2_0) 144 ::glClearDepthf (theDepth); 145 #else 146 ::glClearDepth ((GLclampd )theDepth); 147 #endif 148 } 149 glDepthFuncOpenGl_GlCore11Fwd150 inline void glDepthFunc (GLenum theFunc) 151 { 152 ::glDepthFunc (theFunc); 153 } 154 glDepthMaskOpenGl_GlCore11Fwd155 inline void glDepthMask (GLboolean theFlag) 156 { 157 ::glDepthMask (theFlag); 158 } 159 glDepthRangeOpenGl_GlCore11Fwd160 inline void glDepthRange (GLclampd theNearValue, 161 GLclampd theFarValue) 162 { 163 #if defined(GL_ES_VERSION_2_0) 164 ::glDepthRangef ((GLfloat )theNearValue, (GLfloat )theFarValue); 165 #else 166 ::glDepthRange (theNearValue, theFarValue); 167 #endif 168 } 169 glDepthRangefOpenGl_GlCore11Fwd170 inline void glDepthRangef (GLfloat theNearValue, 171 GLfloat theFarValue) 172 { 173 #if defined(GL_ES_VERSION_2_0) 174 ::glDepthRangef (theNearValue, theFarValue); 175 #else 176 ::glDepthRange ((GLclampd )theNearValue, (GLclampd )theFarValue); 177 #endif 178 } 179 180 public: //! @name Transformation 181 glViewportOpenGl_GlCore11Fwd182 inline void glViewport (GLint theX, GLint theY, GLsizei theWidth, GLsizei theHeight) 183 { 184 ::glViewport (theX, theY, theWidth, theHeight); 185 } 186 187 public: //! @name Vertex Arrays 188 glDrawArraysOpenGl_GlCore11Fwd189 inline void glDrawArrays (GLenum theMode, GLint theFirst, GLsizei theCount) 190 { 191 ::glDrawArrays (theMode, theFirst, theCount); 192 } 193 glDrawElementsOpenGl_GlCore11Fwd194 inline void glDrawElements (GLenum theMode, GLsizei theCount, GLenum theType, const GLvoid* theIndices) 195 { 196 ::glDrawElements (theMode, theCount, theType, theIndices); 197 } 198 199 public: //! @name Raster functions 200 glPixelStoreiOpenGl_GlCore11Fwd201 inline void glPixelStorei (GLenum theParamName, GLint theParam) 202 { 203 ::glPixelStorei (theParamName, theParam); 204 } 205 glReadPixelsOpenGl_GlCore11Fwd206 inline void glReadPixels (GLint x, GLint y, 207 GLsizei width, GLsizei height, 208 GLenum format, GLenum type, 209 GLvoid* pixels) 210 { 211 ::glReadPixels (x, y, width, height, format, type, pixels); 212 } 213 214 public: //! @name Stenciling 215 glStencilFuncOpenGl_GlCore11Fwd216 inline void glStencilFunc (GLenum func, GLint ref, GLuint mask) 217 { 218 ::glStencilFunc (func, ref, mask); 219 } 220 glStencilMaskOpenGl_GlCore11Fwd221 inline void glStencilMask (GLuint mask) 222 { 223 ::glStencilMask (mask); 224 } 225 glStencilOpOpenGl_GlCore11Fwd226 inline void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass) 227 { 228 ::glStencilOp (fail, zfail, zpass); 229 } 230 glClearStencilOpenGl_GlCore11Fwd231 inline void glClearStencil (GLint s) 232 { 233 ::glClearStencil (s); 234 } 235 236 public: //! @name Texture mapping 237 glTexParameterfOpenGl_GlCore11Fwd238 inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param) 239 { 240 ::glTexParameterf (target, pname, param); 241 } 242 glTexParameteriOpenGl_GlCore11Fwd243 inline void glTexParameteri (GLenum target, GLenum pname, GLint param) 244 { 245 ::glTexParameteri (target, pname, param); 246 } 247 glTexParameterfvOpenGl_GlCore11Fwd248 inline void glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params) 249 { 250 ::glTexParameterfv (target, pname, params); 251 } 252 glTexParameterivOpenGl_GlCore11Fwd253 inline void glTexParameteriv (GLenum target, GLenum pname, const GLint* params) 254 { 255 ::glTexParameteriv (target, pname, params); 256 } 257 glGetTexParameterfvOpenGl_GlCore11Fwd258 inline void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params) 259 { 260 ::glGetTexParameterfv (target, pname, params); 261 } 262 glGetTexParameterivOpenGl_GlCore11Fwd263 inline void glGetTexParameteriv (GLenum target, GLenum pname, GLint* params) 264 { 265 ::glGetTexParameteriv (target, pname, params); 266 } 267 glTexImage2DOpenGl_GlCore11Fwd268 inline void glTexImage2D (GLenum target, GLint level, 269 GLint internalFormat, 270 GLsizei width, GLsizei height, 271 GLint border, GLenum format, GLenum type, 272 const GLvoid* pixels) 273 { 274 ::glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels); 275 } 276 glGenTexturesOpenGl_GlCore11Fwd277 inline void glGenTextures (GLsizei n, GLuint* textures) 278 { 279 ::glGenTextures(n, textures); 280 } 281 glDeleteTexturesOpenGl_GlCore11Fwd282 inline void glDeleteTextures (GLsizei n, const GLuint* textures) 283 { 284 ::glDeleteTextures(n, textures); 285 } 286 glBindTextureOpenGl_GlCore11Fwd287 inline void glBindTexture (GLenum target, GLuint texture) 288 { 289 ::glBindTexture(target, texture); 290 } 291 glIsTextureOpenGl_GlCore11Fwd292 inline GLboolean glIsTexture (GLuint texture) 293 { 294 return ::glIsTexture (texture); 295 } 296 glTexSubImage2DOpenGl_GlCore11Fwd297 inline void glTexSubImage2D (GLenum target, GLint level, 298 GLint xoffset, GLint yoffset, 299 GLsizei width, GLsizei height, 300 GLenum format, GLenum type, 301 const GLvoid* pixels) 302 { 303 ::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); 304 } 305 glCopyTexImage2DOpenGl_GlCore11Fwd306 inline void glCopyTexImage2D (GLenum target, GLint level, 307 GLenum internalformat, 308 GLint x, GLint y, 309 GLsizei width, GLsizei height, 310 GLint border) 311 { 312 ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); 313 } 314 glCopyTexSubImage2DOpenGl_GlCore11Fwd315 inline void glCopyTexSubImage2D (GLenum target, GLint level, 316 GLint xoffset, GLint yoffset, 317 GLint x, GLint y, 318 GLsizei width, GLsizei height) 319 { 320 ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 321 } 322 323 #if !defined(GL_ES_VERSION_2_0) glTexImage1DOpenGl_GlCore11Fwd324 inline void glTexImage1D (GLenum target, GLint level, 325 GLint internalFormat, 326 GLsizei width, GLint border, 327 GLenum format, GLenum type, 328 const GLvoid* pixels) 329 { 330 ::glTexImage1D(target, level, internalFormat, width, border, format, type, pixels); 331 } 332 glTexSubImage1DOpenGl_GlCore11Fwd333 inline void glTexSubImage1D (GLenum target, GLint level, 334 GLint xoffset, 335 GLsizei width, GLenum format, 336 GLenum type, const GLvoid* pixels) 337 { 338 ::glTexSubImage1D(target, level, xoffset, width, format, type, pixels); 339 } 340 glCopyTexImage1DOpenGl_GlCore11Fwd341 inline void glCopyTexImage1D (GLenum target, GLint level, 342 GLenum internalformat, 343 GLint x, GLint y, 344 GLsizei width, GLint border) 345 { 346 ::glCopyTexImage1D(target, level, internalformat, x, y, width, border); 347 } 348 glCopyTexSubImage1DOpenGl_GlCore11Fwd349 inline void glCopyTexSubImage1D (GLenum target, GLint level, 350 GLint xoffset, GLint x, GLint y, 351 GLsizei width) 352 { 353 ::glCopyTexSubImage1D(target, level, xoffset, x, y, width); 354 } 355 glGetTexImageOpenGl_GlCore11Fwd356 inline void glGetTexImage (GLenum target, GLint level, 357 GLenum format, GLenum type, 358 GLvoid* pixels) 359 { 360 ::glGetTexImage (target, level, format, type, pixels); 361 } 362 #endif 363 364 #if !defined(GL_ES_VERSION_2_0) 365 glAlphaFuncOpenGl_GlCore11Fwd366 inline void glAlphaFunc (GLenum theFunc, GLclampf theRef) 367 { 368 ::glAlphaFunc (theFunc, theRef); 369 } 370 glPointSizeOpenGl_GlCore11Fwd371 inline void glPointSize (GLfloat theSize) 372 { 373 ::glPointSize (theSize); 374 } 375 376 #endif 377 378 /*#if !defined(GL_ES_VERSION_2_0) 379 380 inline void glTexEnvf (GLenum target, GLenum pname, GLfloat param) 381 { 382 ::glTexEnvf (target, pname, param); 383 } 384 385 inline void glTexEnvi (GLenum target, GLenum pname, GLint param) 386 { 387 ::glTexEnvi (target, pname, param); 388 } 389 390 inline void glTexEnvfv (GLenum target, GLenum pname, const GLfloat* params) 391 { 392 ::glTexEnvfv (target, pname, params); 393 } 394 395 inline void glTexEnviv (GLenum target, GLenum pname, const GLint* params) 396 { 397 ::glTexEnviv (target, pname, params); 398 } 399 400 inline void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat* params) 401 { 402 ::glGetTexEnvfv (target, pname, params); 403 } 404 405 inline void glGetTexEnviv (GLenum target, GLenum pname, GLint* params) 406 { 407 ::glGetTexEnviv (target, pname, params); 408 } 409 410 inline void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat* params) 411 { 412 ::glGetTexLevelParameterfv (target, level, pname, params); 413 } 414 415 inline void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint* params) 416 { 417 ::glGetTexLevelParameteriv (target, level, pname, params); 418 } 419 420 inline void glClearIndex (GLfloat c) 421 { 422 ::glClearIndex(c); 423 } 424 425 inline void glIndexMask (GLuint theMask) 426 { 427 ::glIndexMask (theMask); 428 } 429 430 inline void glLogicOp (GLenum opcode) 431 { 432 ::glLogicOp(opcode); 433 } 434 435 inline void glPolygonMode (GLenum theFace, GLenum theMode) 436 { 437 ::glPolygonMode (theFace, theMode); 438 } 439 440 inline void glDrawBuffer (GLenum theMode) 441 { 442 ::glDrawBuffer (theMode); 443 } 444 445 inline void glReadBuffer (GLenum theMode) 446 { 447 ::glReadBuffer (theMode); 448 } 449 450 inline void glGetDoublev (GLenum theParamName, GLdouble* theValues) 451 { 452 ::glGetDoublev (theParamName, theValues); 453 } 454 455 inline GLint glRenderMode (GLenum theMode) 456 { 457 return ::glRenderMode (theMode); 458 } 459 460 inline void glArrayElement (GLint i) 461 { 462 ::glArrayElement (i); 463 } 464 465 inline void glPixelStoref (GLenum theParamName, GLfloat theParam) 466 { 467 ::glPixelStoref (theParamName, theParam); 468 } 469 470 inline void glPixelTransferf (GLenum theParamName, GLfloat theParam) 471 { 472 ::glPixelTransferf (theParamName, theParam); 473 } 474 475 inline void glPixelTransferi (GLenum theParamName, GLint theParam) 476 { 477 ::glPixelTransferi (theParamName, theParam); 478 } 479 480 inline void glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat* values) 481 { 482 ::glPixelMapfv (map, mapsize, values); 483 } 484 485 inline void glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint* values) 486 { 487 ::glPixelMapuiv (map, mapsize, values); 488 } 489 490 inline void glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort* values) 491 { 492 ::glPixelMapusv (map, mapsize, values); 493 } 494 495 inline void glGetPixelMapfv (GLenum map, GLfloat* values) 496 { 497 ::glGetPixelMapfv (map, values); 498 } 499 500 inline void glGetPixelMapuiv (GLenum map, GLuint* values) 501 { 502 ::glGetPixelMapuiv (map, values); 503 } 504 505 inline void glGetPixelMapusv (GLenum map, GLushort* values) 506 { 507 ::glGetPixelMapusv (map, values); 508 } 509 #endif*/ 510 511 }; 512 513 #endif // _OpenGl_GlCore11Fwd_Header 514