0031583: Visualization, OpenGl_Context - load OpenGL ES 3.0 functions
authorkgv <kgv@opencascade.com>
Wed, 27 May 2020 17:46:34 +0000 (20:46 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 28 May 2020 07:24:35 +0000 (10:24 +0300)
OpenGl_Context now retrieves complete functions sets of OpenGL ES 3.0, 3.1 and 3.2.

src/OpenGl/FILES
src/OpenGl/OpenGl_ArbIns.hxx
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_GLESExtensions.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_GlCore30.hxx
src/OpenGl/OpenGl_GlCore31.hxx
src/OpenGl/OpenGl_GlFunctions.hxx
src/OpenGl/OpenGl_ShaderProgram.cxx

index c170d39..f52b5fc 100755 (executable)
@@ -77,6 +77,7 @@ OpenGl_Context.cxx
 OpenGl_Context.hxx
 OpenGl_Context_1.mm
 OpenGl_ExtGS.hxx
+OpenGl_GLESExtensions.hxx
 OpenGl_GlFunctions.hxx
 OpenGl_Flipper.cxx
 OpenGl_Flipper.hxx
index db86f6f..d554f6c 100644 (file)
 #include <OpenGl_GlFunctions.hxx>
 
 //! Instancing is available on OpenGL 3.0+ hardware
+//! (in core since OpenGL 3.1 or GL_ARB_draw_instanced extension).
+//!
+//! Note that this structure does not include glVertexAttribDivisor(),
+//! which has been introduced in later OpenGL versions (OpenGL 3.3 or OpenGL ES 3.0).
 struct OpenGl_ArbIns : protected OpenGl_GlFunctions
 {
-#if !defined(GL_ES_VERSION_2_0)
   using OpenGl_GlFunctions::glDrawArraysInstanced;
   using OpenGl_GlFunctions::glDrawElementsInstanced;
-#endif
 };
 
 #endif // _OpenGl_ArbIns_H__
index 531d4fd..4111e96 100644 (file)
@@ -121,6 +121,8 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
   core15fwd  (NULL),
   core20     (NULL),
   core20fwd  (NULL),
+  core30     (NULL),
+  core30fwd  (NULL),
   core32     (NULL),
   core32back (NULL),
   core33     (NULL),
@@ -1423,6 +1425,8 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
   core15fwd  = NULL;
   core20     = NULL;
   core20fwd  = NULL;
+  core30     = NULL;
+  core30fwd  = NULL;
   core32     = NULL;
   core32back = NULL;
   core33     = NULL;
@@ -1542,22 +1546,233 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
   hasTexFloatLinear = arbTexFloat
                    && CheckExtension ("GL_OES_texture_float_linear");
 
-  const Standard_Boolean hasTexBuffer32  = IsGlGreaterEqual (3, 2) && FindProcShort (glTexBuffer);
-  const Standard_Boolean hasExtTexBuffer = CheckExtension ("GL_EXT_texture_buffer") && FindProc ("glTexBufferEXT", myFuncs->glTexBuffer);
-
+  const bool hasTexBuffer32  = IsGlGreaterEqual (3, 2) && FindProcShort (glTexBuffer);
+  const bool hasExtTexBuffer = CheckExtension ("GL_EXT_texture_buffer") && FindProc ("glTexBufferEXT", myFuncs->glTexBuffer);
   if (hasTexBuffer32 || hasExtTexBuffer)
   {
     arbTBO = reinterpret_cast<OpenGl_ArbTBO*> (myFuncs.get());
   }
 
+  bool hasInstanced = IsGlGreaterEqual (3, 0)
+       && FindProcShort (glVertexAttribDivisor)
+       && FindProcShort (glDrawArraysInstanced)
+       && FindProcShort (glDrawElementsInstanced);
+  if (!hasInstanced)
+  {
+    hasInstanced = CheckExtension ("GL_ANGLE_instanced_arrays")
+       && FindProc ("glVertexAttribDivisorANGLE",   myFuncs->glVertexAttribDivisor)
+       && FindProc ("glDrawArraysInstancedANGLE",   myFuncs->glDrawArraysInstanced)
+       && FindProc ("glDrawElementsInstancedANGLE", myFuncs->glDrawElementsInstanced);
+  }
+  if (hasInstanced)
+  {
+    arbIns = (OpenGl_ArbIns* )(&(*myFuncs));
+  }
+
+  const bool hasVAO = IsGlGreaterEqual (3, 0)
+       && FindProcShort (glBindVertexArray)
+       && FindProcShort (glDeleteVertexArrays)
+       && FindProcShort (glGenVertexArrays)
+       && FindProcShort (glIsVertexArray);
+  const bool hasMapBufferRange = IsGlGreaterEqual (3, 0)
+       && FindProcShort (glMapBufferRange)
+       && FindProcShort (glFlushMappedBufferRange);
+
+  // load OpenGL ES 3.0 new functions
+  const bool has30es = IsGlGreaterEqual (3, 0)
+       && hasVAO
+       && hasMapBufferRange
+       && hasInstanced
+       && arbSamplerObject != NULL
+       && arbFBOBlit != NULL
+       && FindProcShort (glReadBuffer)
+       && FindProcShort (glDrawRangeElements)
+       && FindProcShort (glTexImage3D)
+       && FindProcShort (glTexSubImage3D)
+       && FindProcShort (glCopyTexSubImage3D)
+       && FindProcShort (glCompressedTexImage3D)
+       && FindProcShort (glCompressedTexSubImage3D)
+       && FindProcShort (glGenQueries)
+       && FindProcShort (glDeleteQueries)
+       && FindProcShort (glIsQuery)
+       && FindProcShort (glBeginQuery)
+       && FindProcShort (glEndQuery)
+       && FindProcShort (glGetQueryiv)
+       && FindProcShort (glGetQueryObjectuiv)
+       && FindProcShort (glUnmapBuffer)
+       && FindProcShort (glGetBufferPointerv)
+       && FindProcShort (glDrawBuffers)
+       && FindProcShort (glUniformMatrix2x3fv)
+       && FindProcShort (glUniformMatrix3x2fv)
+       && FindProcShort (glUniformMatrix2x4fv)
+       && FindProcShort (glUniformMatrix4x2fv)
+       && FindProcShort (glUniformMatrix3x4fv)
+       && FindProcShort (glUniformMatrix4x3fv)
+       && FindProcShort (glRenderbufferStorageMultisample)
+       && FindProcShort (glFramebufferTextureLayer)
+       && FindProcShort (glGetIntegeri_v)
+       && FindProcShort (glBeginTransformFeedback)
+       && FindProcShort (glEndTransformFeedback)
+       && FindProcShort (glBindBufferRange)
+       && FindProcShort (glBindBufferBase)
+       && FindProcShort (glTransformFeedbackVaryings)
+       && FindProcShort (glGetTransformFeedbackVarying)
+       && FindProcShort (glVertexAttribIPointer)
+       && FindProcShort (glGetVertexAttribIiv)
+       && FindProcShort (glGetVertexAttribIuiv)
+       && FindProcShort (glVertexAttribI4i)
+       && FindProcShort (glVertexAttribI4ui)
+       && FindProcShort (glVertexAttribI4iv)
+       && FindProcShort (glVertexAttribI4uiv)
+       && FindProcShort (glGetUniformuiv)
+       && FindProcShort (glGetFragDataLocation)
+       && FindProcShort (glUniform1ui)
+       && FindProcShort (glUniform2ui)
+       && FindProcShort (glUniform3ui)
+       && FindProcShort (glUniform4ui)
+       && FindProcShort (glUniform1uiv)
+       && FindProcShort (glUniform2uiv)
+       && FindProcShort (glUniform3uiv)
+       && FindProcShort (glUniform4uiv)
+       && FindProcShort (glClearBufferiv)
+       && FindProcShort (glClearBufferuiv)
+       && FindProcShort (glClearBufferfv)
+       && FindProcShort (glClearBufferfi)
+       && FindProcShort (glGetStringi)
+       && FindProcShort (glCopyBufferSubData)
+       && FindProcShort (glGetUniformIndices)
+       && FindProcShort (glGetActiveUniformsiv)
+       && FindProcShort (glGetUniformBlockIndex)
+       && FindProcShort (glGetActiveUniformBlockiv)
+       && FindProcShort (glGetActiveUniformBlockName)
+       && FindProcShort (glUniformBlockBinding)
+       && FindProcShort (glFenceSync)
+       && FindProcShort (glIsSync)
+       && FindProcShort (glDeleteSync)
+       && FindProcShort (glClientWaitSync)
+       && FindProcShort (glWaitSync)
+       && FindProcShort (glGetInteger64v)
+       && FindProcShort (glGetSynciv)
+       && FindProcShort (glGetInteger64i_v)
+       && FindProcShort (glGetBufferParameteri64v)
+       && FindProcShort (glBindTransformFeedback)
+       && FindProcShort (glDeleteTransformFeedbacks)
+       && FindProcShort (glGenTransformFeedbacks)
+       && FindProcShort (glIsTransformFeedback)
+       && FindProcShort (glPauseTransformFeedback)
+       && FindProcShort (glResumeTransformFeedback)
+       && FindProcShort (glGetProgramBinary)
+       && FindProcShort (glProgramBinary)
+       && FindProcShort (glProgramParameteri)
+       && FindProcShort (glInvalidateFramebuffer)
+       && FindProcShort (glInvalidateSubFramebuffer)
+       && FindProcShort (glTexStorage2D)
+       && FindProcShort (glTexStorage3D)
+       && FindProcShort (glGetInternalformativ);
+  if (!has30es)
+  {
+    checkWrongVersion (3, 0, aLastFailedProc);
+  }
+  else
+  {
+    core30    = (OpenGl_GlCore30*    )(&(*myFuncs));
+    core30fwd = (OpenGl_GlCore30Fwd* )(&(*myFuncs));
+  }
+
+  // load OpenGL ES 3.1 new functions
+  const bool has31es = IsGlGreaterEqual (3, 1)
+       && has30es
+       && FindProcShort (glDispatchCompute)
+       && FindProcShort (glDispatchComputeIndirect)
+       && FindProcShort (glDrawArraysIndirect)
+       && FindProcShort (glDrawElementsIndirect)
+       && FindProcShort (glFramebufferParameteri)
+       && FindProcShort (glGetFramebufferParameteriv)
+       && FindProcShort (glGetProgramInterfaceiv)
+       && FindProcShort (glGetProgramResourceIndex)
+       && FindProcShort (glGetProgramResourceName)
+       && FindProcShort (glGetProgramResourceiv)
+       && FindProcShort (glGetProgramResourceLocation)
+       && FindProcShort (glUseProgramStages)
+       && FindProcShort (glActiveShaderProgram)
+       && FindProcShort (glCreateShaderProgramv)
+       && FindProcShort (glBindProgramPipeline)
+       && FindProcShort (glDeleteProgramPipelines)
+       && FindProcShort (glGenProgramPipelines)
+       && FindProcShort (glIsProgramPipeline)
+       && FindProcShort (glGetProgramPipelineiv)
+       && FindProcShort (glProgramUniform1i)
+       && FindProcShort (glProgramUniform2i)
+       && FindProcShort (glProgramUniform3i)
+       && FindProcShort (glProgramUniform4i)
+       && FindProcShort (glProgramUniform1ui)
+       && FindProcShort (glProgramUniform2ui)
+       && FindProcShort (glProgramUniform3ui)
+       && FindProcShort (glProgramUniform4ui)
+       && FindProcShort (glProgramUniform1f)
+       && FindProcShort (glProgramUniform2f)
+       && FindProcShort (glProgramUniform3f)
+       && FindProcShort (glProgramUniform4f)
+       && FindProcShort (glProgramUniform1iv)
+       && FindProcShort (glProgramUniform2iv)
+       && FindProcShort (glProgramUniform3iv)
+       && FindProcShort (glProgramUniform4iv)
+       && FindProcShort (glProgramUniform1uiv)
+       && FindProcShort (glProgramUniform2uiv)
+       && FindProcShort (glProgramUniform3uiv)
+       && FindProcShort (glProgramUniform4uiv)
+       && FindProcShort (glProgramUniform1fv)
+       && FindProcShort (glProgramUniform2fv)
+       && FindProcShort (glProgramUniform3fv)
+       && FindProcShort (glProgramUniform4fv)
+       && FindProcShort (glProgramUniformMatrix2fv)
+       && FindProcShort (glProgramUniformMatrix3fv)
+       && FindProcShort (glProgramUniformMatrix4fv)
+       && FindProcShort (glProgramUniformMatrix2x3fv)
+       && FindProcShort (glProgramUniformMatrix3x2fv)
+       && FindProcShort (glProgramUniformMatrix2x4fv)
+       && FindProcShort (glProgramUniformMatrix4x2fv)
+       && FindProcShort (glProgramUniformMatrix3x4fv)
+       && FindProcShort (glProgramUniformMatrix4x3fv)
+       && FindProcShort (glValidateProgramPipeline)
+       && FindProcShort (glGetProgramPipelineInfoLog)
+       && FindProcShort (glBindImageTexture)
+       && FindProcShort (glGetBooleani_v)
+       && FindProcShort (glMemoryBarrier)
+       && FindProcShort (glMemoryBarrierByRegion)
+       && FindProcShort (glTexStorage2DMultisample)
+       && FindProcShort (glGetMultisamplefv)
+       && FindProcShort (glSampleMaski)
+       && FindProcShort (glGetTexLevelParameteriv)
+       && FindProcShort (glGetTexLevelParameterfv)
+       && FindProcShort (glBindVertexBuffer)
+       && FindProcShort (glVertexAttribFormat)
+       && FindProcShort (glVertexAttribIFormat)
+       && FindProcShort (glVertexAttribBinding)
+       && FindProcShort (glVertexBindingDivisor);
+  if (!has31es)
+  {
+    checkWrongVersion (3, 1, aLastFailedProc);
+  }
+
   // initialize debug context extension
-  if (CheckExtension ("GL_KHR_debug"))
+  if (IsGlGreaterEqual (3, 2)
+   || CheckExtension ("GL_KHR_debug"))
   {
     // this functionality become a part of OpenGL ES 3.2
     arbDbg = NULL;
+    if (IsGlGreaterEqual (3, 2)
+     && FindProcShort (glDebugMessageControl)
+     && FindProcShort (glDebugMessageInsert)
+     && FindProcShort (glDebugMessageCallback)
+     && FindProcShort (glGetDebugMessageLog))
+    {
+      arbDbg = (OpenGl_ArbDbg* )(&(*myFuncs));
+    }
     // According to GL_KHR_debug spec, all functions should have KHR suffix.
     // However, some implementations can export these functions without suffix.
-    if (FindProc ("glDebugMessageControlKHR",  myFuncs->glDebugMessageControl)
+    else if (!IsGlGreaterEqual (3, 2)
+     && FindProc ("glDebugMessageControlKHR",  myFuncs->glDebugMessageControl)
      && FindProc ("glDebugMessageInsertKHR",   myFuncs->glDebugMessageInsert)
      && FindProc ("glDebugMessageCallbackKHR", myFuncs->glDebugMessageCallback)
      && FindProc ("glGetDebugMessageLogKHR",   myFuncs->glGetDebugMessageLog))
@@ -1580,6 +1795,55 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
     }
   }
 
+  // load OpenGL ES 3.2 new functions
+  const bool has32es = IsGlGreaterEqual (3, 2)
+       && has31es
+       && hasTexBuffer32
+       && arbDbg != NULL
+       && FindProcShort (glBlendBarrier)
+       && FindProcShort (glCopyImageSubData)
+       && FindProcShort (glPushDebugGroup)
+       && FindProcShort (glPopDebugGroup)
+       && FindProcShort (glObjectLabel)
+       && FindProcShort (glGetObjectLabel)
+       && FindProcShort (glObjectPtrLabel)
+       && FindProcShort (glGetObjectPtrLabel)
+       && FindProcShort (glGetPointerv)
+       && FindProcShort (glEnablei)
+       && FindProcShort (glDisablei)
+       && FindProcShort (glBlendEquationi)
+       && FindProcShort (glBlendEquationSeparatei)
+       && FindProcShort (glBlendFunci)
+       && FindProcShort (glBlendFuncSeparatei)
+       && FindProcShort (glColorMaski)
+       && FindProcShort (glIsEnabledi)
+       && FindProcShort (glDrawElementsBaseVertex)
+       && FindProcShort (glDrawRangeElementsBaseVertex)
+       && FindProcShort (glDrawElementsInstancedBaseVertex)
+       && FindProcShort (glFramebufferTexture)
+       && FindProcShort (glPrimitiveBoundingBox)
+       && FindProcShort (glGetGraphicsResetStatus)
+       && FindProcShort (glReadnPixels)
+       && FindProcShort (glGetnUniformfv)
+       && FindProcShort (glGetnUniformiv)
+       && FindProcShort (glGetnUniformuiv)
+       && FindProcShort (glMinSampleShading)
+       && FindProcShort (glPatchParameteri)
+       && FindProcShort (glTexParameterIiv)
+       && FindProcShort (glTexParameterIuiv)
+       && FindProcShort (glGetTexParameterIiv)
+       && FindProcShort (glGetTexParameterIuiv)
+       && FindProcShort (glSamplerParameterIiv)
+       && FindProcShort (glSamplerParameterIuiv)
+       && FindProcShort (glGetSamplerParameterIiv)
+       && FindProcShort (glGetSamplerParameterIuiv)
+       && FindProcShort (glTexBufferRange)
+       && FindProcShort (glTexStorage3DMultisample);
+  if (!has32es)
+  {
+    checkWrongVersion (3, 2, aLastFailedProc);
+  }
+
   extDrawBuffers = CheckExtension ("GL_EXT_draw_buffers") && FindProc ("glDrawBuffersEXT", myFuncs->glDrawBuffers);
   arbDrawBuffers = CheckExtension ("GL_ARB_draw_buffers") && FindProc ("glDrawBuffersARB", myFuncs->glDrawBuffers);
 
@@ -2183,6 +2447,12 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
     // but doesn't hardware accelerated by some ancient OpenGL 2.1 hardware (GeForce FX, RadeOn 9700 etc.)
     arbNPTW  = Standard_True;
     arbTexRG = Standard_True;
+
+    if (!isCoreProfile)
+    {
+      core30 = (OpenGl_GlCore30* )(&(*myFuncs));
+    }
+    core30fwd = (OpenGl_GlCore30Fwd* )(&(*myFuncs));
   }
 
   // load OpenGL 3.1 new functions
index 7ba13a9..fd16e49 100644 (file)
@@ -1023,6 +1023,8 @@ public: //! @name core profiles
   OpenGl_GlCore15Fwd*  core15fwd;  //!< OpenGL 1.5 without deprecated entry points
   OpenGl_GlCore20*     core20;     //!< OpenGL 2.0 core functionality (includes 1.5)
   OpenGl_GlCore20Fwd*  core20fwd;  //!< OpenGL 2.0 without deprecated entry points
+  OpenGl_GlCore30*     core30;     //!< OpenGL 3.0 core functionality
+  OpenGl_GlCore30Fwd*  core30fwd;  //!< OpenGL 3.0 without deprecated entry points
   OpenGl_GlCore32*     core32;     //!< OpenGL 3.2 core profile
   OpenGl_GlCore32Back* core32back; //!< OpenGL 3.2 backward compatibility profile
   OpenGl_GlCore33*     core33;     //!< OpenGL 3.3 core profile
@@ -1062,10 +1064,10 @@ public: //! @name extensions
   Standard_Boolean       arbTexFloat;        //!< GL_ARB_texture_float (on desktop OpenGL - since 3.0 or as extension GL_ARB_texture_float; on OpenGL ES - since 3.0); @sa hasTexFloatLinear for linear filtering support
   OpenGl_ArbSamplerObject* arbSamplerObject; //!< GL_ARB_sampler_objects (on desktop OpenGL - since 3.3 or as extension GL_ARB_sampler_objects; on OpenGL ES - since 3.0)
   OpenGl_ArbTexBindless* arbTexBindless;     //!< GL_ARB_bindless_texture
-  OpenGl_ArbTBO*         arbTBO;             //!< GL_ARB_texture_buffer_object
+  OpenGl_ArbTBO*         arbTBO;             //!< GL_ARB_texture_buffer_object (on desktop OpenGL - since 3.1 or as extension GL_ARB_texture_buffer_object; on OpenGL ES - since 3.2)
   Standard_Boolean       arbTboRGB32;        //!< GL_ARB_texture_buffer_object_rgb32 (3-component TBO), in core since 4.0
-  OpenGl_ArbIns*         arbIns;             //!< GL_ARB_draw_instanced
-  OpenGl_ArbDbg*         arbDbg;             //!< GL_ARB_debug_output
+  OpenGl_ArbIns*         arbIns;             //!< GL_ARB_draw_instanced (on desktop OpenGL - since 3.1 or as extebsion GL_ARB_draw_instanced; on OpenGL ES - since 3.0 or as extension GL_ANGLE_instanced_arrays to WebGL 1.0)
+  OpenGl_ArbDbg*         arbDbg;             //!< GL_ARB_debug_output (on desktop OpenGL - since 4.3 or as extension GL_ARB_debug_output; on OpenGL ES - since 3.2 or as extension GL_KHR_debug)
   OpenGl_ArbFBO*         arbFBO;             //!< GL_ARB_framebuffer_object
   OpenGl_ArbFBOBlit*     arbFBOBlit;         //!< glBlitFramebuffer function, moved out from OpenGl_ArbFBO structure for compatibility with OpenGL ES 2.0
   Standard_Boolean       arbSampleShading;   //!< GL_ARB_sample_shading
diff --git a/src/OpenGl/OpenGl_GLESExtensions.hxx b/src/OpenGl/OpenGl_GLESExtensions.hxx
new file mode 100644 (file)
index 0000000..03fb90b
--- /dev/null
@@ -0,0 +1,352 @@
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _OpenGl_GLESExtensions_Header
+#define _OpenGl_GLESExtensions_Header
+
+// define items to unify code paths with desktop OpenGL
+typedef double GLdouble;
+typedef double GLclampd;
+
+// GL_EXT_sRGB_write_control extension for OpenGL ES
+// adds GL_FRAMEBUFFER_SRGB_EXT flag as on desktop OpenGL
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+
+// OpenGL ES 3.1+
+#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
+
+// OpenGL ES 3.2+ or GL_EXT_texture_buffer for OpenGL ES 3.1+
+#define GL_TEXTURE_BUFFER 0x8C2A
+
+// in core since OpenGL ES 3.0, extension GL_OES_rgb8_rgba8
+#define GL_LUMINANCE8   0x8040
+// GL_EXT_texture_format_BGRA8888
+#define GL_BGRA_EXT     0x80E1 // same as GL_BGRA on desktop
+
+#define GL_R16          0x822A
+#define GL_RGB4         0x804F
+#define GL_RGB5         0x8050
+#define GL_RGB10        0x8052
+#define GL_RGB12        0x8053
+#define GL_RGB16        0x8054
+#define GL_RGB10_A2     0x8059
+#define GL_RGBA12       0x805A
+#define GL_RGBA16       0x805B
+#define GL_ALPHA8       0x803C
+#define GL_ALPHA16      0x803E
+#define GL_RG16         0x822C
+
+#define GL_R16_SNORM    0x8F98
+#define GL_RG16_SNORM   0x8F99
+#define GL_RGB16_SNORM  0x8F9A
+#define GL_RGBA16_SNORM 0x8F9B
+
+#define GL_RED_SNORM    0x8F90
+#define GL_RG_SNORM     0x8F91
+#define GL_RGB_SNORM    0x8F92
+#define GL_RGBA_SNORM   0x8F93
+
+// GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+
+// debug ARB extension
+#define GL_DEBUG_OUTPUT               0x92E0
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS   0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION    0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM  0x8245
+#define GL_DEBUG_SOURCE_API           0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY   0x8249
+#define GL_DEBUG_SOURCE_APPLICATION   0x824A
+#define GL_DEBUG_SOURCE_OTHER         0x824B
+#define GL_DEBUG_TYPE_ERROR           0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR  0x824E
+#define GL_DEBUG_TYPE_PORTABILITY     0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE     0x8250
+#define GL_DEBUG_TYPE_OTHER           0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH   0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES  0x9144
+#define GL_DEBUG_LOGGED_MESSAGES      0x9145
+#define GL_DEBUG_SEVERITY_HIGH        0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM      0x9147
+#define GL_DEBUG_SEVERITY_LOW         0x9148
+
+// OpenGL ES 3.0+ or OES_texture_half_float
+#define GL_HALF_FLOAT_OES             0x8D61
+
+// OpenGL ES 3.1+
+#define GL_COMPUTE_SHADER             0x91B9
+
+// OpenGL ES 3.2+
+#define GL_GEOMETRY_SHADER            0x8DD9
+#define GL_TESS_CONTROL_SHADER        0x8E88
+#define GL_TESS_EVALUATION_SHADER     0x8E87
+#define GL_LINES_ADJACENCY            0x000A
+#define GL_LINE_STRIP_ADJACENCY       0x000B
+#define GL_TRIANGLES_ADJACENCY        0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY   0x000D
+#define GL_PATCHES                    0x000E
+
+// GL_EXT_texture_compression_s3tc extension
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT  0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+//
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+
+#ifndef GL_APIENTRYP
+  #define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+// put into namespace to avoid collisions with system headers
+namespace opencascade
+{
+
+//#ifndef GL_ES_VERSION_3_0
+typedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum src);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (GL_APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (GL_APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GL_APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+typedef void (GL_APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+typedef GLuint (GL_APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+typedef void (GL_APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (GL_APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
+typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
+typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
+typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
+typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
+typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
+typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+typedef void (GL_APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
+typedef void (GL_APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+//#endif GL_ES_VERSION_3_0
+
+//#ifndef GL_ES_VERSION_3_1
+typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+typedef GLuint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
+typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
+typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (GL_APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
+typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
+typedef void (GL_APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
+//#endif GL_ES_VERSION_3_1
+
+//#ifndef GL_ES_VERSION_3_2
+typedef void (GL_APIENTRY  *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GL_APIENTRYP PFNGLBLENDBARRIERPROC) (void);
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
+typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
+typedef void (GL_APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params);
+typedef void (GL_APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
+typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+//#endif GL_ES_VERSION_3_2
+
+} // namespace opencascade
+
+#endif // _OpenGl_GLESExtensions_Header
index 2213b9e..cede88f 100644 (file)
@@ -28,8 +28,6 @@ struct OpenGl_TmplCore30 : public theBaseClass_t
 
 public: //! @name GL_ARB_framebuffer_object (added to OpenGL 3.0 core)
 
-#if !defined(GL_ES_VERSION_2_0)
-
   using theBaseClass_t::glIsRenderbuffer;
   using theBaseClass_t::glBindRenderbuffer;
   using theBaseClass_t::glDeleteRenderbuffers;
@@ -41,15 +39,17 @@ public: //! @name GL_ARB_framebuffer_object (added to OpenGL 3.0 core)
   using theBaseClass_t::glDeleteFramebuffers;
   using theBaseClass_t::glGenFramebuffers;
   using theBaseClass_t::glCheckFramebufferStatus;
-  using theBaseClass_t::glFramebufferTexture1D;
   using theBaseClass_t::glFramebufferTexture2D;
-  using theBaseClass_t::glFramebufferTexture3D;
   using theBaseClass_t::glFramebufferRenderbuffer;
   using theBaseClass_t::glGetFramebufferAttachmentParameteriv;
   using theBaseClass_t::glGenerateMipmap;
   using theBaseClass_t::glBlitFramebuffer;
   using theBaseClass_t::glRenderbufferStorageMultisample;
   using theBaseClass_t::glFramebufferTextureLayer;
+#if !defined(GL_ES_VERSION_2_0)
+  using theBaseClass_t::glFramebufferTexture1D;
+  using theBaseClass_t::glFramebufferTexture3D;
+#endif
 
 public: //! @name GL_ARB_vertex_array_object (added to OpenGL 3.0 core)
 
@@ -65,46 +65,22 @@ public: //! @name GL_ARB_map_buffer_range (added to OpenGL 3.0 core)
 
 public: //! @name OpenGL 3.0 additives to 2.1
 
-  using theBaseClass_t::glColorMaski;
   using theBaseClass_t::glGetBooleani_v;
   using theBaseClass_t::glGetIntegeri_v;
-  using theBaseClass_t::glEnablei;
-  using theBaseClass_t::glDisablei;
-  using theBaseClass_t::glIsEnabledi;
   using theBaseClass_t::glBeginTransformFeedback;
   using theBaseClass_t::glEndTransformFeedback;
   using theBaseClass_t::glBindBufferRange;
   using theBaseClass_t::glBindBufferBase;
   using theBaseClass_t::glTransformFeedbackVaryings;
   using theBaseClass_t::glGetTransformFeedbackVarying;
-  using theBaseClass_t::glClampColor;
-  using theBaseClass_t::glBeginConditionalRender;
-  using theBaseClass_t::glEndConditionalRender;
   using theBaseClass_t::glVertexAttribIPointer;
   using theBaseClass_t::glGetVertexAttribIiv;
   using theBaseClass_t::glGetVertexAttribIuiv;
-  using theBaseClass_t::glVertexAttribI1i;
-  using theBaseClass_t::glVertexAttribI2i;
-  using theBaseClass_t::glVertexAttribI3i;
   using theBaseClass_t::glVertexAttribI4i;
-  using theBaseClass_t::glVertexAttribI1ui;
-  using theBaseClass_t::glVertexAttribI2ui;
-  using theBaseClass_t::glVertexAttribI3ui;
   using theBaseClass_t::glVertexAttribI4ui;
-  using theBaseClass_t::glVertexAttribI1iv;
-  using theBaseClass_t::glVertexAttribI2iv;
-  using theBaseClass_t::glVertexAttribI3iv;
   using theBaseClass_t::glVertexAttribI4iv;
-  using theBaseClass_t::glVertexAttribI1uiv;
-  using theBaseClass_t::glVertexAttribI2uiv;
-  using theBaseClass_t::glVertexAttribI3uiv;
   using theBaseClass_t::glVertexAttribI4uiv;
-  using theBaseClass_t::glVertexAttribI4bv;
-  using theBaseClass_t::glVertexAttribI4sv;
-  using theBaseClass_t::glVertexAttribI4ubv;
-  using theBaseClass_t::glVertexAttribI4usv;
   using theBaseClass_t::glGetUniformuiv;
-  using theBaseClass_t::glBindFragDataLocation;
   using theBaseClass_t::glGetFragDataLocation;
   using theBaseClass_t::glUniform1ui;
   using theBaseClass_t::glUniform2ui;
@@ -114,18 +90,48 @@ public: //! @name OpenGL 3.0 additives to 2.1
   using theBaseClass_t::glUniform2uiv;
   using theBaseClass_t::glUniform3uiv;
   using theBaseClass_t::glUniform4uiv;
-  using theBaseClass_t::glTexParameterIiv;
-  using theBaseClass_t::glTexParameterIuiv;
-  using theBaseClass_t::glGetTexParameterIiv;
-  using theBaseClass_t::glGetTexParameterIuiv;
   using theBaseClass_t::glClearBufferiv;
   using theBaseClass_t::glClearBufferuiv;
   using theBaseClass_t::glClearBufferfv;
   using theBaseClass_t::glClearBufferfi;
   using theBaseClass_t::glGetStringi;
 
+#if !defined(GL_ES_VERSION_2_0)
+  // the following have been added only in OpenGL ES 3.2
+  using theBaseClass_t::glColorMaski;
+  using theBaseClass_t::glEnablei;
+  using theBaseClass_t::glDisablei;
+  using theBaseClass_t::glIsEnabledi;
+
+  using theBaseClass_t::glTexParameterIiv;
+  using theBaseClass_t::glTexParameterIuiv;
+  using theBaseClass_t::glGetTexParameterIiv;
+  using theBaseClass_t::glGetTexParameterIuiv;
 #endif
 
+#if !defined(GL_ES_VERSION_2_0)
+  // the following are defined only on desktop OpenGL
+  using theBaseClass_t::glClampColor;
+  using theBaseClass_t::glBeginConditionalRender;
+  using theBaseClass_t::glEndConditionalRender;
+  using theBaseClass_t::glBindFragDataLocation;
+  using theBaseClass_t::glVertexAttribI1i;
+  using theBaseClass_t::glVertexAttribI2i;
+  using theBaseClass_t::glVertexAttribI3i;
+  using theBaseClass_t::glVertexAttribI1ui;
+  using theBaseClass_t::glVertexAttribI2ui;
+  using theBaseClass_t::glVertexAttribI3ui;
+  using theBaseClass_t::glVertexAttribI1iv;
+  using theBaseClass_t::glVertexAttribI2iv;
+  using theBaseClass_t::glVertexAttribI3iv;
+  using theBaseClass_t::glVertexAttribI1uiv;
+  using theBaseClass_t::glVertexAttribI2uiv;
+  using theBaseClass_t::glVertexAttribI3uiv;
+  using theBaseClass_t::glVertexAttribI4bv;
+  using theBaseClass_t::glVertexAttribI4sv;
+  using theBaseClass_t::glVertexAttribI4ubv;
+  using theBaseClass_t::glVertexAttribI4usv;
+#endif
 };
 
 //! OpenGL 3.0 core based on 2.1 version.
index 3a1c52b..4092662 100644 (file)
@@ -23,17 +23,17 @@ template<typename theBaseClass_t>
 struct OpenGl_TmplCore31 : public theBaseClass_t
 {
 
-#if !defined(GL_ES_VERSION_2_0)
-
 public: //! @name GL_ARB_uniform_buffer_object (added to OpenGL 3.1 core)
 
   using theBaseClass_t::glGetUniformIndices;
   using theBaseClass_t::glGetActiveUniformsiv;
-  using theBaseClass_t::glGetActiveUniformName;
   using theBaseClass_t::glGetUniformBlockIndex;
   using theBaseClass_t::glGetActiveUniformBlockiv;
   using theBaseClass_t::glGetActiveUniformBlockName;
   using theBaseClass_t::glUniformBlockBinding;
+#if !defined(GL_ES_VERSION_2_0)
+  using theBaseClass_t::glGetActiveUniformName; // undefined in OpenGL ES
+#endif
 
 public: //! @name GL_ARB_copy_buffer (added to OpenGL 3.1 core)
 
@@ -43,9 +43,9 @@ public: //! @name OpenGL 3.1 additives to 3.0
 
   using theBaseClass_t::glDrawArraysInstanced;
   using theBaseClass_t::glDrawElementsInstanced;
-  using theBaseClass_t::glTexBuffer;
-  using theBaseClass_t::glPrimitiveRestartIndex;
-
+#if !defined(GL_ES_VERSION_2_0)
+  using theBaseClass_t::glTexBuffer; // added in OpenGL ES 3.2
+  using theBaseClass_t::glPrimitiveRestartIndex; // undefined in OpenGL ES
 #endif
 
 };
index 0c3136e..814464e 100644 (file)
   #include <GL/gl.h>
 #endif
 
-#if defined(GL_ES_VERSION_2_0)
-  // define items to unify code paths with desktop OpenGL
-  typedef double GLdouble;
-  typedef double GLclampd;
-
-  // GL_EXT_sRGB_write_control extension for OpenGL ES
-  // adds GL_FRAMEBUFFER_SRGB_EXT flag as on desktop OpenGL
-  #define GL_FRAMEBUFFER_SRGB 0x8DB9
-
-  // OpenGL ES 3.1+
-  #define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-
-  // OpenGL ES 3.2+ or GL_EXT_texture_buffer for OpenGL ES 3.1+
-  #define GL_TEXTURE_BUFFER 0x8C2A
-
-  // in core since OpenGL ES 3.0, extension GL_OES_rgb8_rgba8
-  #define GL_LUMINANCE8   0x8040
-  // GL_EXT_texture_format_BGRA8888
-  #define GL_BGRA_EXT     0x80E1 // same as GL_BGRA on desktop
-
-  #define GL_R16          0x822A
-  #define GL_RGB4         0x804F
-  #define GL_RGB5         0x8050
-  #define GL_RGB10        0x8052
-  #define GL_RGB12        0x8053
-  #define GL_RGB16        0x8054
-  #define GL_RGB10_A2     0x8059
-  #define GL_RGBA12       0x805A
-  #define GL_RGBA16       0x805B
-  #define GL_ALPHA8       0x803C
-  #define GL_ALPHA16      0x803E
-  #define GL_RG16         0x822C
-
-  #define GL_R16_SNORM    0x8F98
-  #define GL_RG16_SNORM   0x8F99
-  #define GL_RGB16_SNORM  0x8F9A
-  #define GL_RGBA16_SNORM 0x8F9B
-
-  #define GL_RED_SNORM    0x8F90
-  #define GL_RG_SNORM     0x8F91
-  #define GL_RGB_SNORM    0x8F92
-  #define GL_RGBA_SNORM   0x8F93
-
-  // GL_EXT_texture_filter_anisotropic
-  #define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
-  #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-
-  // debug ARB extension
-  #define GL_DEBUG_OUTPUT               0x92E0
-  #define GL_DEBUG_OUTPUT_SYNCHRONOUS   0x8242
-  #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-  #define GL_DEBUG_CALLBACK_FUNCTION    0x8244
-  #define GL_DEBUG_CALLBACK_USER_PARAM  0x8245
-  #define GL_DEBUG_SOURCE_API           0x8246
-  #define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-  #define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-  #define GL_DEBUG_SOURCE_THIRD_PARTY   0x8249
-  #define GL_DEBUG_SOURCE_APPLICATION   0x824A
-  #define GL_DEBUG_SOURCE_OTHER         0x824B
-  #define GL_DEBUG_TYPE_ERROR           0x824C
-  #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-  #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR  0x824E
-  #define GL_DEBUG_TYPE_PORTABILITY     0x824F
-  #define GL_DEBUG_TYPE_PERFORMANCE     0x8250
-  #define GL_DEBUG_TYPE_OTHER           0x8251
-  #define GL_MAX_DEBUG_MESSAGE_LENGTH   0x9143
-  #define GL_MAX_DEBUG_LOGGED_MESSAGES  0x9144
-  #define GL_DEBUG_LOGGED_MESSAGES      0x9145
-  #define GL_DEBUG_SEVERITY_HIGH        0x9146
-  #define GL_DEBUG_SEVERITY_MEDIUM      0x9147
-  #define GL_DEBUG_SEVERITY_LOW         0x9148
-
-  // OpenGL ES 3.0+ or OES_texture_half_float
-  #define GL_HALF_FLOAT_OES             0x8D61
-
-  // OpenGL ES 3.1+
-  #define GL_COMPUTE_SHADER             0x91B9
-
-  // OpenGL ES 3.2+
-  #define GL_GEOMETRY_SHADER            0x8DD9
-  #define GL_TESS_CONTROL_SHADER        0x8E88
-  #define GL_TESS_EVALUATION_SHADER     0x8E87
-  #define GL_LINES_ADJACENCY            0x000A
-  #define GL_LINE_STRIP_ADJACENCY       0x000B
-  #define GL_TRIANGLES_ADJACENCY        0x000C
-  #define GL_TRIANGLE_STRIP_ADJACENCY   0x000D
-  #define GL_PATCHES                    0x000E
-
-  // GL_EXT_texture_compression_s3tc extension
-  #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT  0x83F0
-  #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-  #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-  #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-  //
-  #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
-  #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-  #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-  #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-#endif
-
 #if !defined(HAVE_EGL) && (defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(HAVE_GLES2) || defined(OCCT_UWP))
   #define HAVE_EGL
 #endif
 
 #include <InterfaceGraphic.hxx>
 
-// GL version can be defined by system gl.h header
-#if !defined(GL_ES_VERSION_2_0)
+#if defined(GL_ES_VERSION_2_0)
+  #include <OpenGl_GLESExtensions.hxx>
+#else
+  // GL version can be defined by system gl.h header
   #undef GL_VERSION_1_2
   #undef GL_VERSION_1_3
   #undef GL_VERSION_1_4
@@ -723,75 +625,231 @@ public: //! @name OpenGL ES 2.0
 
 public: //! @name OpenGL ES 3.0
 
-  typedef void (APIENTRY *glBlitFramebuffer_t)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-  glBlitFramebuffer_t glBlitFramebuffer;
-
-  typedef void (APIENTRY *glTexImage3D_t)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data);
-  glTexImage3D_t glTexImage3D;
-
-  typedef void (APIENTRY *glDrawBuffers_t)(GLsizei n, const GLenum* bufs);
-  glDrawBuffers_t glDrawBuffers;
-
-  typedef void (APIENTRY *glGenSamplers_t)(GLsizei count, GLuint* samplers);
-  glGenSamplers_t glGenSamplers;
-
-  typedef void (APIENTRY *glDeleteSamplers_t)(GLsizei count, const GLuint* samplers);
-  glDeleteSamplers_t glDeleteSamplers;
-
-  typedef GLboolean (APIENTRY *glIsSampler_t)(GLuint sampler);
-  glIsSampler_t glIsSampler;
-
-  typedef void (APIENTRY *glBindSampler_t)(GLuint unit, GLuint sampler);
-  glBindSampler_t glBindSampler;
-
-  typedef void (APIENTRY *glSamplerParameteri_t)(GLuint sampler, GLenum pname, GLint param);
-  glSamplerParameteri_t glSamplerParameteri;
-
-  typedef void (APIENTRY *glSamplerParameteriv_t)(GLuint sampler, GLenum pname, const GLint* param);
-  glSamplerParameteriv_t glSamplerParameteriv;
-
-  typedef void (APIENTRY *glSamplerParameterf_t)(GLuint sampler, GLenum pname, GLfloat param);
-  glSamplerParameterf_t glSamplerParameterf;
-
-  typedef void (APIENTRY *glSamplerParameterfv_t)(GLuint sampler, GLenum pname, const GLfloat* param);
-  glSamplerParameterfv_t glSamplerParameterfv;
-
-  typedef void (APIENTRY *glGetSamplerParameteriv_t)(GLuint sampler, GLenum pname, GLint* params);
-  glGetSamplerParameteriv_t glGetSamplerParameteriv;
-
-  typedef void (APIENTRY *glGetSamplerParameterfv_t)(GLuint sampler, GLenum pname, GLfloat* params);
-  glGetSamplerParameterfv_t glGetSamplerParameterfv;
+  opencascade::PFNGLREADBUFFERPROC glReadBuffer;
+  opencascade::PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements;
+  opencascade::PFNGLTEXIMAGE3DPROC glTexImage3D;
+  opencascade::PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D;
+  opencascade::PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D;
+  opencascade::PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D;
+  opencascade::PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D;
+  opencascade::PFNGLGENQUERIESPROC glGenQueries;
+  opencascade::PFNGLDELETEQUERIESPROC glDeleteQueries;
+  opencascade::PFNGLISQUERYPROC    glIsQuery;
+  opencascade::PFNGLBEGINQUERYPROC glBeginQuery;
+  opencascade::PFNGLENDQUERYPROC   glEndQuery;
+  opencascade::PFNGLGETQUERYIVPROC glGetQueryiv;
+  opencascade::PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv;
+  opencascade::PFNGLUNMAPBUFFERPROC glUnmapBuffer;
+  opencascade::PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv;
+  opencascade::PFNGLDRAWBUFFERSPROC glDrawBuffers;
+  opencascade::PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv;
+  opencascade::PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv;
+  opencascade::PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv;
+  opencascade::PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv;
+  opencascade::PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv;
+  opencascade::PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv;
+  opencascade::PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
+  opencascade::PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
+  opencascade::PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer;
+  opencascade::PFNGLMAPBUFFERRANGEPROC  glMapBufferRange;
+  opencascade::PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange;
+  opencascade::PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
+  opencascade::PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
+  opencascade::PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
+  opencascade::PFNGLISVERTEXARRAYPROC   glIsVertexArray;
+  opencascade::PFNGLGETINTEGERI_VPROC   glGetIntegeri_v;
+  opencascade::PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback;
+  opencascade::PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback;
+  opencascade::PFNGLBINDBUFFERRANGEPROC glBindBufferRange;
+  opencascade::PFNGLBINDBUFFERBASEPROC  glBindBufferBase;
+  opencascade::PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings;
+  opencascade::PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glGetTransformFeedbackVarying;
+  opencascade::PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
+  opencascade::PFNGLGETVERTEXATTRIBIIVPROC   glGetVertexAttribIiv;
+  opencascade::PFNGLGETVERTEXATTRIBIUIVPROC  glGetVertexAttribIuiv;
+  opencascade::PFNGLVERTEXATTRIBI4IPROC   glVertexAttribI4i;
+  opencascade::PFNGLVERTEXATTRIBI4UIPROC  glVertexAttribI4ui;
+  opencascade::PFNGLVERTEXATTRIBI4IVPROC  glVertexAttribI4iv;
+  opencascade::PFNGLVERTEXATTRIBI4UIVPROC glVertexAttribI4uiv;
+  opencascade::PFNGLGETUNIFORMUIVPROC glGetUniformuiv;
+  opencascade::PFNGLGETFRAGDATALOCATIONPROC glGetFragDataLocation;
+  opencascade::PFNGLUNIFORM1UIPROC glUniform1ui;
+  opencascade::PFNGLUNIFORM2UIPROC glUniform2ui;
+  opencascade::PFNGLUNIFORM3UIPROC glUniform3ui;
+  opencascade::PFNGLUNIFORM4UIPROC glUniform4ui;
+  opencascade::PFNGLUNIFORM1UIVPROC glUniform1uiv;
+  opencascade::PFNGLUNIFORM2UIVPROC glUniform2uiv;
+  opencascade::PFNGLUNIFORM3UIVPROC glUniform3uiv;
+  opencascade::PFNGLUNIFORM4UIVPROC glUniform4uiv;
+  opencascade::PFNGLCLEARBUFFERIVPROC  glClearBufferiv;
+  opencascade::PFNGLCLEARBUFFERUIVPROC glClearBufferuiv;
+  opencascade::PFNGLCLEARBUFFERFVPROC  glClearBufferfv;
+  opencascade::PFNGLCLEARBUFFERFIPROC  glClearBufferfi;
+  opencascade::PFNGLGETSTRINGIPROC glGetStringi;
+  opencascade::PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData;
+  opencascade::PFNGLGETUNIFORMINDICESPROC glGetUniformIndices;
+  opencascade::PFNGLGETACTIVEUNIFORMSIVPROC  glGetActiveUniformsiv;
+  opencascade::PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex;
+  opencascade::PFNGLGETACTIVEUNIFORMBLOCKIVPROC   glGetActiveUniformBlockiv;
+  opencascade::PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName;
+  opencascade::PFNGLUNIFORMBLOCKBINDINGPROC   glUniformBlockBinding;
+  opencascade::PFNGLDRAWARRAYSINSTANCEDPROC   glDrawArraysInstanced;
+  opencascade::PFNGLDRAWELEMENTSINSTANCEDPROC glDrawElementsInstanced;
+  opencascade::PFNGLFENCESYNCPROC      glFenceSync;
+  opencascade::PFNGLISSYNCPROC         glIsSync;
+  opencascade::PFNGLDELETESYNCPROC     glDeleteSync;
+  opencascade::PFNGLCLIENTWAITSYNCPROC glClientWaitSync;
+  opencascade::PFNGLWAITSYNCPROC       glWaitSync;
+  opencascade::PFNGLGETINTEGER64VPROC  glGetInteger64v;
+  opencascade::PFNGLGETSYNCIVPROC      glGetSynciv;
+  opencascade::PFNGLGETINTEGER64I_VPROC glGetInteger64i_v;
+  opencascade::PFNGLGETBUFFERPARAMETERI64VPROC glGetBufferParameteri64v;
+  opencascade::PFNGLGENSAMPLERSPROC glGenSamplers;
+  opencascade::PFNGLDELETESAMPLERSPROC glDeleteSamplers;
+  opencascade::PFNGLISSAMPLERPROC   glIsSampler;
+  opencascade::PFNGLBINDSAMPLERPROC glBindSampler;
+  opencascade::PFNGLSAMPLERPARAMETERIPROC  glSamplerParameteri;
+  opencascade::PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv;
+  opencascade::PFNGLSAMPLERPARAMETERFPROC  glSamplerParameterf;
+  opencascade::PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv;
+  opencascade::PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv;
+  opencascade::PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv;
+  opencascade::PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor;
+  opencascade::PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback;
+  opencascade::PFNGLDELETETRANSFORMFEEDBACKSPROC glDeleteTransformFeedbacks;
+  opencascade::PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks;
+  opencascade::PFNGLISTRANSFORMFEEDBACKPROC glIsTransformFeedback;
+  opencascade::PFNGLPAUSETRANSFORMFEEDBACKPROC glPauseTransformFeedback;
+  opencascade::PFNGLRESUMETRANSFORMFEEDBACKPROC glResumeTransformFeedback;
+  opencascade::PFNGLGETPROGRAMBINARYPROC glGetProgramBinary;
+  opencascade::PFNGLPROGRAMBINARYPROC glProgramBinary;
+  opencascade::PFNGLPROGRAMPARAMETERIPROC glProgramParameteri;
+  opencascade::PFNGLINVALIDATEFRAMEBUFFERPROC glInvalidateFramebuffer;
+  opencascade::PFNGLINVALIDATESUBFRAMEBUFFERPROC glInvalidateSubFramebuffer;
+  opencascade::PFNGLTEXSTORAGE2DPROC glTexStorage2D;
+  opencascade::PFNGLTEXSTORAGE3DPROC glTexStorage3D;
+  opencascade::PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ;
 
 public: //! @name OpenGL ES 3.1
 
-  typedef void (APIENTRY *glTexStorage2DMultisample_t)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-  glTexStorage2DMultisample_t glTexStorage2DMultisample;
+  opencascade::PFNGLDISPATCHCOMPUTEPROC glDispatchCompute;
+  opencascade::PFNGLDISPATCHCOMPUTEINDIRECTPROC glDispatchComputeIndirect;
+  opencascade::PFNGLDRAWARRAYSINDIRECTPROC glDrawArraysIndirect;
+  opencascade::PFNGLDRAWELEMENTSINDIRECTPROC glDrawElementsIndirect;
+  opencascade::PFNGLFRAMEBUFFERPARAMETERIPROC glFramebufferParameteri;
+  opencascade::PFNGLGETFRAMEBUFFERPARAMETERIVPROC glGetFramebufferParameteriv;
+  opencascade::PFNGLGETPROGRAMINTERFACEIVPROC glGetProgramInterfaceiv;
+  opencascade::PFNGLGETPROGRAMRESOURCEINDEXPROC glGetProgramResourceIndex;
+  opencascade::PFNGLGETPROGRAMRESOURCENAMEPROC glGetProgramResourceName;
+  opencascade::PFNGLGETPROGRAMRESOURCEIVPROC glGetProgramResourceiv;
+  opencascade::PFNGLGETPROGRAMRESOURCELOCATIONPROC glGetProgramResourceLocation;
+  opencascade::PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
+  opencascade::PFNGLACTIVESHADERPROGRAMPROC glActiveShaderProgram;
+  opencascade::PFNGLCREATESHADERPROGRAMVPROC glCreateShaderProgramv;
+  opencascade::PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline;
+  opencascade::PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines;
+  opencascade::PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
+  opencascade::PFNGLISPROGRAMPIPELINEPROC glIsProgramPipeline;
+  opencascade::PFNGLGETPROGRAMPIPELINEIVPROC glGetProgramPipelineiv;
+  opencascade::PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i;
+  opencascade::PFNGLPROGRAMUNIFORM2IPROC glProgramUniform2i;
+  opencascade::PFNGLPROGRAMUNIFORM3IPROC glProgramUniform3i;
+  opencascade::PFNGLPROGRAMUNIFORM4IPROC glProgramUniform4i;
+  opencascade::PFNGLPROGRAMUNIFORM1UIPROC glProgramUniform1ui;
+  opencascade::PFNGLPROGRAMUNIFORM2UIPROC glProgramUniform2ui;
+  opencascade::PFNGLPROGRAMUNIFORM3UIPROC glProgramUniform3ui;
+  opencascade::PFNGLPROGRAMUNIFORM4UIPROC glProgramUniform4ui;
+  opencascade::PFNGLPROGRAMUNIFORM1FPROC glProgramUniform1f;
+  opencascade::PFNGLPROGRAMUNIFORM2FPROC glProgramUniform2f;
+  opencascade::PFNGLPROGRAMUNIFORM3FPROC glProgramUniform3f;
+  opencascade::PFNGLPROGRAMUNIFORM4FPROC glProgramUniform4f;
+  opencascade::PFNGLPROGRAMUNIFORM1IVPROC glProgramUniform1iv;
+  opencascade::PFNGLPROGRAMUNIFORM2IVPROC glProgramUniform2iv;
+  opencascade::PFNGLPROGRAMUNIFORM3IVPROC glProgramUniform3iv;
+  opencascade::PFNGLPROGRAMUNIFORM4IVPROC glProgramUniform4iv;
+  opencascade::PFNGLPROGRAMUNIFORM1UIVPROC glProgramUniform1uiv;
+  opencascade::PFNGLPROGRAMUNIFORM2UIVPROC glProgramUniform2uiv;
+  opencascade::PFNGLPROGRAMUNIFORM3UIVPROC glProgramUniform3uiv;
+  opencascade::PFNGLPROGRAMUNIFORM4UIVPROC glProgramUniform4uiv;
+  opencascade::PFNGLPROGRAMUNIFORM1FVPROC glProgramUniform1fv;
+  opencascade::PFNGLPROGRAMUNIFORM2FVPROC glProgramUniform2fv;
+  opencascade::PFNGLPROGRAMUNIFORM3FVPROC glProgramUniform3fv;
+  opencascade::PFNGLPROGRAMUNIFORM4FVPROC glProgramUniform4fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX2FVPROC glProgramUniformMatrix2fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX3FVPROC glProgramUniformMatrix3fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX4FVPROC glProgramUniformMatrix4fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glProgramUniformMatrix2x3fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glProgramUniformMatrix3x2fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glProgramUniformMatrix2x4fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glProgramUniformMatrix4x2fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glProgramUniformMatrix3x4fv;
+  opencascade::PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glProgramUniformMatrix4x3fv;
+  opencascade::PFNGLVALIDATEPROGRAMPIPELINEPROC glValidateProgramPipeline;
+  opencascade::PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog;
+  opencascade::PFNGLBINDIMAGETEXTUREPROC glBindImageTexture;
+  opencascade::PFNGLGETBOOLEANI_VPROC glGetBooleani_v;
+  opencascade::PFNGLMEMORYBARRIERPROC glMemoryBarrier;
+  opencascade::PFNGLMEMORYBARRIERBYREGIONPROC glMemoryBarrierByRegion;
+  opencascade::PFNGLTEXSTORAGE2DMULTISAMPLEPROC glTexStorage2DMultisample;
+  opencascade::PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
+  opencascade::PFNGLSAMPLEMASKIPROC glSampleMaski;
+  opencascade::PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv;
+  opencascade::PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv;
+  opencascade::PFNGLBINDVERTEXBUFFERPROC glBindVertexBuffer;
+  opencascade::PFNGLVERTEXATTRIBFORMATPROC glVertexAttribFormat;
+  opencascade::PFNGLVERTEXATTRIBIFORMATPROC glVertexAttribIFormat;
+  opencascade::PFNGLVERTEXATTRIBBINDINGPROC glVertexAttribBinding;
+  opencascade::PFNGLVERTEXBINDINGDIVISORPROC glVertexBindingDivisor;
 
 public: //! @name OpenGL ES 3.2
 
-  typedef void (APIENTRY *glTexBuffer_t)(GLenum target, GLenum internalFormat, GLuint buffer);
-  glTexBuffer_t glTexBuffer;
-
-public: //! @name GL_KHR_debug (optional)
-
-  typedef void   (APIENTRY  *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
-
-  typedef void   (APIENTRYP glDebugMessageControl_t ) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-  typedef void   (APIENTRYP glDebugMessageInsert_t  ) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf);
-  typedef void   (APIENTRYP glDebugMessageCallback_t) (GLDEBUGPROCARB callback, const void* userParam);
-  typedef GLuint (APIENTRYP glGetDebugMessageLog_t  ) (GLuint   count,
-                                                       GLsizei  bufSize,
-                                                       GLenum*  sources,
-                                                       GLenum*  types,
-                                                       GLuint*  ids,
-                                                       GLenum*  severities,
-                                                       GLsizei* lengths,
-                                                       GLchar*  messageLog);
-
-  glDebugMessageControl_t  glDebugMessageControl;
-  glDebugMessageInsert_t   glDebugMessageInsert;
-  glDebugMessageCallback_t glDebugMessageCallback;
-  glGetDebugMessageLog_t   glGetDebugMessageLog;
+  opencascade::PFNGLBLENDBARRIERPROC glBlendBarrier;
+  opencascade::PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
+  opencascade::PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup;
+  opencascade::PFNGLPOPDEBUGGROUPPROC glPopDebugGroup;
+  opencascade::PFNGLOBJECTLABELPROC glObjectLabel;
+  opencascade::PFNGLGETOBJECTLABELPROC glGetObjectLabel;
+  opencascade::PFNGLOBJECTPTRLABELPROC glObjectPtrLabel;
+  opencascade::PFNGLGETOBJECTPTRLABELPROC glGetObjectPtrLabel;
+  opencascade::PFNGLGETPOINTERVPROC glGetPointerv;
+  opencascade::PFNGLENABLEIPROC  glEnablei;
+  opencascade::PFNGLDISABLEIPROC glDisablei;
+  opencascade::PFNGLBLENDEQUATIONIPROC glBlendEquationi;
+  opencascade::PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
+  opencascade::PFNGLBLENDFUNCIPROC glBlendFunci;
+  opencascade::PFNGLBLENDFUNCSEPARATEIPROC glBlendFuncSeparatei;
+  opencascade::PFNGLCOLORMASKIPROC glColorMaski;
+  opencascade::PFNGLISENABLEDIPROC glIsEnabledi;
+  opencascade::PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex;
+  opencascade::PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glDrawRangeElementsBaseVertex;
+  opencascade::PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glDrawElementsInstancedBaseVertex;
+  opencascade::PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture;
+  opencascade::PFNGLPRIMITIVEBOUNDINGBOXPROC glPrimitiveBoundingBox;
+  opencascade::PFNGLGETGRAPHICSRESETSTATUSPROC glGetGraphicsResetStatus;
+  opencascade::PFNGLREADNPIXELSPROC glReadnPixels;
+  opencascade::PFNGLGETNUNIFORMFVPROC glGetnUniformfv;
+  opencascade::PFNGLGETNUNIFORMIVPROC glGetnUniformiv;
+  opencascade::PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv;
+  opencascade::PFNGLMINSAMPLESHADINGPROC glMinSampleShading;
+  opencascade::PFNGLPATCHPARAMETERIPROC glPatchParameteri;
+  opencascade::PFNGLTEXPARAMETERIIVPROC glTexParameterIiv;
+  opencascade::PFNGLTEXPARAMETERIUIVPROC glTexParameterIuiv;
+  opencascade::PFNGLGETTEXPARAMETERIIVPROC glGetTexParameterIiv;
+  opencascade::PFNGLGETTEXPARAMETERIUIVPROC glGetTexParameterIuiv;
+  opencascade::PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv;
+  opencascade::PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv;
+  opencascade::PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv;
+  opencascade::PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;
+  opencascade::PFNGLTEXBUFFERPROC glTexBuffer;
+  opencascade::PFNGLTEXBUFFERRANGEPROC glTexBufferRange;
+  opencascade::PFNGLTEXSTORAGE3DMULTISAMPLEPROC glTexStorage3DMultisample;
+
+public: //! @name GL_KHR_debug (optional) or OpenGL ES 3.2+
+
+  opencascade::PFNGLDEBUGMESSAGECONTROLPROC  glDebugMessageControl;
+  opencascade::PFNGLDEBUGMESSAGEINSERTPROC   glDebugMessageInsert;
+  opencascade::PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback;
+  opencascade::PFNGLGETDEBUGMESSAGELOGPROC   glGetDebugMessageLog;
 
 #else // OpenGL ES vs. desktop
 
index 651bb34..b858767 100755 (executable)
@@ -1056,18 +1056,25 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)&
                                                    GLint                         theLocation,
                                                    const OpenGl_Vec2u&           theValue)
 {
-  if (theCtx->core32 == NULL || myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
+  if (myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
   {
-    return Standard_False;
+    return false;
   }
 
 #if !defined(GL_ES_VERSION_2_0)
-  theCtx->core32->glUniform2uiv (theLocation, 1, theValue.GetData());
-  return Standard_True;
+  if (theCtx->core32 != NULL)
+  {
+    theCtx->core32->glUniform2uiv (theLocation, 1, theValue.GetData());
+    return true;
+  }
 #else
-  (void )theValue;
-  return Standard_False;
+  if (theCtx->core30fwd != NULL)
+  {
+    theCtx->core30fwd->glUniform2uiv (theLocation, 1, theValue.GetData());
+    return true;
+  }
 #endif
+  return false;
 }
 
 // =======================================================================
@@ -1091,19 +1098,25 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)&
                                                    const GLsizei                 theCount,
                                                    const OpenGl_Vec2u*           theValue)
 {
-  if (theCtx->core32 == NULL || myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
+  if (myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
   {
-    return Standard_False;
+    return false;
   }
 
 #if !defined(GL_ES_VERSION_2_0)
-  theCtx->core32->glUniform2uiv (theLocation, theCount, theValue->GetData());
-  return Standard_True;
+  if (theCtx->core32 != NULL)
+  {
+    theCtx->core32->glUniform2uiv (theLocation, theCount, theValue->GetData());
+    return true;
+  }
 #else
-  (void )theCount;
-  (void )theValue;
-  return Standard_False;
+  if (theCtx->core30fwd != NULL)
+  {
+    theCtx->core30fwd->glUniform2uiv (theLocation, theCount, theValue->GetData());
+    return true;
+  }
 #endif
+  return false;
 }
 
 // =======================================================================