diff --git a/src/OpenGl/OpenGl_AspectsSprite.cxx b/src/OpenGl/OpenGl_AspectsSprite.cxx index 568a642c1f..81ad63cc78 100644 --- a/src/OpenGl/OpenGl_AspectsSprite.cxx +++ b/src/OpenGl/OpenGl_AspectsSprite.cxx @@ -254,7 +254,7 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx, } if (theCtx->core20fwd != NULL - && (!theCtx->caps->pntSpritesDisable || theCtx->core11 == NULL)) + && (!theCtx->caps->pntSpritesDisable || theCtx->core11ffp == NULL)) { // Creating texture resource for using it with point sprites Handle(Image_PixMap) anImage = aNewMarkerImage->GetImage(); @@ -272,11 +272,11 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx, } } } - else if (theCtx->core11 != NULL) + else if (theCtx->core11ffp != NULL) { #if !defined(GL_ES_VERSION_2_0) // Creating list with bitmap for using it in compatibility mode - GLuint aBitmapList = glGenLists (1); + GLuint aBitmapList = theCtx->core11ffp->glGenLists (1); aSprite->SetDisplayList (theCtx, aBitmapList); Handle(Image_PixMap) anImage = aNewMarkerImage->IsColoredImage() @@ -295,20 +295,20 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx, anImage = anImageCopy; } const GLint anAligment = Min ((GLint)anImage->MaxRowAligmentBytes(), 8); - glPixelStorei (GL_UNPACK_ALIGNMENT, anAligment); + theCtx->core11fwd->glPixelStorei (GL_UNPACK_ALIGNMENT, anAligment); const GLint anExtraBytes = GLint (anImage->RowExtraBytes()); const GLint aPixelsWidth = GLint (anImage->SizeRowBytes() / anImage->SizePixelBytes()); const GLint aRowLength = (anExtraBytes >= anAligment) ? aPixelsWidth : 0; - glPixelStorei (GL_UNPACK_ROW_LENGTH, aRowLength); + theCtx->core11fwd->glPixelStorei (GL_UNPACK_ROW_LENGTH, aRowLength); - glNewList (aBitmapList, GL_COMPILE); + theCtx->core11ffp->glNewList (aBitmapList, GL_COMPILE); const Standard_Integer aWidth = (Standard_Integer )anImage->Width(), aHeight = (Standard_Integer )anImage->Height(); - glBitmap (0, 0, 0, 0, GLfloat(-0.5f * aWidth), GLfloat(-0.5f * aHeight), NULL); // make offsets that will be added to the current raster position - glDrawPixels (GLsizei(anImage->Width()), GLsizei(anImage->Height()), aFormat.PixelFormat(), aFormat.DataType(), anImage->Data()); - glEndList(); - glPixelStorei (GL_UNPACK_ALIGNMENT, 1); - glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); + theCtx->core11ffp->glBitmap (0, 0, 0, 0, GLfloat(-0.5f * aWidth), GLfloat(-0.5f * aHeight), NULL); // make offsets that will be added to the current raster position + theCtx->core11ffp->glDrawPixels (GLsizei(anImage->Width()), GLsizei(anImage->Height()), aFormat.PixelFormat(), aFormat.DataType(), anImage->Data()); + theCtx->core11ffp->glEndList(); + theCtx->core11fwd->glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + theCtx->core11fwd->glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); } if (!aFormat.IsValid() || !hadAlreadyAlpha) @@ -323,10 +323,10 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx, aNewMarkerImage->GetTextureSize (aWidth, aHeight); if (Handle(TColStd_HArray1OfByte) aBitMap = aNewMarkerImage->GetBitMapArray()) { - glNewList (aBitmapList, GL_COMPILE); - glBitmap ((GLsizei)aWidth, (GLsizei)aHeight, (GLfloat)(0.5f * aWidth), (GLfloat)(0.5f * aHeight), - 0.f, 0.f, (const GLubyte*)&aBitMap->First()); - glEndList(); + theCtx->core11ffp->glNewList (aBitmapList, GL_COMPILE); + theCtx->core11ffp->glBitmap ((GLsizei)aWidth, (GLsizei)aHeight, (GLfloat)(0.5f * aWidth), (GLfloat)(0.5f * aHeight), + 0.f, 0.f, (const GLubyte*)&aBitMap->First()); + theCtx->core11ffp->glEndList(); } } #endif diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index 8b33a0825f..39996e7244 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -121,30 +121,21 @@ namespace // purpose : // ======================================================================= OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps) -: core11 (NULL), +: core11ffp (NULL), core11fwd (NULL), core15 (NULL), - core15fwd (NULL), core20 (NULL), - core20fwd (NULL), core30 (NULL), - core30fwd (NULL), core32 (NULL), - core32back (NULL), core33 (NULL), - core33back (NULL), core41 (NULL), - core41back (NULL), core42 (NULL), - core42back (NULL), core43 (NULL), - core43back (NULL), core44 (NULL), - core44back (NULL), core45 (NULL), - core45back (NULL), core46 (NULL), - core46back (NULL), + core15fwd (NULL), + core20fwd (NULL), caps (!theCaps.IsNull() ? theCaps : new OpenGl_Caps()), hasGetBufferData (Standard_False), #if defined(GL_ES_VERSION_2_0) @@ -599,7 +590,7 @@ void OpenGl_Context::FetchState() { #if !defined(GL_ES_VERSION_2_0) // cache feedback mode state - if (core11 != NULL) + if (core11ffp != NULL) { ::glGetIntegerv (GL_RENDER_MODE, &myRenderMode); ::glGetIntegerv (GL_SHADE_MODEL, &myShadeModel); @@ -1526,7 +1517,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile) #if defined(GL_ES_VERSION_2_0) myShaderManager->SetUseRedAlpha (false); #else - myShaderManager->SetUseRedAlpha (core11 == NULL); + myShaderManager->SetUseRedAlpha (core11ffp == NULL); #endif #define checkGlslExtensionShort(theName) myShaderManager->EnableGlslExtension (Graphic3d_GlslExtension_ ## theName, CheckExtension (#theName)) #if defined(GL_ES_VERSION_2_0) @@ -1571,7 +1562,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile) glGetIntegerv (GL_MAX_TEXTURE_SIZE, &myMaxTexDim); #if !defined(GL_ES_VERSION_2_0) - if (IsGlGreaterEqual (1, 3) && core11 != NULL) + if (IsGlGreaterEqual (1, 3) && core11ffp != NULL) { // this is a maximum of texture units for FFP functionality, // usually smaller than combined texture units available for GLSL @@ -1613,7 +1604,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile) ::glGetIntegerv (GL_MAX_SAMPLES, &myMaxMsaaSamples); } #else - if (core30fwd != NULL) + if (core30 != NULL) { // MSAA RenderBuffers have been defined in OpenGL 3.0, // but MSAA Textures - only in OpenGL 3.2+ @@ -2211,7 +2202,7 @@ void OpenGl_Context::ReleaseDelayed() continue; } - // release resource if no one requiested it more than 2 redraw calls + // release resource if no one requested it more than 2 redraw calls aRes->Release (this); mySharedResources->UnBind (aKey); aDeadList.Append (aKey); @@ -2291,7 +2282,7 @@ Handle(OpenGl_TextureSet) OpenGl_Context::BindTextures (const Handle(OpenGl_Text } } #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) { OpenGl_Sampler::applyGlobalTextureParams (aThisCtx, *aTextureNew, aTextureNew->Sampler()->Parameters()); } @@ -2302,7 +2293,7 @@ Handle(OpenGl_TextureSet) OpenGl_Context::BindTextures (const Handle(OpenGl_Text { aTextureOld->Unbind (aThisCtx, aTexUnit); #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) { OpenGl_Sampler::resetGlobalTextureParams (aThisCtx, *aTextureOld, aTextureOld->Sampler()->Parameters()); } @@ -2524,9 +2515,9 @@ void OpenGl_Context::SetColor4fv (const OpenGl_Vec4& theColor) } } #if !defined(GL_ES_VERSION_2_0) - else if (core11 != NULL) + else if (core11ffp != NULL) { - core11->glColor4fv (theColor.GetData()); + core11ffp->glColor4fv (theColor.GetData()); } #endif } @@ -2573,17 +2564,17 @@ void OpenGl_Context::SetLineStipple (const Standard_ShortReal theFactor, #if !defined(GL_ES_VERSION_2_0) if (thePattern != 0xFFFF) { - if (core11 != NULL) + if (core11ffp != NULL) { core11fwd->glEnable (GL_LINE_STIPPLE); - core11->glLineStipple (static_cast (theFactor), - static_cast (thePattern)); + core11ffp->glLineStipple (static_cast (theFactor), + static_cast (thePattern)); } } else { - if (core11 != NULL) + if (core11ffp != NULL) { core11fwd->glDisable (GL_LINE_STIPPLE); } @@ -2598,7 +2589,7 @@ void OpenGl_Context::SetLineStipple (const Standard_ShortReal theFactor, void OpenGl_Context::SetLineWidth (const Standard_ShortReal theWidth) { #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) #endif { // glLineWidth() is still defined within Core Profile, but has no effect with values != 1.0f @@ -2647,12 +2638,12 @@ void OpenGl_Context::SetTextureMatrix (const Handle(Graphic3d_TextureParams)& th } #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) { GLint aMatrixMode = GL_TEXTURE; ::glGetIntegerv (GL_MATRIX_MODE, &aMatrixMode); - core11->glMatrixMode (GL_TEXTURE); + core11ffp->glMatrixMode (GL_TEXTURE); OpenGl_Mat4 aTextureMat; if (caps->isTopDownTextureUV != theIsTopDown) { @@ -2666,8 +2657,8 @@ void OpenGl_Context::SetTextureMatrix (const Handle(Graphic3d_TextureParams)& th Graphic3d_TransformUtils::Translate (aTextureMat, -aTrans.x(), -aTrans.y(), 0.0f); } Graphic3d_TransformUtils::Rotate (aTextureMat, -theParams->Rotation(), 0.0f, 0.0f, 1.0f); - core11->glLoadMatrixf (aTextureMat); - core11->glMatrixMode (aMatrixMode); + core11ffp->glLoadMatrixf (aTextureMat); + core11ffp->glMatrixMode (aMatrixMode); } #endif } @@ -2730,19 +2721,17 @@ Standard_Boolean OpenGl_Context::SetGlNormalizeEnabled (Standard_Boolean isEnabl } Standard_Boolean anOldGlNormalize = myIsGlNormalizeEnabled; - myIsGlNormalizeEnabled = isEnabled; - #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) { if (isEnabled) { - ::glEnable (GL_NORMALIZE); + core11fwd->glEnable (GL_NORMALIZE); } else { - ::glDisable (GL_NORMALIZE); + core11fwd->glDisable (GL_NORMALIZE); } } #endif @@ -2757,7 +2746,7 @@ Standard_Boolean OpenGl_Context::SetGlNormalizeEnabled (Standard_Boolean isEnabl void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel) { #if !defined(GL_ES_VERSION_2_0) - if (core11 != NULL) + if (core11ffp != NULL) { const Standard_Integer aModel = theModel == Graphic3d_TOSM_FACET || theModel == Graphic3d_TOSM_PBR_FACET ? GL_FLAT : GL_SMOOTH; @@ -2766,7 +2755,7 @@ void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel) return; } myShadeModel = aModel; - core11->glShadeModel (aModel); + core11ffp->glShadeModel (aModel); } #else (void )theModel; @@ -2801,7 +2790,7 @@ Standard_Integer OpenGl_Context::SetPolygonMode (const Standard_Integer theMode) // ======================================================================= bool OpenGl_Context::SetPolygonHatchEnabled (const bool theIsEnabled) { - if (core11 == NULL) + if (core11ffp == NULL) { return false; } @@ -2834,7 +2823,7 @@ Standard_Integer OpenGl_Context::SetPolygonHatchStyle (const Handle(Graphic3d_Ha { const Standard_Integer aNewStyle = !theStyle.IsNull() ? theStyle->HatchType() : Aspect_HS_SOLID; if (myActiveHatchType == aNewStyle - || core11 == NULL) + || core11ffp == NULL) { return myActiveHatchType; } @@ -2883,11 +2872,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset) { if (toFillNew) { - glEnable (GL_POLYGON_OFFSET_FILL); + core11fwd->glEnable (GL_POLYGON_OFFSET_FILL); } else { - glDisable (GL_POLYGON_OFFSET_FILL); + core11fwd->glDisable (GL_POLYGON_OFFSET_FILL); } } @@ -2898,11 +2887,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset) { if (toLineNew) { - glEnable (GL_POLYGON_OFFSET_LINE); + core11fwd->glEnable (GL_POLYGON_OFFSET_LINE); } else { - glDisable (GL_POLYGON_OFFSET_LINE); + core11fwd->glDisable (GL_POLYGON_OFFSET_LINE); } } @@ -2912,11 +2901,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset) { if (toPointNew) { - glEnable (GL_POLYGON_OFFSET_POINT); + core11fwd->glEnable (GL_POLYGON_OFFSET_POINT); } else { - glDisable (GL_POLYGON_OFFSET_POINT); + core11fwd->glDisable (GL_POLYGON_OFFSET_POINT); } } #endif @@ -2924,7 +2913,7 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset) if (myPolygonOffset.Factor != theOffset.Factor || myPolygonOffset.Units != theOffset.Units) { - glPolygonOffset (theOffset.Factor, theOffset.Units); + core11fwd->glPolygonOffset (theOffset.Factor, theOffset.Units); } myPolygonOffset = theOffset; } @@ -3017,24 +3006,24 @@ void OpenGl_Context::EnableFeatures() const void OpenGl_Context::DisableFeatures() const { // Disable stuff that's likely to slow down glDrawPixels. - glDisable(GL_DITHER); - glDisable(GL_BLEND); - glDisable(GL_DEPTH_TEST); - glDisable(GL_STENCIL_TEST); + core11fwd->glDisable(GL_DITHER); + core11fwd->glDisable(GL_BLEND); + core11fwd->glDisable(GL_DEPTH_TEST); + core11fwd->glDisable(GL_STENCIL_TEST); #if !defined(GL_ES_VERSION_2_0) - if (core11 == NULL) + if (core11ffp == NULL) { return; } - glDisable(GL_TEXTURE_1D); - glDisable(GL_TEXTURE_2D); + core11fwd->glDisable(GL_TEXTURE_1D); + core11fwd->glDisable(GL_TEXTURE_2D); - glDisable(GL_LIGHTING); - glDisable(GL_ALPHA_TEST); - glDisable(GL_FOG); - glDisable(GL_LOGIC_OP); + core11fwd->glDisable(GL_LIGHTING); + core11fwd->glDisable(GL_ALPHA_TEST); + core11fwd->glDisable(GL_FOG); + core11fwd->glDisable(GL_LOGIC_OP); glPixelTransferi(GL_MAP_COLOR, GL_FALSE); glPixelTransferi(GL_RED_SCALE, 1); @@ -3049,22 +3038,22 @@ void OpenGl_Context::DisableFeatures() const if ((myGlVerMajor >= 1) && (myGlVerMinor >= 2)) { if (CheckExtension ("GL_CONVOLUTION_1D_EXT")) - glDisable(GL_CONVOLUTION_1D_EXT); + core11fwd->glDisable(GL_CONVOLUTION_1D_EXT); if (CheckExtension ("GL_CONVOLUTION_2D_EXT")) - glDisable(GL_CONVOLUTION_2D_EXT); + core11fwd->glDisable(GL_CONVOLUTION_2D_EXT); if (CheckExtension ("GL_SEPARABLE_2D_EXT")) - glDisable(GL_SEPARABLE_2D_EXT); + core11fwd->glDisable(GL_SEPARABLE_2D_EXT); if (CheckExtension ("GL_SEPARABLE_2D_EXT")) - glDisable(GL_HISTOGRAM_EXT); + core11fwd->glDisable(GL_HISTOGRAM_EXT); if (CheckExtension ("GL_MINMAX_EXT")) - glDisable(GL_MINMAX_EXT); + core11fwd->glDisable(GL_MINMAX_EXT); if (CheckExtension ("GL_TEXTURE_3D_EXT")) - glDisable(GL_TEXTURE_3D_EXT); + core11fwd->glDisable(GL_TEXTURE_3D_EXT); } #endif } @@ -3075,7 +3064,7 @@ void OpenGl_Context::DisableFeatures() const // ======================================================================= void OpenGl_Context::SetColorMaskRGBA (const NCollection_Vec4& theVal) { - glColorMask (theVal.r() ? GL_TRUE : GL_FALSE, + core11fwd->glColorMask (theVal.r() ? GL_TRUE : GL_FALSE, theVal.g() ? GL_TRUE : GL_FALSE, theVal.b() ? GL_TRUE : GL_FALSE, theVal.a() ? GL_TRUE : GL_FALSE); @@ -3091,7 +3080,7 @@ bool OpenGl_Context::SetColorMask (bool theToWriteColor) const bool anOldValue = myColorMask.r(); myColorMask.SetValues (theToWriteColor, theToWriteColor, theToWriteColor, caps->buffersOpaqueAlpha ? false : theToWriteColor); const GLboolean toWrite = theToWriteColor ? GL_TRUE : GL_FALSE; - glColorMask (toWrite, toWrite, toWrite, myColorMask.a() ? GL_TRUE : GL_FALSE); + core11fwd->glColorMask (toWrite, toWrite, toWrite, myColorMask.a() ? GL_TRUE : GL_FALSE); return anOldValue; } @@ -3142,10 +3131,10 @@ bool OpenGl_Context::GetBufferSubData (GLenum theTarget, GLintptr theOffset, GLs }, theTarget, theOffset, theData, theSize); return true; #elif defined(GL_ES_VERSION_2_0) - if (void* aData = core30fwd->glMapBufferRange (theTarget, theOffset, theSize, GL_MAP_READ_BIT)) + if (void* aData = core30->glMapBufferRange (theTarget, theOffset, theSize, GL_MAP_READ_BIT)) { memcpy (theData, aData, theSize); - core30fwd->glUnmapBuffer (theTarget); + core30->glUnmapBuffer (theTarget); return true; } return false; diff --git a/src/OpenGl/OpenGl_Context.hxx b/src/OpenGl/OpenGl_Context.hxx index da7690346f..92a8f73e07 100644 --- a/src/OpenGl/OpenGl_Context.hxx +++ b/src/OpenGl/OpenGl_Context.hxx @@ -73,72 +73,23 @@ struct OpenGl_ArbSamplerObject; struct OpenGl_ArbTexBindless; struct OpenGl_ExtGS; -template struct OpenGl_TmplCore12; -typedef OpenGl_TmplCore12 OpenGl_GlCore12; -typedef OpenGl_TmplCore12 OpenGl_GlCore12Fwd; - +struct OpenGl_GlCore12; struct OpenGl_GlCore13; -struct OpenGl_GlCore13Fwd; - -template struct OpenGl_TmplCore14; -typedef OpenGl_TmplCore14 OpenGl_GlCore14; -typedef OpenGl_TmplCore14 OpenGl_GlCore14Fwd; - -template struct OpenGl_TmplCore15; -typedef OpenGl_TmplCore15 OpenGl_GlCore15; -typedef OpenGl_TmplCore15 OpenGl_GlCore15Fwd; - -template struct OpenGl_TmplCore20; -typedef OpenGl_TmplCore20 OpenGl_GlCore20; -typedef OpenGl_TmplCore20 OpenGl_GlCore20Fwd; - -template struct OpenGl_TmplCore21; -typedef OpenGl_TmplCore21 OpenGl_GlCore21; -typedef OpenGl_TmplCore21 OpenGl_GlCore21Fwd; - -template struct OpenGl_TmplCore30; -typedef OpenGl_TmplCore30 OpenGl_GlCore30; -typedef OpenGl_TmplCore30 OpenGl_GlCore30Fwd; - -template struct OpenGl_TmplCore31; -typedef OpenGl_TmplCore31 OpenGl_GlCore31Back; -typedef OpenGl_TmplCore31 OpenGl_GlCore31; - -template struct OpenGl_TmplCore32; -typedef OpenGl_TmplCore32 OpenGl_GlCore32Back; -typedef OpenGl_TmplCore32 OpenGl_GlCore32; - -template struct OpenGl_TmplCore33; -typedef OpenGl_TmplCore33 OpenGl_GlCore33Back; -typedef OpenGl_TmplCore33 OpenGl_GlCore33; - -template struct OpenGl_TmplCore40; -typedef OpenGl_TmplCore40 OpenGl_GlCore40Back; -typedef OpenGl_TmplCore40 OpenGl_GlCore40; - -template struct OpenGl_TmplCore41; -typedef OpenGl_TmplCore41 OpenGl_GlCore41Back; -typedef OpenGl_TmplCore41 OpenGl_GlCore41; - -template struct OpenGl_TmplCore42; -typedef OpenGl_TmplCore42 OpenGl_GlCore42Back; -typedef OpenGl_TmplCore42 OpenGl_GlCore42; - -template struct OpenGl_TmplCore43; -typedef OpenGl_TmplCore43 OpenGl_GlCore43Back; -typedef OpenGl_TmplCore43 OpenGl_GlCore43; - -template struct OpenGl_TmplCore44; -typedef OpenGl_TmplCore44 OpenGl_GlCore44Back; -typedef OpenGl_TmplCore44 OpenGl_GlCore44; - -template struct OpenGl_TmplCore45; -typedef OpenGl_TmplCore45 OpenGl_GlCore45Back; -typedef OpenGl_TmplCore45 OpenGl_GlCore45; - -template struct OpenGl_TmplCore46; -typedef OpenGl_TmplCore46 OpenGl_GlCore46Back; -typedef OpenGl_TmplCore46 OpenGl_GlCore46; +struct OpenGl_GlCore14; +struct OpenGl_GlCore15; +struct OpenGl_GlCore20; +struct OpenGl_GlCore21; +struct OpenGl_GlCore30; +struct OpenGl_GlCore31; +struct OpenGl_GlCore32; +struct OpenGl_GlCore33; +struct OpenGl_GlCore40; +struct OpenGl_GlCore41; +struct OpenGl_GlCore42; +struct OpenGl_GlCore43; +struct OpenGl_GlCore44; +struct OpenGl_GlCore45; +struct OpenGl_GlCore46; class Graphic3d_Camera; class Graphic3d_PresentationAttributes; @@ -174,24 +125,15 @@ DEFINE_STANDARD_HANDLE(OpenGl_Context, Standard_Transient) //! } //! @endcode //! -//! Current implementation provide access to OpenGL core functionality up to 4.4 version (core12, core13, core14, core15, fields core20) +//! Current implementation provide access to OpenGL core functionality up to 4.6 version (core12, core13, core14, etc.) //! as well as several extensions (arbTBO, arbFBO, etc.). //! //! OpenGL context might be initialized in Core Profile. In this case deprecated functionality become unavailable. -//! To make code easily adaptable to wide range of OpenGL versions, function sets related to each version has two kinds of suffixes: -//! - "back" for version 3.2+. -//! Represents function set for Backward-Compatible Profile. -//! Function sets without this suffix represents core profile. -//! - "fwd" for version 3.0-. -//! Represents non-deprecated function set of earlier OpenGL versions, which are still available within OpenGL 3.2 Core Profile. -//! Function sets without this suffix represents complete list of functions related to specific OpenGL version. -//! //! To select which core** function set should be used in specific case: //! - Determine the minimal OpenGL version required for implemented functionality and use it to access all functions. //! For example, if algorithm requires OpenGL 2.1+, it is better to write core20fwd->glEnable() rather than core11fwd->glEnable() for uniformity. -//! - If functionality will work within Core Profile, use function sets with appropriate suffix. //! - Validate minimal requirements at initialization/creation time and omit checks within code where algorithm should be already initialized. -//! Properly escape code incompatible with Core Profile. The simplest way to check Core Profile is "if (core11 == NULL)". +//! Properly escape code incompatible with Core Profile. The simplest way to check Core Profile is "if (core11ffp == NULL)". //! //! Simplified extensions classification: //! - prefixed with NV, AMD, ATI are vendor-specific (however may be provided by other vendors in some cases); @@ -209,7 +151,7 @@ DEFINE_STANDARD_HANDLE(OpenGl_Context, Standard_Transient) //! model -> world -> view -> projection //! These matrices might be changed for local transformation, transform persistent using direct access to //! current matrix of ModelWorldState, WorldViewState and ProjectionState -//! After, these matrices should be applyed using ApplyModelWorldMatrix, ApplyWorldViewMatrix, +//! After, these matrices should be applied using ApplyModelWorldMatrix, ApplyWorldViewMatrix, //! ApplyModelViewMatrix or ApplyProjectionMatrix. class OpenGl_Context : public Standard_Transient { @@ -1055,30 +997,22 @@ private: public: //! @name core profiles - OpenGl_GlCore11* core11; //!< OpenGL 1.1 core functionality + OpenGl_GlCore11* core11ffp; //!< OpenGL 1.1 core functionality OpenGl_GlCore11Fwd* core11fwd; //!< OpenGL 1.1 without deprecated entry points - OpenGl_GlCore15* core15; //!< OpenGL 1.5 core functionality - 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_GlCore15* core15; //!< OpenGL 1.5 without deprecated entry points + OpenGl_GlCore20* core20; //!< OpenGL 2.0 without deprecated entry points + OpenGl_GlCore30* core30; //!< 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 - OpenGl_GlCore33Back* core33back; //!< OpenGL 3.3 backward compatibility profile OpenGl_GlCore41* core41; //!< OpenGL 4.1 core profile - OpenGl_GlCore41Back* core41back; //!< OpenGL 4.1 backward compatibility profile OpenGl_GlCore42* core42; //!< OpenGL 4.2 core profile - OpenGl_GlCore42Back* core42back; //!< OpenGL 4.2 backward compatibility profile OpenGl_GlCore43* core43; //!< OpenGL 4.3 core profile - OpenGl_GlCore43Back* core43back; //!< OpenGL 4.3 backward compatibility profile OpenGl_GlCore44* core44; //!< OpenGL 4.4 core profile - OpenGl_GlCore44Back* core44back; //!< OpenGL 4.4 backward compatibility profile OpenGl_GlCore45* core45; //!< OpenGL 4.5 core profile - OpenGl_GlCore45Back* core45back; //!< OpenGL 4.5 backward compatibility profile OpenGl_GlCore46* core46; //!< OpenGL 4.6 core profile - OpenGl_GlCore46Back* core46back; //!< OpenGL 4.6 backward compatibility profile + + OpenGl_GlCore15* core15fwd; //!< obsolete entry left for code portability; core15 should be used instead + OpenGl_GlCore20* core20fwd; //!< obsolete entry left for code portability; core20 should be used instead Handle(OpenGl_Caps) caps; //!< context options diff --git a/src/OpenGl/OpenGl_GlCore11.hxx b/src/OpenGl/OpenGl_GlCore11.hxx index eeb916030f..40245b7ade 100644 --- a/src/OpenGl/OpenGl_GlCore11.hxx +++ b/src/OpenGl/OpenGl_GlCore11.hxx @@ -26,687 +26,34 @@ struct OpenGl_GlCore11 : protected OpenGl_GlFunctions { #if !defined(GL_ES_VERSION_2_0) - inline void glRotated (GLdouble theAngleDegrees, - GLdouble theX, GLdouble theY, GLdouble theZ) +public: + + inline void glTexEnvi (GLenum target, GLenum pname, GLint param) { - ::glRotated (theAngleDegrees, theX, theY, theZ); - OpenGl_TRACE(glRotated) + ::glTexEnvi (target, pname, param); + OpenGl_TRACE(glTexEnvi) } - inline void glScaled (GLdouble theX, GLdouble theY, GLdouble theZ) + inline void glGetTexEnviv (GLenum target, GLenum pname, GLint *params) { - ::glScaled (theX, theY, theZ); - OpenGl_TRACE(glScaled) + ::glGetTexEnviv (target, pname, params); + OpenGl_TRACE(glGetTexEnviv) } - inline void glTranslated (GLdouble theX, GLdouble theY, GLdouble theZ) + inline void glLogicOp (GLenum opcode) { - ::glTranslated (theX, theY, theZ); - OpenGl_TRACE(glTranslated) + ::glLogicOp (opcode); + OpenGl_TRACE(glLogicOp) } public: //! @name Begin/End primitive specification (removed since 3.1) - inline void glBegin (GLenum theMode) - { - ::glBegin (theMode); - OpenGl_TRACE(glBegin) - } - - inline void glEnd() - { - ::glEnd(); - OpenGl_TRACE(glEnd) - } - - inline void glVertex2d (GLdouble theX, GLdouble theY) - { - ::glVertex2d (theX, theY); - OpenGl_TRACE(glVertex2d) - } - - inline void glVertex2f (GLfloat theX, GLfloat theY) - { - ::glVertex2f (theX, theY); - OpenGl_TRACE(glVertex2f) - } - - inline void glVertex2i (GLint theX, GLint theY) - { - ::glVertex2i (theX, theY); - OpenGl_TRACE(glVertex2i) - } - - inline void glVertex2s (GLshort theX, GLshort theY) - { - ::glVertex2s (theX, theY); - OpenGl_TRACE(glVertex2s) - } - - inline void glVertex3d (GLdouble theX, GLdouble theY, GLdouble theZ) - { - ::glVertex3d (theX, theY, theZ); - OpenGl_TRACE(glVertex3d) - } - - inline void glVertex3f (GLfloat theX, GLfloat theY, GLfloat theZ) - { - ::glVertex3f (theX, theY, theZ); - OpenGl_TRACE(glVertex3f) - } - - inline void glVertex3i (GLint theX, GLint theY, GLint theZ) - { - ::glVertex3i (theX, theY, theZ); - OpenGl_TRACE(glVertex3i) - } - - inline void glVertex3s (GLshort theX, GLshort theY, GLshort theZ) - { - ::glVertex3s (theX, theY, theZ); - OpenGl_TRACE(glVertex3s) - } - - inline void glVertex4d (GLdouble theX, GLdouble theY, GLdouble theZ, GLdouble theW) - { - ::glVertex4d (theX, theY, theZ, theW); - OpenGl_TRACE(glVertex4d) - } - - inline void glVertex4f (GLfloat theX, GLfloat theY, GLfloat theZ, GLfloat theW) - { - ::glVertex4f (theX, theY, theZ, theW); - OpenGl_TRACE(glVertex4f) - } - - inline void glVertex4i (GLint theX, GLint theY, GLint theZ, GLint theW) - { - ::glVertex4i (theX, theY, theZ, theW); - OpenGl_TRACE(glVertex4i) - } - - inline void glVertex4s (GLshort theX, GLshort theY, GLshort theZ, GLshort theW) - { - ::glVertex4s (theX, theY, theZ, theW); - OpenGl_TRACE(glVertex4s) - } - - inline void glVertex2dv (const GLdouble* theVec2) - { - ::glVertex2dv (theVec2); - OpenGl_TRACE(glVertex2dv) - } - - inline void glVertex2fv (const GLfloat* theVec2) - { - ::glVertex2fv (theVec2); - OpenGl_TRACE(glVertex2fv) - } - - inline void glVertex2iv (const GLint* theVec2) - { - ::glVertex2iv (theVec2); - OpenGl_TRACE(glVertex2iv) - } - - inline void glVertex2sv (const GLshort* theVec2) - { - ::glVertex2sv (theVec2); - OpenGl_TRACE(glVertex2sv) - } - - inline void glVertex3dv (const GLdouble* theVec3) - { - ::glVertex3dv (theVec3); - OpenGl_TRACE(glVertex3dv) - } - - inline void glVertex3fv (const GLfloat* theVec3) - { - ::glVertex3fv (theVec3); - OpenGl_TRACE(glVertex3fv) - } - - inline void glVertex3iv (const GLint* theVec3) - { - ::glVertex3iv (theVec3); - OpenGl_TRACE(glVertex3iv) - } - - inline void glVertex3sv (const GLshort* theVec3) - { - ::glVertex3sv (theVec3); - OpenGl_TRACE(glVertex3sv) - } - - inline void glVertex4dv (const GLdouble* theVec4) - { - ::glVertex4dv (theVec4); - OpenGl_TRACE(glVertex4dv) - } - - inline void glVertex4fv (const GLfloat* theVec4) - { - ::glVertex4fv (theVec4); - OpenGl_TRACE(glVertex4fv) - } - - inline void glVertex4iv (const GLint* theVec4) - { - ::glVertex4iv (theVec4); - OpenGl_TRACE(glVertex4iv) - } - - inline void glVertex4sv (const GLshort* theVec4) - { - ::glVertex4sv (theVec4); - OpenGl_TRACE(glVertex4sv) - } - - inline void glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz) - { - ::glNormal3b(nx, ny, nz); - OpenGl_TRACE(glNormal3b) - } - - inline void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz) - { - ::glNormal3d(nx, ny, nz); - OpenGl_TRACE(glNormal3d) - } - - inline void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz) - { - ::glNormal3f(nx, ny, nz); - OpenGl_TRACE(glNormal3f) - } - - inline void glNormal3i (GLint nx, GLint ny, GLint nz) - { - ::glNormal3i(nx, ny, nz); - OpenGl_TRACE(glNormal3i) - } - - inline void glNormal3s (GLshort nx, GLshort ny, GLshort nz) - { - ::glNormal3s(nx, ny, nz); - OpenGl_TRACE(glNormal3s) - } - - inline void glNormal3bv (const GLbyte* theVec) - { - ::glNormal3bv (theVec); - OpenGl_TRACE(glNormal3bv) - } - - inline void glNormal3dv (const GLdouble* theVec) - { - ::glNormal3dv (theVec); - OpenGl_TRACE(glNormal3dv) - } - - inline void glNormal3fv (const GLfloat* theVec) - { - ::glNormal3fv (theVec); - OpenGl_TRACE(glNormal3fv) - } - - inline void glNormal3iv (const GLint* theVec) - { - ::glNormal3iv (theVec); - OpenGl_TRACE(glNormal3iv) - } - - inline void glNormal3sv (const GLshort* theVec) - { - ::glNormal3sv (theVec); - OpenGl_TRACE(glNormal3sv) - } - - inline void glIndexd (GLdouble c) - { - ::glIndexd(c); - OpenGl_TRACE(glIndexd) - } - - inline void glIndexf (GLfloat c) - { - ::glIndexf(c); - OpenGl_TRACE(glIndexf) - } - - inline void glIndexi (GLint c) - { - ::glIndexi(c); - OpenGl_TRACE(glIndexi) - } - - inline void glIndexs (GLshort c) - { - ::glIndexs(c); - OpenGl_TRACE(glIndexs) - } - - inline void glIndexub (GLubyte c) - { - ::glIndexub(c); - OpenGl_TRACE(glIndexub) - } - - inline void glIndexdv (const GLdouble* c) - { - ::glIndexdv(c); - OpenGl_TRACE(glIndexdv) - } - - inline void glIndexfv (const GLfloat* c) - { - ::glIndexfv(c); - OpenGl_TRACE(glIndexfv) - } - - inline void glIndexiv (const GLint* c) - { - ::glIndexiv(c); - OpenGl_TRACE(glIndexiv) - } - - inline void glIndexsv (const GLshort* c) - { - ::glIndexsv(c); - OpenGl_TRACE(glIndexsv) - } - - inline void glIndexubv (const GLubyte* c) - { - ::glIndexubv(c); - OpenGl_TRACE(glIndexubv) - } - - inline void glColor3b (GLbyte theRed, GLbyte theGreen, GLbyte theBlue) - { - ::glColor3b (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3b) - } - - inline void glColor3d (GLdouble theRed, GLdouble theGreen, GLdouble theBlue) - { - ::glColor3d (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3d) - } - - inline void glColor3f (GLfloat theRed, GLfloat theGreen, GLfloat theBlue) - { - ::glColor3f (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3f) - } - - inline void glColor3i (GLint theRed, GLint theGreen, GLint theBlue) - { - ::glColor3i (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3i) - } - - inline void glColor3s (GLshort theRed, GLshort theGreen, GLshort theBlue) - { - ::glColor3s (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3s) - } - - inline void glColor3ub (GLubyte theRed, GLubyte theGreen, GLubyte theBlue) - { - ::glColor3ub (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3ub) - } - - inline void glColor3ui (GLuint theRed, GLuint theGreen, GLuint theBlue) - { - ::glColor3ui (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3ui) - } - - inline void glColor3us (GLushort theRed, GLushort theGreen, GLushort theBlue) - { - ::glColor3us (theRed, theGreen, theBlue); - OpenGl_TRACE(glColor3us) - } - - inline void glColor4b (GLbyte theRed, GLbyte theGreen, GLbyte theBlue, GLbyte theAlpha) - { - ::glColor4b (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4b) - } - - inline void glColor4d (GLdouble theRed, GLdouble theGreen, GLdouble theBlue, GLdouble theAlpha) - { - ::glColor4d (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4d) - } - - inline void glColor4f (GLfloat theRed, GLfloat theGreen, GLfloat theBlue, GLfloat theAlpha) - { - ::glColor4f (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4f) - } - - inline void glColor4i (GLint theRed, GLint theGreen, GLint theBlue, GLint theAlpha) - { - ::glColor4i (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4i) - } - - inline void glColor4s (GLshort theRed, GLshort theGreen, GLshort theBlue, GLshort theAlpha) - { - ::glColor4s (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4s) - } - - inline void glColor4ub (GLubyte theRed, GLubyte theGreen, GLubyte theBlue, GLubyte theAlpha) - { - ::glColor4ub (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4ub) - } - - inline void glColor4ui (GLuint theRed, GLuint theGreen, GLuint theBlue, GLuint theAlpha) - { - ::glColor4ui (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4ui) - } - - inline void glColor4us (GLushort theRed, GLushort theGreen, GLushort theBlue, GLushort theAlpha) - { - ::glColor4us (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glColor4us) - } - - inline void glColor3bv (const GLbyte* theVec) - { - ::glColor3bv (theVec); - OpenGl_TRACE(glColor3bv) - } - - inline void glColor3dv (const GLdouble* theVec) - { - ::glColor3dv (theVec); - OpenGl_TRACE(glColor3dv) - } - - inline void glColor3fv (const GLfloat* theVec) - { - ::glColor3fv (theVec); - OpenGl_TRACE(glColor3fv) - } - - inline void glColor3iv (const GLint* theVec) - { - ::glColor3iv (theVec); - OpenGl_TRACE(glColor3iv) - } - - inline void glColor3sv (const GLshort* theVec) - { - ::glColor3sv (theVec); - OpenGl_TRACE(glColor3sv) - } - - inline void glColor3ubv (const GLubyte* theVec) - { - ::glColor3ubv (theVec); - OpenGl_TRACE(glColor3ubv) - } - - inline void glColor3uiv (const GLuint* theVec) - { - ::glColor3uiv (theVec); - OpenGl_TRACE(glColor3uiv) - } - - inline void glColor3usv (const GLushort* theVec) - { - ::glColor3usv (theVec); - OpenGl_TRACE(glColor3usv) - } - - inline void glColor4bv (const GLbyte* theVec) - { - ::glColor4bv (theVec); - OpenGl_TRACE(glColor4bv) - } - - inline void glColor4dv (const GLdouble* theVec) - { - ::glColor4dv (theVec); - OpenGl_TRACE(glColor4dv) - } - inline void glColor4fv (const GLfloat* theVec) { ::glColor4fv (theVec); OpenGl_TRACE(glColor4fv) } - inline void glColor4iv (const GLint* theVec) - { - ::glColor4iv (theVec); - OpenGl_TRACE(glColor4iv) - } - - inline void glColor4sv (const GLshort* theVec) - { - ::glColor4sv (theVec); - OpenGl_TRACE(glColor4sv) - } - - inline void glColor4ubv (const GLubyte* theVec) - { - ::glColor4ubv (theVec); - OpenGl_TRACE(glColor4ubv) - } - - inline void glColor4uiv (const GLuint* theVec) - { - ::glColor4uiv (theVec); - OpenGl_TRACE(glColor4uiv) - } - - inline void glColor4usv (const GLushort* theVec) - { - ::glColor4usv (theVec); - OpenGl_TRACE(glColor4usv) - } - - inline void glTexCoord1d (GLdouble s) - { - ::glTexCoord1d(s); - OpenGl_TRACE(glTexCoord1d); - } - - inline void glTexCoord1f (GLfloat s) - { - ::glTexCoord1f(s); - OpenGl_TRACE(glTexCoord1f) - } - - inline void glTexCoord1i (GLint s) - { - ::glTexCoord1i(s); - OpenGl_TRACE(glTexCoord1i) - } - - inline void glTexCoord1s (GLshort s) - { - ::glTexCoord1s(s); - OpenGl_TRACE(glTexCoord1s) - } - - inline void glTexCoord2d (GLdouble s, GLdouble t) - { - ::glTexCoord2d(s, t); - OpenGl_TRACE(glTexCoord2d) - } - - inline void glTexCoord2f (GLfloat s, GLfloat t) - { - ::glTexCoord2f(s, t); - OpenGl_TRACE(glTexCoord2f) - } - - inline void glTexCoord2i (GLint s, GLint t) - { - ::glTexCoord2i(s, t); - OpenGl_TRACE(glTexCoord2i) - } - - inline void glTexCoord2s (GLshort s, GLshort t) - { - ::glTexCoord2s(s, t); - OpenGl_TRACE(glTexCoord2s) - } - - inline void glTexCoord3d (GLdouble s, GLdouble t, GLdouble r) - { - ::glTexCoord3d(s, t, r); - OpenGl_TRACE(glTexCoord3d) - } - - inline void glTexCoord3f (GLfloat s, GLfloat t, GLfloat r) - { - ::glTexCoord3f(s, t, r); - OpenGl_TRACE(glTexCoord3f) - } - - inline void glTexCoord3i (GLint s, GLint t, GLint r) - { - ::glTexCoord3i(s, t, r); - OpenGl_TRACE(glTexCoord3i) - } - - inline void glTexCoord3s (GLshort s, GLshort t, GLshort r) - { - ::glTexCoord3s(s, t, r); - OpenGl_TRACE(glTexCoord3s) - } - - inline void glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q) - { - ::glTexCoord4d(s, t, r, q); - OpenGl_TRACE(glTexCoord4d) - } - - inline void glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q) - { - ::glTexCoord4f(s, t, r, q); - OpenGl_TRACE(glTexCoord4f) - } - - inline void glTexCoord4i (GLint s, GLint t, GLint r, GLint q) - { - ::glTexCoord4i(s, t, r, q); - OpenGl_TRACE(glTexCoord4i) - } - - inline void glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q) - { - ::glTexCoord4s(s, t, r, q); - OpenGl_TRACE(glTexCoord4s) - } - - inline void glTexCoord1dv (const GLdouble* theVec1) - { - ::glTexCoord1dv (theVec1); - OpenGl_TRACE(glTexCoord1dv) - } - - inline void glTexCoord1fv (const GLfloat* theVec1) - { - ::glTexCoord1fv (theVec1); - OpenGl_TRACE(glTexCoord1fv) - } - - inline void glTexCoord1iv (const GLint* theVec1) - { - ::glTexCoord1iv (theVec1); - OpenGl_TRACE(glTexCoord1iv) - } - - inline void glTexCoord1sv (const GLshort* theVec1) - { - ::glTexCoord1sv (theVec1); - OpenGl_TRACE(glTexCoord1sv) - } - - inline void glTexCoord2dv (const GLdouble* theVec2) - { - ::glTexCoord2dv (theVec2); - OpenGl_TRACE(glTexCoord2dv) - } - - inline void glTexCoord2fv (const GLfloat* theVec2) - { - ::glTexCoord2fv (theVec2); - OpenGl_TRACE(glTexCoord2fv) - } - - inline void glTexCoord2iv (const GLint* theVec2) - { - ::glTexCoord2iv (theVec2); - OpenGl_TRACE(glTexCoord2iv) - } - - inline void glTexCoord2sv (const GLshort* theVec) - { - ::glTexCoord2sv (theVec); - OpenGl_TRACE(glTexCoord2sv) - } - - inline void glTexCoord3dv (const GLdouble* theVec3) - { - ::glTexCoord3dv (theVec3); - OpenGl_TRACE(glTexCoord3dv) - } - - inline void glTexCoord3fv (const GLfloat* theVec3) - { - ::glTexCoord3fv (theVec3); - OpenGl_TRACE(glTexCoord3fv) - } - - inline void glTexCoord3iv (const GLint* theVec3) - { - ::glTexCoord3iv (theVec3); - OpenGl_TRACE(glTexCoord3iv) - } - - inline void glTexCoord3sv (const GLshort* theVec3) - { - ::glTexCoord3sv (theVec3); - OpenGl_TRACE(glTexCoord3sv) - } - - inline void glTexCoord4dv (const GLdouble* theVec4) - { - ::glTexCoord4dv (theVec4); - OpenGl_TRACE(glTexCoord4dv) - } - - inline void glTexCoord4fv (const GLfloat* theVec4) - { - ::glTexCoord4fv (theVec4); - OpenGl_TRACE(glTexCoord4fv) - } - - inline void glTexCoord4iv (const GLint* theVec4) - { - ::glTexCoord4iv (theVec4); - OpenGl_TRACE(glTexCoord4iv) - } - - inline void glTexCoord4sv (const GLshort* theVec4) - { - ::glTexCoord4sv (theVec4); - OpenGl_TRACE(glTexCoord4sv) - } - public: //! @name Matrix operations (removed since 3.1) inline void glMatrixMode (GLenum theMode) @@ -715,67 +62,19 @@ public: //! @name Matrix operations (removed since 3.1) OpenGl_TRACE(glMatrixMode) } - inline void glOrtho (GLdouble theLeft, GLdouble theRight, - GLdouble theBottom, GLdouble theTop, - GLdouble theNearVal, GLdouble theFarVal) - { - ::glOrtho (theLeft, theRight, theBottom, theTop, theNearVal, theFarVal); - OpenGl_TRACE(glOrtho) - } - - inline void glFrustum (GLdouble theLeft, GLdouble theRight, - GLdouble theBottom, GLdouble theTop, - GLdouble theNearVal, GLdouble theFarVal) - { - ::glFrustum (theLeft, theRight, theBottom, theTop, theNearVal, theFarVal); - OpenGl_TRACE(glFrustum) - } - - inline void glPushMatrix() - { - ::glPushMatrix(); - OpenGl_TRACE(glPushMatrix) - } - - inline void glPopMatrix() - { - ::glPopMatrix(); - OpenGl_TRACE(glPopMatrix) - } - inline void glLoadIdentity() { ::glLoadIdentity(); OpenGl_TRACE(glLoadIdentity) } - inline void glLoadMatrixd (const GLdouble* theMatrix) - { - ::glLoadMatrixd (theMatrix); - OpenGl_TRACE(glLoadMatrixd) - } - inline void glLoadMatrixf (const GLfloat* theMatrix) { ::glLoadMatrixf (theMatrix); OpenGl_TRACE(glLoadMatrixf) } - inline void glMultMatrixd (const GLdouble* theMatrix) - { - ::glMultMatrixd (theMatrix); - OpenGl_TRACE(glMultMatrixd) - } - - inline void glMultMatrixf (const GLfloat* theMatrix) - { - ::glMultMatrixf (theMatrix); - OpenGl_TRACE(glMultMatrixf) - } - -public: //! @name Line and Polygon stripple (removed since 3.1) - - //void glLineWidth (GLfloat theWidth) { ::glLineWidth (theWidth); } +public: //! @name Line and Polygon stipple (removed since 3.1) inline void glLineStipple (GLint theFactor, GLushort thePattern) { @@ -789,38 +88,6 @@ public: //! @name Line and Polygon stripple (removed since 3.1) OpenGl_TRACE(glPolygonStipple) } - inline void glGetPolygonStipple (GLubyte* theMask) - { - ::glGetPolygonStipple (theMask); - OpenGl_TRACE(glGetPolygonStipple) - } - -public: //! @name Attribute stacks (removed since 3.1) - - inline void glPushAttrib (GLbitfield theMask) - { - ::glPushAttrib (theMask); - OpenGl_TRACE(glPushAttrib) - } - - inline void glPopAttrib() - { - ::glPopAttrib(); - OpenGl_TRACE(glPopAttrib) - } - - inline void glPushClientAttrib (GLbitfield theMask) - { - ::glPushClientAttrib (theMask); - OpenGl_TRACE(glPushClientAttrib) - } - - inline void glPopClientAttrib() - { - ::glPopClientAttrib(); - OpenGl_TRACE(glPopClientAttrib) - } - public: //! @name Fixed pipeline lighting (removed since 3.1) inline void glShadeModel (GLenum theMode) @@ -835,42 +102,12 @@ public: //! @name Fixed pipeline lighting (removed since 3.1) OpenGl_TRACE(glLightf) } - inline void glLighti (GLenum theLight, GLenum pname, GLint param) - { - ::glLighti (theLight, pname, param); - OpenGl_TRACE(glLighti) - } - inline void glLightfv (GLenum theLight, GLenum pname, const GLfloat* params) { ::glLightfv (theLight, pname, params); OpenGl_TRACE(glLightfv) } - inline void glLightiv (GLenum theLight, GLenum pname, const GLint* params) - { - ::glLightiv (theLight, pname, params); - OpenGl_TRACE(glLightiv) - } - - inline void glGetLightfv (GLenum theLight, GLenum pname, GLfloat *params) - { - ::glGetLightfv (theLight, pname, params); - OpenGl_TRACE(glGetLightfv) - } - - inline void glGetLightiv (GLenum theLight, GLenum pname, GLint *params) - { - ::glGetLightiv (theLight, pname, params); - OpenGl_TRACE(glGetLightiv) - } - - inline void glLightModelf (GLenum pname, GLfloat param) - { - ::glLightModelf(pname, param); - OpenGl_TRACE(glLightModelf) - } - inline void glLightModeli (GLenum pname, GLint param) { ::glLightModeli(pname, param); @@ -883,48 +120,18 @@ public: //! @name Fixed pipeline lighting (removed since 3.1) OpenGl_TRACE(glLightModelfv) } - inline void glLightModeliv (GLenum pname, const GLint* params) - { - ::glLightModeliv(pname, params); - OpenGl_TRACE(glLightModeliv) - } - inline void glMaterialf (GLenum face, GLenum pname, GLfloat param) { ::glMaterialf(face, pname, param); OpenGl_TRACE(glMaterialf) } - inline void glMateriali (GLenum face, GLenum pname, GLint param) - { - ::glMateriali(face, pname, param); - OpenGl_TRACE(glMateriali) - } - inline void glMaterialfv (GLenum face, GLenum pname, const GLfloat* params) { ::glMaterialfv(face, pname, params); OpenGl_TRACE(glMaterialfv) } - inline void glMaterialiv (GLenum face, GLenum pname, const GLint* params) - { - ::glMaterialiv(face, pname, params); - OpenGl_TRACE(glMaterialiv) - } - - inline void glGetMaterialfv (GLenum face, GLenum pname, GLfloat* params) - { - ::glGetMaterialfv(face, pname, params); - OpenGl_TRACE(glGetMaterialfv) - } - - inline void glGetMaterialiv (GLenum face, GLenum pname, GLint* params) - { - ::glGetMaterialiv(face, pname, params); - OpenGl_TRACE(glGetMaterialiv) - } - inline void glColorMaterial (GLenum face, GLenum mode) { ::glColorMaterial(face, mode); @@ -939,21 +146,8 @@ public: //! @name clipping plane (removed since 3.1) OpenGl_TRACE(glClipPlane) } - inline void glGetClipPlane (GLenum thePlane, GLdouble* theEquation) - { - ::glGetClipPlane (thePlane, theEquation); - OpenGl_TRACE(glGetClipPlane) - } - public: //! @name Display lists (removed since 3.1) - inline GLboolean glIsList (GLuint theList) - { - const GLboolean aRes = ::glIsList (theList); - OpenGl_TRACE(glIsList) - return aRes; - } - inline void glDeleteLists (GLuint theList, GLsizei theRange) { ::glDeleteLists (theList, theRange); @@ -999,269 +193,32 @@ public: //! @name Display lists (removed since 3.1) public: //! @name Current raster position and Rectangles (removed since 3.1) - inline void glRasterPos2d (GLdouble x, GLdouble y) - { - ::glRasterPos2d (x, y); - OpenGl_TRACE(glRasterPos2d) - } - - inline void glRasterPos2f (GLfloat x, GLfloat y) - { - ::glRasterPos2f (x, y); - OpenGl_TRACE(glRasterPos2f) - } - inline void glRasterPos2i (GLint x, GLint y) { ::glRasterPos2i (x, y); OpenGl_TRACE(glRasterPos2i) } - inline void glRasterPos2s (GLshort x, GLshort y) - { - ::glRasterPos2s (x, y); - OpenGl_TRACE(glRasterPos2s) - } - - inline void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z) - { - ::glRasterPos3d (x, y, z); - OpenGl_TRACE(glRasterPos3d) - } - - inline void glRasterPos3f (GLfloat x, GLfloat y, GLfloat z) - { - ::glRasterPos3f (x, y, z); - OpenGl_TRACE(glRasterPos3f) - } - - inline void glRasterPos3i (GLint x, GLint y, GLint z) - { - ::glRasterPos3i (x, y, z); - OpenGl_TRACE(glRasterPos3i) - } - - inline void glRasterPos3s (GLshort x, GLshort y, GLshort z) - { - ::glRasterPos3s (x, y, z); - OpenGl_TRACE(glRasterPos3s) - } - - inline void glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w) - { - ::glRasterPos4d (x, y, z, w); - OpenGl_TRACE(glRasterPos4d) - } - - inline void glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w) - { - ::glRasterPos4f (x, y, z, w); - OpenGl_TRACE(glRasterPos4f) - } - - inline void glRasterPos4i (GLint x, GLint y, GLint z, GLint w) - { - ::glRasterPos4i (x, y, z, w); - OpenGl_TRACE(glRasterPos4i) - } - - inline void glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w) - { - ::glRasterPos4s (x, y, z, w); - OpenGl_TRACE(glRasterPos4s) - } - - inline void glRasterPos2dv (const GLdouble* theVec) - { - ::glRasterPos2dv (theVec); - OpenGl_TRACE(glRasterPos2dv) - } - - inline void glRasterPos2fv (const GLfloat* theVec) - { - ::glRasterPos2fv (theVec); - OpenGl_TRACE(glRasterPos2fv) - } - - inline void glRasterPos2iv (const GLint* theVec) - { - ::glRasterPos2iv (theVec); - OpenGl_TRACE(glRasterPos2iv) - } - - inline void glRasterPos2sv (const GLshort* theVec) - { - ::glRasterPos2sv (theVec); - OpenGl_TRACE(glRasterPos2sv) - } - - inline void glRasterPos3dv (const GLdouble* theVec) - { - ::glRasterPos3dv (theVec); - OpenGl_TRACE(glRasterPos3dv) - } - inline void glRasterPos3fv (const GLfloat* theVec) { ::glRasterPos3fv (theVec); OpenGl_TRACE(glRasterPos3fv) } - inline void glRasterPos3iv (const GLint* theVec) - { - ::glRasterPos3iv (theVec); - OpenGl_TRACE(glRasterPos3iv) - } - - inline void glRasterPos3sv (const GLshort* theVec) - { - ::glRasterPos3sv (theVec); - OpenGl_TRACE(glRasterPos3sv) - } - - inline void glRasterPos4dv (const GLdouble* theVec) - { - ::glRasterPos4dv (theVec); - OpenGl_TRACE(glRasterPos4dv) - } - - inline void glRasterPos4fv (const GLfloat* theVec) - { - ::glRasterPos4fv (theVec); - OpenGl_TRACE(glRasterPos4fv) - } - - inline void glRasterPos4iv (const GLint* theVec) - { - ::glRasterPos4iv (theVec); - OpenGl_TRACE(glRasterPos4iv) - } - - inline void glRasterPos4sv (const GLshort* theVec) - { - ::glRasterPos4sv (theVec); - OpenGl_TRACE(glRasterPos4sv) - } - - inline void glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) - { - ::glRectd (x1, y1, x2, y2); - OpenGl_TRACE(glRectd) - } - - inline void glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) - { - ::glRectf (x1, y1, x2, y2); - OpenGl_TRACE(glRectf) - } - - inline void glRecti (GLint x1, GLint y1, GLint x2, GLint y2) - { - ::glRecti (x1, y1, x2, y2); - OpenGl_TRACE(glRecti) - } - - inline void glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2) - { - ::glRects (x1, y1, x2, y2); - OpenGl_TRACE(glRects) - } - - inline void glRectdv (const GLdouble* v1, const GLdouble* v2) - { - ::glRectdv (v1, v2); - OpenGl_TRACE(glRectdv) - } - - inline void glRectfv (const GLfloat* v1, const GLfloat* v2) - { - ::glRectfv (v1, v2); - OpenGl_TRACE(glRectfv) - } - - inline void glRectiv (const GLint* v1, const GLint* v2) - { - ::glRectiv (v1, v2); - OpenGl_TRACE(glRectiv) - } - - inline void glRectsv (const GLshort* v1, const GLshort* v2) - { - ::glRectsv (v1, v2); - OpenGl_TRACE(glRectsv) - } - public: //! @name Texture mapping (removed since 3.1) - inline void glTexGend (GLenum coord, GLenum pname, GLdouble param) - { - ::glTexGend (coord, pname, param); - OpenGl_TRACE(glTexGend) - } - - inline void glTexGenf (GLenum coord, GLenum pname, GLfloat param) - { - ::glTexGenf (coord, pname, param); - OpenGl_TRACE(glTexGenf) - } - inline void glTexGeni (GLenum coord, GLenum pname, GLint param) { ::glTexGeni (coord, pname, param); OpenGl_TRACE(glTexGeni) } - inline void glTexGendv (GLenum coord, GLenum pname, const GLdouble* params) - { - ::glTexGendv (coord, pname, params); - OpenGl_TRACE(glTexGendv) - } - inline void glTexGenfv (GLenum coord, GLenum pname, const GLfloat* params) { ::glTexGenfv (coord, pname, params); OpenGl_TRACE(glTexGenfv) } - inline void glTexGeniv (GLenum coord, GLenum pname, const GLint* params) - { - ::glTexGeniv (coord, pname, params); - OpenGl_TRACE(glTexGeniv) - } - - inline void glGetTexGendv (GLenum coord, GLenum pname, GLdouble* params) - { - ::glGetTexGendv (coord, pname, params); - OpenGl_TRACE(glGetTexGendv) - } - - inline void glGetTexGenfv (GLenum coord, GLenum pname, GLfloat* params) - { - ::glGetTexGenfv (coord, pname, params); - OpenGl_TRACE(glGetTexGenfv) - } - - inline void glGetTexGeniv (GLenum coord, GLenum pname, GLint* params) - { - ::glGetTexGeniv (coord, pname, params); - OpenGl_TRACE(glGetTexGeniv) - } - -public: //! @name Resident textures and priorities (removed since 3.1) - - inline void glPrioritizeTextures (GLsizei n, const GLuint* textures, const GLclampf* priorities) - { - ::glPrioritizeTextures (n, textures, priorities); - OpenGl_TRACE(glPrioritizeTextures) - } - - inline GLboolean glAreTexturesResident (GLsizei n, const GLuint* textures, GLboolean* residences) - { - const GLboolean aRes = ::glAreTexturesResident (n, textures, residences); - OpenGl_TRACE(glAreTexturesResident) - return aRes; - } - public: //! @name Pixel copying (removed since 3.1) inline void glDrawPixels (GLsizei width, GLsizei height, @@ -1289,286 +246,14 @@ public: //! @name Pixel copying (removed since 3.1) OpenGl_TRACE(glBitmap) } - inline void glPixelZoom (GLfloat xfactor, GLfloat yfactor) - { - ::glPixelZoom (xfactor, yfactor); - OpenGl_TRACE(glPixelZoom) - } - -public: //! @name Fog and all associated parameters (removed since 3.1) - - inline void glFogf (GLenum pname, GLfloat param) - { - ::glFogf (pname, param); - OpenGl_TRACE(glFogf) - } - - inline void glFogi (GLenum pname, GLint param) - { - ::glFogi (pname, param); - OpenGl_TRACE(glFogi) - } - - inline void glFogfv (GLenum pname, const GLfloat* params) - { - ::glFogfv (pname, params); - OpenGl_TRACE(glFogfv) - } - - inline void glFogiv (GLenum pname, const GLint* params) - { - ::glFogiv (pname, params); - OpenGl_TRACE(glFogiv) - } - -public: //! @name Evaluators (removed since 3.1) - - inline void glMap1d (GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble* points) - { - ::glMap1d (target, u1, u2, stride, order, points); - OpenGl_TRACE(glMap1d) - } - - inline void glMap1f (GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat* points) - { - ::glMap1f (target, u1, u2, stride, order, points); - OpenGl_TRACE(glMap1f) - } - - inline void glMap2d (GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble* points) - { - ::glMap2d (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - OpenGl_TRACE(glMap2d) - } - - inline void glMap2f (GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat* points) - { - ::glMap2f (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - OpenGl_TRACE(glMap2f) - } - - inline void glGetMapdv (GLenum target, GLenum query, GLdouble* v) - { - ::glGetMapdv (target, query, v); - OpenGl_TRACE(glGetMapdv) - } - - inline void glGetMapfv (GLenum target, GLenum query, GLfloat* v) - { - ::glGetMapfv (target, query, v); - OpenGl_TRACE(glGetMapfv) - } - - inline void glGetMapiv (GLenum target, GLenum query, GLint* v) - { - ::glGetMapiv (target, query, v); - OpenGl_TRACE(glGetMapiv) - } - - inline void glEvalCoord1d (GLdouble u) - { - ::glEvalCoord1d (u); - OpenGl_TRACE(glEvalCoord1d) - } - - inline void glEvalCoord1f (GLfloat u) - { - ::glEvalCoord1f (u); - OpenGl_TRACE(glEvalCoord1f) - } - - inline void glEvalCoord1dv (const GLdouble* u) - { - ::glEvalCoord1dv (u); - OpenGl_TRACE(glEvalCoord1dv) - } - - inline void glEvalCoord1fv (const GLfloat* u) - { - ::glEvalCoord1fv (u); - OpenGl_TRACE(glEvalCoord1fv) - } - - inline void glEvalCoord2d (GLdouble u, GLdouble v) - { - ::glEvalCoord2d (u, v); - OpenGl_TRACE(glEvalCoord2d) - } - - inline void glEvalCoord2f (GLfloat u, GLfloat v) - { - ::glEvalCoord2f (u, v); - OpenGl_TRACE(glEvalCoord2f) - } - - inline void glEvalCoord2dv (const GLdouble* u) - { - ::glEvalCoord2dv (u); - OpenGl_TRACE(glEvalCoord2dv) - } - - inline void glEvalCoord2fv (const GLfloat* u) - { - ::glEvalCoord2fv (u); - OpenGl_TRACE(glEvalCoord2fv) - } - - inline void glMapGrid1d (GLint un, GLdouble u1, GLdouble u2) - { - ::glMapGrid1d (un, u1, u2); - OpenGl_TRACE(glMapGrid1d) - } - - inline void glMapGrid1f (GLint un, GLfloat u1, GLfloat u2) - { - ::glMapGrid1f (un, u1, u2); - OpenGl_TRACE(glMapGrid1f) - } - - inline void glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2) - { - ::glMapGrid2d (un, u1, u2, vn, v1, v2); - OpenGl_TRACE(glMapGrid2d) - } - - inline void glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2) - { - ::glMapGrid2f (un, u1, u2, vn, v1, v2); - OpenGl_TRACE(glMapGrid2f) - } - - inline void glEvalPoint1 (GLint i) - { - ::glEvalPoint1 (i); - OpenGl_TRACE(glEvalPoint1) - } - - inline void glEvalPoint2 (GLint i, GLint j) - { - ::glEvalPoint2 (i, j); - OpenGl_TRACE(glEvalPoint2) - } - - inline void glEvalMesh1 (GLenum mode, GLint i1, GLint i2) - { - ::glEvalMesh1 (mode, i1, i2); - OpenGl_TRACE(glEvalMesh1) - } - - inline void glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) - { - ::glEvalMesh2 (mode, i1, i2, j1, j2); - OpenGl_TRACE(glEvalMesh2) - } - -public: //! @name Selection and feedback modes (removed since 3.1) - - inline void glFeedbackBuffer (GLsizei theSize, GLenum theType, GLfloat* theBuffer) - { - ::glFeedbackBuffer (theSize, theType, theBuffer); - OpenGl_TRACE(glFeedbackBuffer) - } - - inline void glPassThrough (GLfloat token) - { - ::glPassThrough (token); - OpenGl_TRACE(glPassThrough) - } - - inline void glSelectBuffer (GLsizei theSize, GLuint* theBuffer) - { - ::glSelectBuffer (theSize, theBuffer); - OpenGl_TRACE(glSelectBuffer) - } - - inline void glInitNames() - { - ::glInitNames(); - OpenGl_TRACE(glInitNames) - } - - inline void glLoadName (GLuint theName) - { - ::glLoadName (theName); - OpenGl_TRACE(glLoadName) - } - - inline void glPushName (GLuint theName) - { - ::glPushName (theName); - OpenGl_TRACE(glPushName) - } - - inline void glPopName() - { - ::glPopName(); - OpenGl_TRACE(glPopName) - } - -public: //! @name Accumulation Buffer (removed since 3.1) - - inline void glClearAccum (GLfloat theRed, GLfloat theGreen, GLfloat theBlue, GLfloat theAlpha) - { - ::glClearAccum (theRed, theGreen, theBlue, theAlpha); - OpenGl_TRACE(glClearAccum) - } - - inline void glAccum (GLenum theOp, GLfloat theValue) - { - ::glAccum (theOp, theValue); - OpenGl_TRACE(glAccum) - } - public: //! @name Edge flags and fixed-function vertex processing (removed since 3.1) - inline void glEdgeFlag (GLboolean theFlag) - { - ::glEdgeFlag (theFlag); - OpenGl_TRACE(glEdgeFlag) - } - - inline void glEdgeFlagv (const GLboolean* theFlag) - { - ::glEdgeFlagv (theFlag); - OpenGl_TRACE(glEdgeFlagv) - } - inline void glIndexPointer (GLenum theType, GLsizei theStride, const GLvoid* thePtr) { ::glIndexPointer (theType, theStride, thePtr); OpenGl_TRACE(glIndexPointer) } - inline void glEdgeFlagPointer (GLsizei theStride, const GLvoid* thePtr) - { - ::glEdgeFlagPointer (theStride, thePtr); - OpenGl_TRACE(glEdgeFlagPointer) - } - - inline void glGetPointerv (GLenum pname, GLvoid** params) - { - ::glGetPointerv(pname, params); - OpenGl_TRACE(glGetPointerv) - } - - inline void glInterleavedArrays (GLenum theFormat, GLsizei theStride, const GLvoid* thePointer) - { - ::glInterleavedArrays (theFormat, theStride, thePointer); - OpenGl_TRACE(glInterleavedArrays) - } - inline void glVertexPointer (GLint theSize, GLenum theType, GLsizei theStride, const GLvoid* thePtr) { ::glVertexPointer (theSize, theType, theStride, thePtr); diff --git a/src/OpenGl/OpenGl_GlCore12.hxx b/src/OpenGl/OpenGl_GlCore12.hxx index da93402ff0..fd2fc999f7 100644 --- a/src/OpenGl/OpenGl_GlCore12.hxx +++ b/src/OpenGl/OpenGl_GlCore12.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 1.2 core based on 1.1 version. -template -struct OpenGl_TmplCore12 : public theBaseClass_t +struct OpenGl_GlCore12 : public OpenGl_GlCore11Fwd { +private: + typedef OpenGl_GlCore11Fwd theBaseClass_t; public: //! @name OpenGL 1.2 additives to 1.1 @@ -37,10 +38,4 @@ public: //! @name OpenGL 1.2 additives to 1.1 }; -//! OpenGL 1.2 core based on 1.1 version. -typedef OpenGl_TmplCore12 OpenGl_GlCore12; - -//! OpenGL 1.2 without deprecated entry points. -typedef OpenGl_TmplCore12 OpenGl_GlCore12Fwd; - #endif // _OpenGl_GlCore12_Header diff --git a/src/OpenGl/OpenGl_GlCore13.hxx b/src/OpenGl/OpenGl_GlCore13.hxx index ac462df4fc..ee1775ac13 100644 --- a/src/OpenGl/OpenGl_GlCore13.hxx +++ b/src/OpenGl/OpenGl_GlCore13.hxx @@ -19,27 +19,6 @@ #include //! OpenGL 1.3 without deprecated entry points. -struct OpenGl_GlCore13Fwd : public OpenGl_GlCore12Fwd -{ - -public: //! @name OpenGL 1.3 additives to 1.2 - -#if !defined(GL_ES_VERSION_2_0) - using OpenGl_GlFunctions::glCompressedTexImage3D; - using OpenGl_GlFunctions::glCompressedTexImage1D; - using OpenGl_GlFunctions::glCompressedTexSubImage3D; - using OpenGl_GlFunctions::glCompressedTexSubImage1D; - using OpenGl_GlFunctions::glGetCompressedTexImage; -#endif - - using OpenGl_GlFunctions::glActiveTexture; - using OpenGl_GlFunctions::glSampleCoverage; - using OpenGl_GlFunctions::glCompressedTexImage2D; - using OpenGl_GlFunctions::glCompressedTexSubImage2D; - -}; - -//! OpenGL 1.3 core based on 1.2 version. struct OpenGl_GlCore13 : public OpenGl_GlCore12 { @@ -58,54 +37,6 @@ public: //! @name OpenGL 1.3 additives to 1.2 using OpenGl_GlFunctions::glCompressedTexImage2D; using OpenGl_GlFunctions::glCompressedTexSubImage2D; -#if !defined(GL_ES_VERSION_2_0) - -public: //! @name Begin/End primitive specification (removed since 3.1) - - using OpenGl_GlFunctions::glMultiTexCoord1d; - using OpenGl_GlFunctions::glMultiTexCoord1dv; - using OpenGl_GlFunctions::glMultiTexCoord1f; - using OpenGl_GlFunctions::glMultiTexCoord1fv; - using OpenGl_GlFunctions::glMultiTexCoord1i; - using OpenGl_GlFunctions::glMultiTexCoord1iv; - using OpenGl_GlFunctions::glMultiTexCoord1s; - using OpenGl_GlFunctions::glMultiTexCoord1sv; - using OpenGl_GlFunctions::glMultiTexCoord2d; - using OpenGl_GlFunctions::glMultiTexCoord2dv; - using OpenGl_GlFunctions::glMultiTexCoord2f; - using OpenGl_GlFunctions::glMultiTexCoord2fv; - using OpenGl_GlFunctions::glMultiTexCoord2i; - using OpenGl_GlFunctions::glMultiTexCoord2iv; - using OpenGl_GlFunctions::glMultiTexCoord2s; - using OpenGl_GlFunctions::glMultiTexCoord2sv; - using OpenGl_GlFunctions::glMultiTexCoord3d; - using OpenGl_GlFunctions::glMultiTexCoord3dv; - using OpenGl_GlFunctions::glMultiTexCoord3f; - using OpenGl_GlFunctions::glMultiTexCoord3fv; - using OpenGl_GlFunctions::glMultiTexCoord3i; - using OpenGl_GlFunctions::glMultiTexCoord3iv; - using OpenGl_GlFunctions::glMultiTexCoord3s; - using OpenGl_GlFunctions::glMultiTexCoord3sv; - using OpenGl_GlFunctions::glMultiTexCoord4d; - using OpenGl_GlFunctions::glMultiTexCoord4dv; - using OpenGl_GlFunctions::glMultiTexCoord4f; - using OpenGl_GlFunctions::glMultiTexCoord4fv; - using OpenGl_GlFunctions::glMultiTexCoord4i; - using OpenGl_GlFunctions::glMultiTexCoord4iv; - using OpenGl_GlFunctions::glMultiTexCoord4s; - using OpenGl_GlFunctions::glMultiTexCoord4sv; - - using OpenGl_GlFunctions::glClientActiveTexture; - -public: //! @name Matrix operations (removed since 3.1) - - using OpenGl_GlFunctions::glLoadTransposeMatrixf; - using OpenGl_GlFunctions::glLoadTransposeMatrixd; - using OpenGl_GlFunctions::glMultTransposeMatrixf; - using OpenGl_GlFunctions::glMultTransposeMatrixd; - -#endif - }; #endif // _OpenGl_GlCore13_Header diff --git a/src/OpenGl/OpenGl_GlCore14.hxx b/src/OpenGl/OpenGl_GlCore14.hxx index fbcc98bfba..25cf04211d 100644 --- a/src/OpenGl/OpenGl_GlCore14.hxx +++ b/src/OpenGl/OpenGl_GlCore14.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 1.4 core based on 1.3 version. -template -struct OpenGl_TmplCore14 : public theBaseClass_t +struct OpenGl_GlCore14 : public OpenGl_GlCore13 { +private: + typedef OpenGl_GlCore13 theBaseClass_t; public: //! @name OpenGL 1.4 additives to 1.3 @@ -38,10 +39,4 @@ public: //! @name OpenGL 1.4 additives to 1.3 }; -//! OpenGL 1.4 core based on 1.3 version. -typedef OpenGl_TmplCore14 OpenGl_GlCore14; - -//! OpenGL 1.4 without deprecated entry points. -typedef OpenGl_TmplCore14 OpenGl_GlCore14Fwd; - #endif // _OpenGl_GlCore14_Header diff --git a/src/OpenGl/OpenGl_GlCore15.hxx b/src/OpenGl/OpenGl_GlCore15.hxx index fb428963d0..4c7b4ac866 100644 --- a/src/OpenGl/OpenGl_GlCore15.hxx +++ b/src/OpenGl/OpenGl_GlCore15.hxx @@ -18,12 +18,11 @@ #include -/** - * OpenGL 1.5 core based on 1.4 version. - */ -template -struct OpenGl_TmplCore15 : public theBaseClass_t +//! OpenGL 1.5 core based on 1.4 version. +struct OpenGl_GlCore15 : public OpenGl_GlCore14 { +private: + typedef OpenGl_GlCore14 theBaseClass_t; public: //! @name OpenGL 1.5 additives to 1.4 @@ -53,10 +52,4 @@ public: //! @name OpenGL 1.5 additives to 1.4 }; -//! OpenGL 1.5 core based on 1.4 version. -typedef OpenGl_TmplCore15 OpenGl_GlCore15; - -//! OpenGL 1.5 without deprecated entry points. -typedef OpenGl_TmplCore15 OpenGl_GlCore15Fwd; - #endif // _OpenGl_GlCore15_Header diff --git a/src/OpenGl/OpenGl_GlCore20.hxx b/src/OpenGl/OpenGl_GlCore20.hxx index f6aacfa723..c1ab819ad2 100644 --- a/src/OpenGl/OpenGl_GlCore20.hxx +++ b/src/OpenGl/OpenGl_GlCore20.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 2.0 core based on 1.5 version. -template -struct OpenGl_TmplCore20 : public theBaseClass_t +struct OpenGl_GlCore20 : public OpenGl_GlCore15 { +private: + typedef OpenGl_GlCore15 theBaseClass_t; public: //! @name OpenGL 2.0 additives to 1.5 @@ -124,10 +125,4 @@ public: //! @name OpenGL 2.0 additives to 1.5 }; -//! OpenGL 2.0 core based on 1.5 version. -typedef OpenGl_TmplCore20 OpenGl_GlCore20; - -//! OpenGL 2.0 without deprecated entry points. -typedef OpenGl_TmplCore20 OpenGl_GlCore20Fwd; - #endif // _OpenGl_GlCore20_Header diff --git a/src/OpenGl/OpenGl_GlCore21.hxx b/src/OpenGl/OpenGl_GlCore21.hxx index 231e4b0669..74ee21a0fc 100644 --- a/src/OpenGl/OpenGl_GlCore21.hxx +++ b/src/OpenGl/OpenGl_GlCore21.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 2.1 core based on 2.0 version. -template -struct OpenGl_TmplCore21 : public theBaseClass_t +struct OpenGl_GlCore21 : public OpenGl_GlCore20 { +private: + typedef OpenGl_GlCore20 theBaseClass_t; public: //! @name OpenGL 2.1 additives to 2.0 @@ -38,10 +39,4 @@ public: //! @name OpenGL 2.1 additives to 2.0 }; -//! OpenGL 2.1 core based on 2.0 version. -typedef OpenGl_TmplCore21 OpenGl_GlCore21; - -//! OpenGL 2.1 without deprecated entry points. -typedef OpenGl_TmplCore21 OpenGl_GlCore21Fwd; - #endif // _OpenGl_GlCore21_Header diff --git a/src/OpenGl/OpenGl_GlCore30.hxx b/src/OpenGl/OpenGl_GlCore30.hxx index 3c24b4bfce..63b66e4677 100644 --- a/src/OpenGl/OpenGl_GlCore30.hxx +++ b/src/OpenGl/OpenGl_GlCore30.hxx @@ -22,9 +22,10 @@ //! This is first version with deprecation model introduced //! - a lot of functionality regarding to fixed pipeline were marked deprecated. //! Notice that nothing were actually removed in this version (unless Forward context loaded)! -template -struct OpenGl_TmplCore30 : public theBaseClass_t +struct OpenGl_GlCore30 : public OpenGl_GlCore21 { +private: + typedef OpenGl_GlCore21 theBaseClass_t; public: //! @name GL_ARB_framebuffer_object (added to OpenGL 3.0 core) @@ -150,11 +151,4 @@ public: //! @name OpenGL 3.0 additives to 2.1 #endif }; -//! OpenGL 3.0 core based on 2.1 version. -typedef OpenGl_TmplCore30 OpenGl_GlCore30; - -//! OpenGL 3.0 without deprecated entry points. -//! Notice that this doesn't actually corresponds to GL3.0 forward profile! -typedef OpenGl_TmplCore30 OpenGl_GlCore30Fwd; - #endif // _OpenGl_GlCore30_Header diff --git a/src/OpenGl/OpenGl_GlCore31.hxx b/src/OpenGl/OpenGl_GlCore31.hxx index 4092662d74..4c102a2765 100644 --- a/src/OpenGl/OpenGl_GlCore31.hxx +++ b/src/OpenGl/OpenGl_GlCore31.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 3.1 definition. -template -struct OpenGl_TmplCore31 : public theBaseClass_t +struct OpenGl_GlCore31 : public OpenGl_GlCore30 { +private: + typedef OpenGl_GlCore30 theBaseClass_t; public: //! @name GL_ARB_uniform_buffer_object (added to OpenGL 3.1 core) @@ -50,11 +51,4 @@ public: //! @name OpenGL 3.1 additives to 3.0 }; -//! OpenGL 3.1 compatibility profile. -typedef OpenGl_TmplCore31 OpenGl_GlCore31Back; - -//! OpenGL 3.1 core profile (without removed entry points marked as deprecated in 3.0). -//! Notice that GLSL versions 1.10 and 1.20 also removed in 3.1! -typedef OpenGl_TmplCore31 OpenGl_GlCore31; - #endif // _OpenGl_GlCore31_Header diff --git a/src/OpenGl/OpenGl_GlCore32.hxx b/src/OpenGl/OpenGl_GlCore32.hxx index 972686492b..7ad6cd2ba1 100644 --- a/src/OpenGl/OpenGl_GlCore32.hxx +++ b/src/OpenGl/OpenGl_GlCore32.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 3.2 definition. -template -struct OpenGl_TmplCore32 : public theBaseClass_t +struct OpenGl_GlCore32 : public OpenGl_GlCore31 { +private: + typedef OpenGl_GlCore31 theBaseClass_t; #if !defined(GL_ES_VERSION_2_0) @@ -63,10 +64,4 @@ public: //! @name OpenGL 3.2 additives to 3.1 }; -//! OpenGL 3.2 compatibility profile. -typedef OpenGl_TmplCore32 OpenGl_GlCore32Back; - -//! OpenGL 3.2 core profile. -typedef OpenGl_TmplCore32 OpenGl_GlCore32; - #endif // _OpenGl_GlCore32_Header diff --git a/src/OpenGl/OpenGl_GlCore33.hxx b/src/OpenGl/OpenGl_GlCore33.hxx index 7e32c50402..9605d67e56 100644 --- a/src/OpenGl/OpenGl_GlCore33.hxx +++ b/src/OpenGl/OpenGl_GlCore33.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 3.3 definition. -template -struct OpenGl_TmplCore33 : public theBaseClass_t +struct OpenGl_GlCore33 : public OpenGl_GlCore32 { +private: + typedef OpenGl_GlCore32 theBaseClass_t; #if !defined(GL_ES_VERSION_2_0) @@ -72,10 +73,4 @@ public: //! @name OpenGL 3.3 additives to 3.2 }; -//! OpenGL 3.3 compatibility profile. -typedef OpenGl_TmplCore33 OpenGl_GlCore33Back; - -//! OpenGL 3.3 core profile. -typedef OpenGl_TmplCore33 OpenGl_GlCore33; - #endif // _OpenGl_GlCore33_Header diff --git a/src/OpenGl/OpenGl_GlCore40.hxx b/src/OpenGl/OpenGl_GlCore40.hxx index 60d8d41ee6..c59af42c11 100644 --- a/src/OpenGl/OpenGl_GlCore40.hxx +++ b/src/OpenGl/OpenGl_GlCore40.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 4.0 definition. -template -struct OpenGl_TmplCore40 : public theBaseClass_t +struct OpenGl_GlCore40 : public OpenGl_GlCore33 { +private: + typedef OpenGl_GlCore33 theBaseClass_t; #if !defined(GL_ES_VERSION_2_0) @@ -96,10 +97,4 @@ public: //! @name OpenGL 4.0 additives to 3.3 }; -//! OpenGL 4.0 compatibility profile. -typedef OpenGl_TmplCore40 OpenGl_GlCore40Back; - -//! OpenGL 4.0 core profile. -typedef OpenGl_TmplCore40 OpenGl_GlCore40; - #endif // _OpenGl_GlCore40_Header diff --git a/src/OpenGl/OpenGl_GlCore41.hxx b/src/OpenGl/OpenGl_GlCore41.hxx index 50950811fb..0379ff5b59 100644 --- a/src/OpenGl/OpenGl_GlCore41.hxx +++ b/src/OpenGl/OpenGl_GlCore41.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 4.1 definition. -template -struct OpenGl_TmplCore41 : public theBaseClass_t +struct OpenGl_GlCore41 : public OpenGl_GlCore40 { +private: + typedef OpenGl_GlCore40 theBaseClass_t; #if !defined(GL_ES_VERSION_2_0) @@ -128,16 +129,8 @@ public: //! @name GL_ARB_viewport_array (added to OpenGL 4.1 core) using theBaseClass_t::glGetFloati_v; using theBaseClass_t::glGetDoublei_v; -public: //! @name OpenGL 4.1 additives to 4.0 - #endif }; -//! OpenGL 4.1 compatibility profile. -typedef OpenGl_TmplCore41 OpenGl_GlCore41Back; - -//! OpenGL 4.1 core profile. -typedef OpenGl_TmplCore41 OpenGl_GlCore41; - #endif // _OpenGl_GlCore41_Header diff --git a/src/OpenGl/OpenGl_GlCore42.hxx b/src/OpenGl/OpenGl_GlCore42.hxx index c239009867..73175a0a96 100644 --- a/src/OpenGl/OpenGl_GlCore42.hxx +++ b/src/OpenGl/OpenGl_GlCore42.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 4.2 definition. -template -struct OpenGl_TmplCore42 : public theBaseClass_t +struct OpenGl_GlCore42 : public OpenGl_GlCore41 { +private: + typedef OpenGl_GlCore41 theBaseClass_t; #if !defined(GL_ES_VERSION_2_0) @@ -59,11 +60,4 @@ public: //! @name GL_ARB_texture_storage (added to OpenGL 4.2 core) }; -//! OpenGL 4.2 compatibility profile. -typedef OpenGl_TmplCore42 OpenGl_GlCore42Back; - -//! OpenGL 4.2 core profile. -typedef OpenGl_TmplCore42 OpenGl_GlCore42; - - #endif // _OpenGl_GlCore42_Header diff --git a/src/OpenGl/OpenGl_GlCore43.hxx b/src/OpenGl/OpenGl_GlCore43.hxx index e95e842137..7849a6d4a0 100644 --- a/src/OpenGl/OpenGl_GlCore43.hxx +++ b/src/OpenGl/OpenGl_GlCore43.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 4.3 definition. -template -struct OpenGl_TmplCore43 : public theBaseClass_t +struct OpenGl_GlCore43 : public OpenGl_GlCore42 { +private: + typedef OpenGl_GlCore42 theBaseClass_t; public: //! @name OpenGL 4.3 additives to 4.2 @@ -75,10 +76,4 @@ public: //! @name OpenGL 4.3 additives to 4.2 }; -//! OpenGL 4.3 compatibility profile. -typedef OpenGl_TmplCore43 OpenGl_GlCore43Back; - -//! OpenGL 4.3 core profile. -typedef OpenGl_TmplCore43 OpenGl_GlCore43; - #endif // _OpenGl_GlCore43_Header diff --git a/src/OpenGl/OpenGl_GlCore44.hxx b/src/OpenGl/OpenGl_GlCore44.hxx index 91a68cb278..f8c0b170f3 100644 --- a/src/OpenGl/OpenGl_GlCore44.hxx +++ b/src/OpenGl/OpenGl_GlCore44.hxx @@ -19,9 +19,10 @@ #include //! OpenGL 4.4 definition. -template -struct OpenGl_TmplCore44 : public theBaseClass_t +struct OpenGl_GlCore44 : public OpenGl_GlCore43 { +private: + typedef OpenGl_GlCore43 theBaseClass_t; public: //! @name OpenGL 4.4 additives to 4.3 @@ -41,10 +42,4 @@ public: //! @name OpenGL 4.4 additives to 4.3 }; -//! OpenGL 4.4 compatibility profile. -typedef OpenGl_TmplCore44 OpenGl_GlCore44Back; - -//! OpenGL 4.4 core profile. -typedef OpenGl_TmplCore44 OpenGl_GlCore44; - #endif // _OpenGl_GlCore44_Header diff --git a/src/OpenGl/OpenGl_GlCore45.hxx b/src/OpenGl/OpenGl_GlCore45.hxx index e9e9099d30..f9e3c55071 100644 --- a/src/OpenGl/OpenGl_GlCore45.hxx +++ b/src/OpenGl/OpenGl_GlCore45.hxx @@ -17,9 +17,10 @@ #include //! OpenGL 4.5 definition. -template -struct OpenGl_TmplCore45 : public theBaseClass_t +struct OpenGl_GlCore45 : public OpenGl_GlCore44 { +private: + typedef OpenGl_GlCore44 theBaseClass_t; public: //! @name OpenGL 4.5 additives to 4.4 @@ -150,10 +151,4 @@ public: //! @name OpenGL 4.5 additives to 4.4 }; -//! OpenGL 4.5 compatibility profile. -typedef OpenGl_TmplCore45 OpenGl_GlCore45Back; - -//! OpenGL 4.5 core profile. -typedef OpenGl_TmplCore45 OpenGl_GlCore45; - #endif // _OpenGl_GlCore45_Header diff --git a/src/OpenGl/OpenGl_GlCore46.hxx b/src/OpenGl/OpenGl_GlCore46.hxx index 8bbe3cb36e..333d1947cb 100644 --- a/src/OpenGl/OpenGl_GlCore46.hxx +++ b/src/OpenGl/OpenGl_GlCore46.hxx @@ -17,9 +17,10 @@ #include //! OpenGL 4.6 definition. -template -struct OpenGl_TmplCore46 : public theBaseClass_t +struct OpenGl_GlCore46 : public OpenGl_GlCore45 { +private: + typedef OpenGl_GlCore45 theBaseClass_t; public: //! @name OpenGL 4.6 additives to 4.5 @@ -32,10 +33,4 @@ public: //! @name OpenGL 4.6 additives to 4.5 }; -//! OpenGL 4.6 compatibility profile. -typedef OpenGl_TmplCore46 OpenGl_GlCore46Back; - -//! OpenGL 4.6 core profile. -typedef OpenGl_TmplCore46 OpenGl_GlCore46; - #endif // _OpenGl_GlCore46_Header diff --git a/src/OpenGl/OpenGl_GlFunctions.cxx b/src/OpenGl/OpenGl_GlFunctions.cxx index 63afab47f9..19581605c5 100644 --- a/src/OpenGl/OpenGl_GlFunctions.cxx +++ b/src/OpenGl/OpenGl_GlFunctions.cxx @@ -35,10 +35,9 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, { #if defined(GL_ES_VERSION_2_0) (void )theIsCoreProfile; - theCtx.core11 = NULL; + theCtx.core11ffp = NULL; #else - const bool isCoreProfile = theIsCoreProfile; - theCtx.core11 = !isCoreProfile ? (OpenGl_GlCore11* )this : NULL; + theCtx.core11ffp = !theIsCoreProfile ? (OpenGl_GlCore11* )this : NULL; #endif theCtx.core11fwd = (OpenGl_GlCore11Fwd* )this; theCtx.core15 = NULL; @@ -46,23 +45,14 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, theCtx.core20 = NULL; theCtx.core20fwd = NULL; theCtx.core30 = NULL; - theCtx.core30fwd = NULL; theCtx.core32 = NULL; - theCtx.core32back = NULL; theCtx.core33 = NULL; - theCtx.core33back = NULL; theCtx.core41 = NULL; - theCtx.core41back = NULL; theCtx.core42 = NULL; - theCtx.core42back = NULL; theCtx.core43 = NULL; - theCtx.core43back = NULL; theCtx.core44 = NULL; - theCtx.core44back = NULL; theCtx.core45 = NULL; - theCtx.core45back = NULL; theCtx.core46 = NULL; - theCtx.core46back = NULL; theCtx.arbTBO = NULL; theCtx.arbTboRGB32 = false; theCtx.arbClipControl = false; @@ -106,10 +96,11 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (isGlGreaterEqualShort (2, 0)) { // enable compatible functions - theCtx.core20 = (OpenGl_GlCore20* )this; - theCtx.core20fwd = (OpenGl_GlCore20Fwd* )this; - theCtx.core15fwd = (OpenGl_GlCore15Fwd* )this; - theCtx.arbFBO = (OpenGl_ArbFBO* )this; + theCtx.core20 = (OpenGl_GlCore20* )this; + theCtx.core20fwd = (OpenGl_GlCore20* )this; + theCtx.core15 = (OpenGl_GlCore15* )this; + theCtx.core15fwd = (OpenGl_GlCore15* )this; + theCtx.arbFBO = (OpenGl_ArbFBO* )this; } if (isGlGreaterEqualShort (3, 0) && FindProcShort (glBlitFramebuffer)) @@ -292,8 +283,7 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, } else { - theCtx.core30 = (OpenGl_GlCore30* )this; - theCtx.core30fwd = (OpenGl_GlCore30Fwd* )this; + theCtx.core30 = (OpenGl_GlCore30* )this; theCtx.hasGetBufferData = true; } @@ -628,48 +618,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, && FindProcShort (glCompressedTexSubImage2D) && FindProcShort (glCompressedTexSubImage1D) && FindProcShort (glGetCompressedTexImage); - - if (!isCoreProfile) - { - has13 = has13 - && FindProcShort (glClientActiveTexture) - && FindProcShort (glMultiTexCoord1d) - && FindProcShort (glMultiTexCoord1dv) - && FindProcShort (glMultiTexCoord1f) - && FindProcShort (glMultiTexCoord1fv) - && FindProcShort (glMultiTexCoord1i) - && FindProcShort (glMultiTexCoord1iv) - && FindProcShort (glMultiTexCoord1s) - && FindProcShort (glMultiTexCoord1sv) - && FindProcShort (glMultiTexCoord2d) - && FindProcShort (glMultiTexCoord2dv) - && FindProcShort (glMultiTexCoord2f) - && FindProcShort (glMultiTexCoord2fv) - && FindProcShort (glMultiTexCoord2i) - && FindProcShort (glMultiTexCoord2iv) - && FindProcShort (glMultiTexCoord2s) - && FindProcShort (glMultiTexCoord2sv) - && FindProcShort (glMultiTexCoord3d) - && FindProcShort (glMultiTexCoord3dv) - && FindProcShort (glMultiTexCoord3f) - && FindProcShort (glMultiTexCoord3fv) - && FindProcShort (glMultiTexCoord3i) - && FindProcShort (glMultiTexCoord3iv) - && FindProcShort (glMultiTexCoord3s) - && FindProcShort (glMultiTexCoord3sv) - && FindProcShort (glMultiTexCoord4d) - && FindProcShort (glMultiTexCoord4dv) - && FindProcShort (glMultiTexCoord4f) - && FindProcShort (glMultiTexCoord4fv) - && FindProcShort (glMultiTexCoord4i) - && FindProcShort (glMultiTexCoord4iv) - && FindProcShort (glMultiTexCoord4s) - && FindProcShort (glMultiTexCoord4sv) - && FindProcShort (glLoadTransposeMatrixf) - && FindProcShort (glLoadTransposeMatrixd) - && FindProcShort (glMultTransposeMatrixf) - && FindProcShort (glMultTransposeMatrixd); - } if (!has13) { theCtx.checkWrongVersion (1, 3, aLastFailedProc); @@ -712,11 +660,8 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, && FindProcShort (glGetBufferPointerv); if (has15) { - if (!isCoreProfile) - { - theCtx.core15 = (OpenGl_GlCore15* )this; - } - theCtx.core15fwd = (OpenGl_GlCore15Fwd* )this; + theCtx.core15 = (OpenGl_GlCore15* )this; + theCtx.core15fwd = (OpenGl_GlCore15* )this; theCtx.hasGetBufferData = true; } else @@ -830,11 +775,8 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, } else { - if (!isCoreProfile) - { - theCtx.core20 = (OpenGl_GlCore20* )this; - } - theCtx.core20fwd = (OpenGl_GlCore20Fwd* )this; + theCtx.core20 = (OpenGl_GlCore20* )this; + theCtx.core20fwd = (OpenGl_GlCore20* )this; } } else @@ -979,11 +921,7 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, theCtx.arbNPTW = true; theCtx.arbTexRG = true; - if (!isCoreProfile) - { - theCtx.core30 = (OpenGl_GlCore30* )this; - } - theCtx.core30fwd = (OpenGl_GlCore30Fwd* )this; + theCtx.core30 = (OpenGl_GlCore30* )this; } // load OpenGL 3.1 new functions @@ -1061,10 +999,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has32) { theCtx.core32 = (OpenGl_GlCore32* )this; - if (!isCoreProfile) - { - theCtx.core32back = (OpenGl_GlCore32Back* )this; - } } else { @@ -1114,44 +1048,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, && FindProcShort (glVertexAttribP4ui) && FindProcShort (glVertexAttribP4uiv); - if ( hasVertType21010101rev - && !isCoreProfile) - { - // load deprecated functions - const bool hasVertType21010101revExt = - FindProcShort (glVertexP2ui) - && FindProcShort (glVertexP2uiv) - && FindProcShort (glVertexP3ui) - && FindProcShort (glVertexP3uiv) - && FindProcShort (glVertexP4ui) - && FindProcShort (glVertexP4uiv) - && FindProcShort (glTexCoordP1ui) - && FindProcShort (glTexCoordP1uiv) - && FindProcShort (glTexCoordP2ui) - && FindProcShort (glTexCoordP2uiv) - && FindProcShort (glTexCoordP3ui) - && FindProcShort (glTexCoordP3uiv) - && FindProcShort (glTexCoordP4ui) - && FindProcShort (glTexCoordP4uiv) - && FindProcShort (glMultiTexCoordP1ui) - && FindProcShort (glMultiTexCoordP1uiv) - && FindProcShort (glMultiTexCoordP2ui) - && FindProcShort (glMultiTexCoordP2uiv) - && FindProcShort (glMultiTexCoordP3ui) - && FindProcShort (glMultiTexCoordP3uiv) - && FindProcShort (glMultiTexCoordP4ui) - && FindProcShort (glMultiTexCoordP4uiv) - && FindProcShort (glNormalP3ui) - && FindProcShort (glNormalP3uiv) - && FindProcShort (glColorP3ui) - && FindProcShort (glColorP3uiv) - && FindProcShort (glColorP4ui) - && FindProcShort (glColorP4uiv) - && FindProcShort (glSecondaryColorP3ui) - && FindProcShort (glSecondaryColorP3uiv); - (void )hasVertType21010101revExt; - } - // load OpenGL 3.3 extra functions has33 = isGlGreaterEqualShort (3, 3) && hasBlendFuncExtended @@ -1162,10 +1058,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has33) { theCtx.core33 = (OpenGl_GlCore33* )this; - if (!isCoreProfile) - { - theCtx.core33back = (OpenGl_GlCore33Back* )this; - } } else { @@ -1366,10 +1258,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has41) { theCtx.core41 = (OpenGl_GlCore41* )this; - if (!isCoreProfile) - { - theCtx.core41back = (OpenGl_GlCore41Back* )this; - } } else { @@ -1416,10 +1304,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has42) { theCtx.core42 = (OpenGl_GlCore42* )this; - if (!isCoreProfile) - { - theCtx.core42back = (OpenGl_GlCore42Back* )this; - } } else { @@ -1473,10 +1357,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has43) { theCtx.core43 = (OpenGl_GlCore43* )this; - if (!isCoreProfile) - { - theCtx.core43back = (OpenGl_GlCore43Back* )this; - } } else { @@ -1500,10 +1380,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has44) { theCtx.core44 = (OpenGl_GlCore44* )this; - if (!isCoreProfile) - { - theCtx.core44back = (OpenGl_GlCore44Back* )this; - } } else { @@ -1638,10 +1514,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, { theCtx.core45 = (OpenGl_GlCore45* )this; theCtx.arbClipControl = true; - if (!isCoreProfile) - { - theCtx.core45back = (OpenGl_GlCore45Back* )this; - } } else { @@ -1656,10 +1528,6 @@ void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, if (has46) { theCtx.core46 = (OpenGl_GlCore46* )this; - if (!isCoreProfile) - { - theCtx.core46back = (OpenGl_GlCore46Back* )this; - } } else { diff --git a/src/OpenGl/OpenGl_GlFunctions.hxx b/src/OpenGl/OpenGl_GlFunctions.hxx index 74b82e1d7b..6e10488e95 100644 --- a/src/OpenGl/OpenGl_GlFunctions.hxx +++ b/src/OpenGl/OpenGl_GlFunctions.hxx @@ -984,44 +984,6 @@ public: //! @name OpenGL 1.3 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D; PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage; - PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture; - PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d; - PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv; - PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f; - PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv; - PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i; - PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv; - PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s; - PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv; - PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d; - PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv; - PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f; - PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv; - PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i; - PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv; - PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s; - PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv; - PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d; - PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv; - PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f; - PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv; - PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i; - PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv; - PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s; - PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv; - PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d; - PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv; - PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f; - PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv; - PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i; - PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv; - PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s; - PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv; - PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf; - PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd; - PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf; - PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd; - public: //! @name OpenGL 1.4 PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; @@ -1340,36 +1302,6 @@ public: //! @name GL_ARB_timer_query (added to OpenGL 3.3 core) public: //! @name GL_ARB_vertex_type_2_10_10_10_rev (added to OpenGL 3.3 core) - PFNGLVERTEXP2UIPROC glVertexP2ui; - PFNGLVERTEXP2UIVPROC glVertexP2uiv; - PFNGLVERTEXP3UIPROC glVertexP3ui; - PFNGLVERTEXP3UIVPROC glVertexP3uiv; - PFNGLVERTEXP4UIPROC glVertexP4ui; - PFNGLVERTEXP4UIVPROC glVertexP4uiv; - PFNGLTEXCOORDP1UIPROC glTexCoordP1ui; - PFNGLTEXCOORDP1UIVPROC glTexCoordP1uiv; - PFNGLTEXCOORDP2UIPROC glTexCoordP2ui; - PFNGLTEXCOORDP2UIVPROC glTexCoordP2uiv; - PFNGLTEXCOORDP3UIPROC glTexCoordP3ui; - PFNGLTEXCOORDP3UIVPROC glTexCoordP3uiv; - PFNGLTEXCOORDP4UIPROC glTexCoordP4ui; - PFNGLTEXCOORDP4UIVPROC glTexCoordP4uiv; - PFNGLMULTITEXCOORDP1UIPROC glMultiTexCoordP1ui; - PFNGLMULTITEXCOORDP1UIVPROC glMultiTexCoordP1uiv; - PFNGLMULTITEXCOORDP2UIPROC glMultiTexCoordP2ui; - PFNGLMULTITEXCOORDP2UIVPROC glMultiTexCoordP2uiv; - PFNGLMULTITEXCOORDP3UIPROC glMultiTexCoordP3ui; - PFNGLMULTITEXCOORDP3UIVPROC glMultiTexCoordP3uiv; - PFNGLMULTITEXCOORDP4UIPROC glMultiTexCoordP4ui; - PFNGLMULTITEXCOORDP4UIVPROC glMultiTexCoordP4uiv; - PFNGLNORMALP3UIPROC glNormalP3ui; - PFNGLNORMALP3UIVPROC glNormalP3uiv; - PFNGLCOLORP3UIPROC glColorP3ui; - PFNGLCOLORP3UIVPROC glColorP3uiv; - PFNGLCOLORP4UIPROC glColorP4ui; - PFNGLCOLORP4UIVPROC glColorP4uiv; - PFNGLSECONDARYCOLORP3UIPROC glSecondaryColorP3ui; - PFNGLSECONDARYCOLORP3UIVPROC glSecondaryColorP3uiv; PFNGLVERTEXATTRIBP1UIPROC glVertexAttribP1ui; PFNGLVERTEXATTRIBP1UIVPROC glVertexAttribP1uiv; PFNGLVERTEXATTRIBP2UIPROC glVertexAttribP2ui; diff --git a/src/OpenGl/OpenGl_LineAttributes.cxx b/src/OpenGl/OpenGl_LineAttributes.cxx index 58b01486d8..aa53850aee 100644 --- a/src/OpenGl/OpenGl_LineAttributes.cxx +++ b/src/OpenGl/OpenGl_LineAttributes.cxx @@ -50,7 +50,7 @@ void OpenGl_LineAttributes::Release (OpenGl_Context* theGlCtx) { for (OpenGl_MapOfHatchStylesAndIds::Iterator anIter (myStyles); anIter.More(); anIter.Next()) { - theGlCtx->core11->glDeleteLists ((GLuint)anIter.Value(), 1); + theGlCtx->core11ffp->glDeleteLists ((GLuint)anIter.Value(), 1); } } #else @@ -67,10 +67,10 @@ unsigned int OpenGl_LineAttributes::init (const OpenGl_Context* theGlCtx, const Handle(Graphic3d_HatchStyle)& theStyle) { #if !defined(GL_ES_VERSION_2_0) - const unsigned int aListId = theGlCtx->core11->glGenLists(1); - theGlCtx->core11->glNewList ((GLuint)aListId, GL_COMPILE); - theGlCtx->core11->glPolygonStipple ((const GLubyte*)theStyle->Pattern()); - theGlCtx->core11->glEndList(); + const unsigned int aListId = theGlCtx->core11ffp->glGenLists(1); + theGlCtx->core11ffp->glNewList ((GLuint)aListId, GL_COMPILE); + theGlCtx->core11ffp->glPolygonStipple ((const GLubyte*)theStyle->Pattern()); + theGlCtx->core11ffp->glEndList(); return aListId; #else (void )theGlCtx; @@ -88,7 +88,7 @@ bool OpenGl_LineAttributes::SetTypeOfHatch (const OpenGl_Context* { if (theStyle.IsNull() || theStyle->HatchType() == Aspect_HS_SOLID - || theGlCtx->core11 == NULL) + || theGlCtx->core11ffp == NULL) { return false; } @@ -101,7 +101,7 @@ bool OpenGl_LineAttributes::SetTypeOfHatch (const OpenGl_Context* } #if !defined(GL_ES_VERSION_2_0) - theGlCtx->core11->glCallList ((GLuint)aGpuListId); + theGlCtx->core11ffp->glCallList ((GLuint)aGpuListId); #endif return true; } diff --git a/src/OpenGl/OpenGl_PrimitiveArray.cxx b/src/OpenGl/OpenGl_PrimitiveArray.cxx index ac5178909b..0f78f4eb94 100644 --- a/src/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.cxx @@ -520,9 +520,9 @@ void OpenGl_PrimitiveArray::drawEdges (const Handle(OpenGl_Workspace)& theWorksp : myDrawMode; #if !defined(GL_ES_VERSION_2_0) if (aGlContext->ActiveProgram().IsNull() - && aGlContext->core11 != NULL) + && aGlContext->core11ffp != NULL) { - glDisable (GL_LIGHTING); + aGlContext->core11fwd->glDisable (GL_LIGHTING); } #endif @@ -550,14 +550,14 @@ void OpenGl_PrimitiveArray::drawEdges (const Handle(OpenGl_Workspace)& theWorksp for (Standard_Integer aGroupIter = 0; aGroupIter < myBounds->NbBounds; ++aGroupIter) { const GLint aNbElemsInGroup = myBounds->Bounds[aGroupIter]; - glDrawElements (aDrawMode, aNbElemsInGroup, myVboIndices->GetDataType(), anOffset); + aGlContext->core11fwd->glDrawElements (aDrawMode, aNbElemsInGroup, myVboIndices->GetDataType(), anOffset); anOffset += aStride * aNbElemsInGroup; } } // draw one (or sequential) primitive by the indices else { - glDrawElements (aDrawMode, myVboIndices->GetElemsNb(), myVboIndices->GetDataType(), anOffset); + aGlContext->core11fwd->glDrawElements (aDrawMode, myVboIndices->GetElemsNb(), myVboIndices->GetDataType(), anOffset); } myVboIndices->Unbind (aGlContext); } @@ -567,13 +567,13 @@ void OpenGl_PrimitiveArray::drawEdges (const Handle(OpenGl_Workspace)& theWorksp for (Standard_Integer aGroupIter = 0; aGroupIter < myBounds->NbBounds; ++aGroupIter) { const GLint aNbElemsInGroup = myBounds->Bounds[aGroupIter]; - glDrawArrays (aDrawMode, aFirstElem, aNbElemsInGroup); + aGlContext->core11fwd->glDrawArrays (aDrawMode, aFirstElem, aNbElemsInGroup); aFirstElem += aNbElemsInGroup; } } else { - glDrawArrays (aDrawMode, 0, !myVboAttribs.IsNull() ? myVboAttribs->GetElemsNb() : myAttribs->NbElements); + aGlContext->core11fwd->glDrawArrays (aDrawMode, 0, !myVboAttribs.IsNull() ? myVboAttribs->GetElemsNb() : myAttribs->NbElements); } // unbind buffers @@ -606,7 +606,7 @@ void OpenGl_PrimitiveArray::drawMarkers (const Handle(OpenGl_Workspace)& theWork } #if !defined(GL_ES_VERSION_2_0) - if (aCtx->core11 != NULL) + if (aCtx->core11ffp != NULL) { aCtx->core11fwd->glEnable (GL_ALPHA_TEST); aCtx->core11fwd->glAlphaFunc (GL_GEQUAL, 0.1f); @@ -631,7 +631,7 @@ void OpenGl_PrimitiveArray::drawMarkers (const Handle(OpenGl_Workspace)& theWork { for (Standard_Integer anIter = 0; anIter < myAttribs->NbElements; anIter++) { - aCtx->core11->glRasterPos3fv (myAttribs->Value (anIter).GetData()); + aCtx->core11ffp->glRasterPos3fv (myAttribs->Value (anIter).GetData()); aSprite->DrawBitmap (theWorkspace->GetGlContext()); } } @@ -639,7 +639,7 @@ void OpenGl_PrimitiveArray::drawMarkers (const Handle(OpenGl_Workspace)& theWork aCtx->core11fwd->glDisable (GL_BLEND); #if !defined(GL_ES_VERSION_2_0) - if (aCtx->core11 != NULL) + if (aCtx->core11ffp != NULL) { if (aCtx->ShaderManager()->MaterialState().AlphaCutoff() >= ShortRealLast()) { diff --git a/src/OpenGl/OpenGl_Sampler.cxx b/src/OpenGl/OpenGl_Sampler.cxx index 08fcd7c937..ce4a4ef240 100644 --- a/src/OpenGl/OpenGl_Sampler.cxx +++ b/src/OpenGl/OpenGl_Sampler.cxx @@ -288,7 +288,7 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the (void )theTexture; (void )theParams; #else - if (theCtx->core11 == NULL + if (theCtx->core11ffp == NULL || theParams->TextureUnit() >= theCtx->MaxTextureUnitsFFP()) { return; @@ -310,21 +310,21 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the { case Graphic3d_TOTM_OBJECT: { - theCtx->core11->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - theCtx->core11->glTexGenfv (GL_S, GL_OBJECT_PLANE, theParams->GenPlaneS().GetData()); + theCtx->core11ffp->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + theCtx->core11ffp->glTexGenfv (GL_S, GL_OBJECT_PLANE, theParams->GenPlaneS().GetData()); if (theTexture.GetTarget() != GL_TEXTURE_1D) { - theCtx->core11->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - theCtx->core11->glTexGenfv (GL_T, GL_OBJECT_PLANE, theParams->GenPlaneT().GetData()); + theCtx->core11ffp->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + theCtx->core11ffp->glTexGenfv (GL_T, GL_OBJECT_PLANE, theParams->GenPlaneT().GetData()); } break; } case Graphic3d_TOTM_SPHERE: { - theCtx->core11->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); + theCtx->core11ffp->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); if (theTexture.GetTarget() != GL_TEXTURE_1D) { - theCtx->core11->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); + theCtx->core11ffp->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); } break; } @@ -334,12 +334,12 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the theCtx->WorldViewState.SetIdentity(); theCtx->ApplyWorldViewMatrix(); - theCtx->core11->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - theCtx->core11->glTexGenfv (GL_S, GL_EYE_PLANE, theParams->GenPlaneS().GetData()); + theCtx->core11ffp->glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + theCtx->core11ffp->glTexGenfv (GL_S, GL_EYE_PLANE, theParams->GenPlaneS().GetData()); if (theTexture.GetTarget() != GL_TEXTURE_1D) { - theCtx->core11->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - theCtx->core11->glTexGenfv (GL_T, GL_EYE_PLANE, theParams->GenPlaneT().GetData()); + theCtx->core11ffp->glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + theCtx->core11ffp->glTexGenfv (GL_T, GL_EYE_PLANE, theParams->GenPlaneT().GetData()); } theCtx->WorldViewState.Pop(); @@ -350,7 +350,7 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the if (theCtx->core20fwd != NULL) { theCtx->core11fwd->glEnable (GL_POINT_SPRITE); - glTexEnvi (GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); + theCtx->core11ffp->glTexEnvi (GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); anEnvMode = GL_REPLACE; } break; @@ -360,7 +360,7 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the } // setup lighting - glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, anEnvMode); + theCtx->core11ffp->glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, anEnvMode); switch (theTexture.GetTarget()) { @@ -401,7 +401,7 @@ void OpenGl_Sampler::resetGlobalTextureParams (const Handle(OpenGl_Context)& the (void )theTexture; (void )theParams; #else - if (theCtx->core11 == NULL) + if (theCtx->core11ffp == NULL) { return; } @@ -409,9 +409,9 @@ void OpenGl_Sampler::resetGlobalTextureParams (const Handle(OpenGl_Context)& the // reset texture matrix because some code may expect it is identity GLint aMatrixMode = GL_TEXTURE; theCtx->core11fwd->glGetIntegerv (GL_MATRIX_MODE, &aMatrixMode); - theCtx->core11->glMatrixMode (GL_TEXTURE); - theCtx->core11->glLoadIdentity(); - theCtx->core11->glMatrixMode (aMatrixMode); + theCtx->core11ffp->glMatrixMode (GL_TEXTURE); + theCtx->core11ffp->glLoadIdentity(); + theCtx->core11ffp->glMatrixMode (aMatrixMode); switch (theTexture.GetTarget()) { diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index 93a16422e8..aaae4e662a 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -46,8 +46,8 @@ namespace // the light is a headlight? if (theLight.IsHeadlight()) { - theCtx->core11->glMatrixMode (GL_MODELVIEW); - theCtx->core11->glLoadIdentity(); + theCtx->core11ffp->glMatrixMode (GL_MODELVIEW); + theCtx->core11ffp->glLoadIdentity(); } // setup light type @@ -61,44 +61,44 @@ namespace const OpenGl_Vec4 anInfDir = -theLight.PackedDirectionRange(); // to create a realistic effect, set the GL_SPECULAR parameter to the same value as the GL_DIFFUSE. - theCtx->core11->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); - theCtx->core11->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_POSITION, anInfDir.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPOT_DIRECTION, THE_DEFAULT_SPOT_DIR); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_EXPONENT, THE_DEFAULT_SPOT_EXPONENT); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_CUTOFF, THE_DEFAULT_SPOT_CUTOFF); + theCtx->core11ffp->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); + theCtx->core11ffp->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_POSITION, anInfDir.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPOT_DIRECTION, THE_DEFAULT_SPOT_DIR); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_EXPONENT, THE_DEFAULT_SPOT_EXPONENT); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_CUTOFF, THE_DEFAULT_SPOT_CUTOFF); break; } case Graphic3d_TOLS_POSITIONAL: { // to create a realistic effect, set the GL_SPECULAR parameter to the same value as the GL_DIFFUSE const OpenGl_Vec4 aPosition (static_cast(theLight.Position().X()), static_cast(theLight.Position().Y()), static_cast(theLight.Position().Z()), 1.0f); - theCtx->core11->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); - theCtx->core11->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_POSITION, aPosition.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPOT_DIRECTION, THE_DEFAULT_SPOT_DIR); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_EXPONENT, THE_DEFAULT_SPOT_EXPONENT); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_CUTOFF, THE_DEFAULT_SPOT_CUTOFF); - theCtx->core11->glLightf (theLightGlId, GL_CONSTANT_ATTENUATION, theLight.ConstAttenuation()); - theCtx->core11->glLightf (theLightGlId, GL_LINEAR_ATTENUATION, theLight.LinearAttenuation()); - theCtx->core11->glLightf (theLightGlId, GL_QUADRATIC_ATTENUATION, 0.0f); + theCtx->core11ffp->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); + theCtx->core11ffp->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_POSITION, aPosition.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPOT_DIRECTION, THE_DEFAULT_SPOT_DIR); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_EXPONENT, THE_DEFAULT_SPOT_EXPONENT); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_CUTOFF, THE_DEFAULT_SPOT_CUTOFF); + theCtx->core11ffp->glLightf (theLightGlId, GL_CONSTANT_ATTENUATION, theLight.ConstAttenuation()); + theCtx->core11ffp->glLightf (theLightGlId, GL_LINEAR_ATTENUATION, theLight.LinearAttenuation()); + theCtx->core11ffp->glLightf (theLightGlId, GL_QUADRATIC_ATTENUATION, 0.0f); break; } case Graphic3d_TOLS_SPOT: { const OpenGl_Vec4 aPosition (static_cast(theLight.Position().X()), static_cast(theLight.Position().Y()), static_cast(theLight.Position().Z()), 1.0f); - theCtx->core11->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); - theCtx->core11->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_POSITION, aPosition.GetData()); - theCtx->core11->glLightfv (theLightGlId, GL_SPOT_DIRECTION, theLight.PackedDirectionRange().GetData()); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_EXPONENT, theLight.Concentration() * 128.0f); - theCtx->core11->glLightf (theLightGlId, GL_SPOT_CUTOFF, (theLight.Angle() * 180.0f) / GLfloat(M_PI)); - theCtx->core11->glLightf (theLightGlId, GL_CONSTANT_ATTENUATION, theLight.ConstAttenuation()); - theCtx->core11->glLightf (theLightGlId, GL_LINEAR_ATTENUATION, theLight.LinearAttenuation()); - theCtx->core11->glLightf (theLightGlId, GL_QUADRATIC_ATTENUATION, 0.0f); + theCtx->core11ffp->glLightfv (theLightGlId, GL_AMBIENT, THE_DEFAULT_AMBIENT); + theCtx->core11ffp->glLightfv (theLightGlId, GL_DIFFUSE, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPECULAR, aLightColor.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_POSITION, aPosition.GetData()); + theCtx->core11ffp->glLightfv (theLightGlId, GL_SPOT_DIRECTION, theLight.PackedDirectionRange().GetData()); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_EXPONENT, theLight.Concentration() * 128.0f); + theCtx->core11ffp->glLightf (theLightGlId, GL_SPOT_CUTOFF, (theLight.Angle() * 180.0f) / GLfloat(M_PI)); + theCtx->core11ffp->glLightf (theLightGlId, GL_CONSTANT_ATTENUATION, theLight.ConstAttenuation()); + theCtx->core11ffp->glLightf (theLightGlId, GL_LINEAR_ATTENUATION, theLight.LinearAttenuation()); + theCtx->core11ffp->glLightf (theLightGlId, GL_QUADRATIC_ATTENUATION, 0.0f); break; } } @@ -106,7 +106,7 @@ namespace // restore matrix in case of headlight if (theLight.IsHeadlight()) { - theCtx->core11->glLoadMatrixf (theModelView.GetData()); + theCtx->core11ffp->glLoadMatrixf (theModelView.GetData()); } glEnable (theLightGlId); @@ -364,7 +364,7 @@ void OpenGl_ShaderManager::pushLightSourceState (const Handle(OpenGl_ShaderProgr if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 == NULL) + if (myContext->core11ffp == NULL) { return; } @@ -389,22 +389,22 @@ void OpenGl_ShaderManager::pushLightSourceState (const Handle(OpenGl_ShaderProgr const Graphic3d_Vec4 anAmbient = !myLightSourceState.LightSources().IsNull() ? myLightSourceState.LightSources()->AmbientColor() : Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 1.0f); - myContext->core11->glLightModelfv (GL_LIGHT_MODEL_AMBIENT, anAmbient.GetData()); + myContext->core11ffp->glLightModelfv (GL_LIGHT_MODEL_AMBIENT, anAmbient.GetData()); // GL_LIGHTING is managed by drawers to switch between shaded / no lighting output, // therefore managing the state here does not have any effect - do it just for consistency. if (aLightGlId != GL_LIGHT0) { - ::glEnable (GL_LIGHTING); + myContext->core11fwd->glEnable (GL_LIGHTING); } else { - ::glDisable (GL_LIGHTING); + myContext->core11fwd->glDisable (GL_LIGHTING); } // switch off unused lights for (; aLightGlId <= GL_LIGHT7; ++aLightGlId) { - ::glDisable (aLightGlId); + myContext->core11fwd->glDisable (aLightGlId); } #endif return; @@ -594,10 +594,10 @@ void OpenGl_ShaderManager::pushProjectionState (const Handle(OpenGl_ShaderProgra if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 != NULL) + if (myContext->core11ffp != NULL) { - myContext->core11->glMatrixMode (GL_PROJECTION); - myContext->core11->glLoadMatrixf (myProjectionState.ProjectionMatrix()); + myContext->core11ffp->glMatrixMode (GL_PROJECTION); + myContext->core11ffp->glLoadMatrixf (myProjectionState.ProjectionMatrix()); } #endif return; @@ -634,11 +634,11 @@ void OpenGl_ShaderManager::pushModelWorldState (const Handle(OpenGl_ShaderProgra if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 != NULL) + if (myContext->core11ffp != NULL) { const OpenGl_Mat4 aModelView = myWorldViewState.WorldViewMatrix() * myModelWorldState.ModelWorldMatrix(); - myContext->core11->glMatrixMode (GL_MODELVIEW); - myContext->core11->glLoadMatrixf (aModelView.GetData()); + myContext->core11ffp->glMatrixMode (GL_MODELVIEW); + myContext->core11ffp->glLoadMatrixf (aModelView.GetData()); theProgram->UpdateState (OpenGl_WORLD_VIEW_STATE, myWorldViewState.Index()); } #endif @@ -681,11 +681,11 @@ void OpenGl_ShaderManager::pushWorldViewState (const Handle(OpenGl_ShaderProgram if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 != NULL) + if (myContext->core11ffp != NULL) { const OpenGl_Mat4 aModelView = myWorldViewState.WorldViewMatrix() * myModelWorldState.ModelWorldMatrix(); - myContext->core11->glMatrixMode (GL_MODELVIEW); - myContext->core11->glLoadMatrixf (aModelView.GetData()); + myContext->core11ffp->glMatrixMode (GL_MODELVIEW); + myContext->core11ffp->glLoadMatrixf (aModelView.GetData()); theProgram->UpdateState (OpenGl_MODEL_WORLD_STATE, myModelWorldState.Index()); } #endif @@ -741,7 +741,7 @@ void OpenGl_ShaderManager::pushClippingState (const Handle(OpenGl_ShaderProgram) if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 == NULL) + if (myContext->core11ffp == NULL) { return; } @@ -789,12 +789,12 @@ void OpenGl_ShaderManager::pushClippingState (const Handle(OpenGl_ShaderProgram) { // set either identity or pure view matrix toRestoreModelView = Standard_True; - myContext->core11->glMatrixMode (GL_MODELVIEW); - myContext->core11->glLoadMatrixf (myWorldViewState.WorldViewMatrix().GetData()); + myContext->core11ffp->glMatrixMode (GL_MODELVIEW); + myContext->core11ffp->glLoadMatrixf (myWorldViewState.WorldViewMatrix().GetData()); } - ::glEnable (anFfpPlaneID); - myContext->core11->glClipPlane (anFfpPlaneID, aPlaneEq); + myContext->core11fwd->glEnable (anFfpPlaneID); + myContext->core11ffp->glClipPlane (anFfpPlaneID, aPlaneEq); ++aPlaneId; } @@ -802,14 +802,14 @@ void OpenGl_ShaderManager::pushClippingState (const Handle(OpenGl_ShaderProgram) // switch off unused lights for (; aPlaneId < aNbMaxPlanes; ++aPlaneId) { - ::glDisable (GL_CLIP_PLANE0 + aPlaneId); + myContext->core11fwd->glDisable (GL_CLIP_PLANE0 + aPlaneId); } // restore combined model-view matrix if (toRestoreModelView) { const OpenGl_Mat4 aModelView = myWorldViewState.WorldViewMatrix() * myModelWorldState.ModelWorldMatrix(); - myContext->core11->glLoadMatrixf (aModelView.GetData()); + myContext->core11ffp->glLoadMatrixf (aModelView.GetData()); } #endif return; @@ -915,38 +915,38 @@ void OpenGl_ShaderManager::pushMaterialState (const Handle(OpenGl_ShaderProgram) if (theProgram == myFfpProgram) { #if !defined(GL_ES_VERSION_2_0) - if (myContext->core11 == NULL) + if (myContext->core11ffp == NULL) { return; } if (myMaterialState.AlphaCutoff() < ShortRealLast()) { - glAlphaFunc (GL_GEQUAL, myMaterialState.AlphaCutoff()); - glEnable (GL_ALPHA_TEST); + myContext->core11fwd->glAlphaFunc (GL_GEQUAL, myMaterialState.AlphaCutoff()); + myContext->core11fwd->glEnable (GL_ALPHA_TEST); } else { - glDisable (GL_ALPHA_TEST); + myContext->core11fwd->glDisable (GL_ALPHA_TEST); } const GLenum aFrontFace = myMaterialState.ToDistinguish() ? GL_FRONT : GL_FRONT_AND_BACK; const OpenGl_MaterialCommon& aFrontMat = aMat.Common[0]; const OpenGl_MaterialCommon& aBackMat = aMat.Common[1]; const Graphic3d_Vec4 aSpec4 (aFrontMat.SpecularShininess.rgb(), 1.0f); - myContext->core11->glMaterialfv(aFrontFace, GL_AMBIENT, aFrontMat.Ambient.GetData()); - myContext->core11->glMaterialfv(aFrontFace, GL_DIFFUSE, aFrontMat.Diffuse.GetData()); - myContext->core11->glMaterialfv(aFrontFace, GL_SPECULAR, aSpec4.GetData()); - myContext->core11->glMaterialfv(aFrontFace, GL_EMISSION, aFrontMat.Emission.GetData()); - myContext->core11->glMaterialf (aFrontFace, GL_SHININESS, aFrontMat.Shine()); + myContext->core11ffp->glMaterialfv(aFrontFace, GL_AMBIENT, aFrontMat.Ambient.GetData()); + myContext->core11ffp->glMaterialfv(aFrontFace, GL_DIFFUSE, aFrontMat.Diffuse.GetData()); + myContext->core11ffp->glMaterialfv(aFrontFace, GL_SPECULAR, aSpec4.GetData()); + myContext->core11ffp->glMaterialfv(aFrontFace, GL_EMISSION, aFrontMat.Emission.GetData()); + myContext->core11ffp->glMaterialf (aFrontFace, GL_SHININESS, aFrontMat.Shine()); if (myMaterialState.ToDistinguish()) { const Graphic3d_Vec4 aSpec4Back (aBackMat.SpecularShininess.rgb(), 1.0f); - myContext->core11->glMaterialfv(GL_BACK, GL_AMBIENT, aBackMat.Ambient.GetData()); - myContext->core11->glMaterialfv(GL_BACK, GL_DIFFUSE, aBackMat.Diffuse.GetData()); - myContext->core11->glMaterialfv(GL_BACK, GL_SPECULAR, aSpec4Back.GetData()); - myContext->core11->glMaterialfv(GL_BACK, GL_EMISSION, aBackMat.Emission.GetData()); - myContext->core11->glMaterialf (GL_BACK, GL_SHININESS, aBackMat.Shine()); + myContext->core11ffp->glMaterialfv(GL_BACK, GL_AMBIENT, aBackMat.Ambient.GetData()); + myContext->core11ffp->glMaterialfv(GL_BACK, GL_DIFFUSE, aBackMat.Diffuse.GetData()); + myContext->core11ffp->glMaterialfv(GL_BACK, GL_SPECULAR, aSpec4Back.GetData()); + myContext->core11ffp->glMaterialfv(GL_BACK, GL_EMISSION, aBackMat.Emission.GetData()); + myContext->core11ffp->glMaterialf (GL_BACK, GL_SHININESS, aBackMat.Shine()); } #endif return; @@ -1048,17 +1048,17 @@ void OpenGl_ShaderManager::PushState (const Handle(OpenGl_ShaderProgram)& thePro } } #if !defined(GL_ES_VERSION_2_0) - else if (myContext->core11 != NULL) + else if (myContext->core11ffp != NULL) { // manage FFP lighting myContext->SetShadeModel (theShadingModel); if (theShadingModel == Graphic3d_TOSM_UNLIT) { - glDisable (GL_LIGHTING); + myContext->core11fwd->glDisable (GL_LIGHTING); } else { - glEnable (GL_LIGHTING); + myContext->core11fwd->glEnable (GL_LIGHTING); } } #else diff --git a/src/OpenGl/OpenGl_ShaderProgram.cxx b/src/OpenGl/OpenGl_ShaderProgram.cxx index 3d1e5f8aa6..c46ead03de 100755 --- a/src/OpenGl/OpenGl_ShaderProgram.cxx +++ b/src/OpenGl/OpenGl_ShaderProgram.cxx @@ -1116,9 +1116,9 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)& return true; } #else - if (theCtx->core30fwd != NULL) + if (theCtx->core30 != NULL) { - theCtx->core30fwd->glUniform2uiv (theLocation, 1, theValue.GetData()); + theCtx->core30->glUniform2uiv (theLocation, 1, theValue.GetData()); return true; } #endif @@ -1158,9 +1158,9 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)& return true; } #else - if (theCtx->core30fwd != NULL) + if (theCtx->core30 != NULL) { - theCtx->core30fwd->glUniform2uiv (theLocation, theCount, theValue->GetData()); + theCtx->core30->glUniform2uiv (theLocation, theCount, theValue->GetData()); return true; } #endif diff --git a/src/OpenGl/OpenGl_Structure.cxx b/src/OpenGl/OpenGl_Structure.cxx index 1b4af0316e..ded5c09c4a 100644 --- a/src/OpenGl/OpenGl_Structure.cxx +++ b/src/OpenGl/OpenGl_Structure.cxx @@ -60,7 +60,7 @@ void OpenGl_Structure::renderBoundingBox (const Handle(OpenGl_Workspace)& theWor aBoundBoxVertBuffer->UnbindAttribute(aCtx, Graphic3d_TOA_POS); } #if !defined(GL_ES_VERSION_2_0) - else if (aCtx->core11 != NULL) + else if (aCtx->core11ffp != NULL) { const Graphic3d_Vec3d aMind = myBndBox.CornerMin() + aMoveVec; const Graphic3d_Vec3d aMaxd = myBndBox.CornerMax() + aMoveVec; @@ -89,10 +89,10 @@ void OpenGl_Structure::renderBoundingBox (const Handle(OpenGl_Workspace)& theWor aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID, Graphic3d_TOSM_UNLIT, Graphic3d_AlphaMode_Opaque, false, Handle(OpenGl_ShaderProgram)()); aCtx->SetColor4fv (theWorkspace->InteriorColor()); aCtx->core11fwd->glDisable (GL_LIGHTING); - aCtx->core11->glEnableClientState (GL_VERTEX_ARRAY); - aCtx->core11->glVertexPointer (3, GL_FLOAT, 0, aVerts[0].GetData()); + aCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY); + aCtx->core11ffp->glVertexPointer (3, GL_FLOAT, 0, aVerts[0].GetData()); aCtx->core11fwd->glDrawArrays (GL_LINE_STRIP, 0, 16); - aCtx->core11->glDisableClientState (GL_VERTEX_ARRAY); + aCtx->core11ffp->glDisableClientState (GL_VERTEX_ARRAY); } #endif aCtx->BindTextures (aPrevTexture, Handle(OpenGl_ShaderProgram)()); @@ -429,7 +429,7 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con const Standard_Boolean anOldGlNormalize = aCtx->IsGlNormalizeEnabled(); #if !defined(GL_ES_VERSION_2_0) // detect scale transform - if (aCtx->core11 != NULL + if (aCtx->core11ffp != NULL && !myTrsf.IsNull()) { const Standard_Real aScale = myTrsf->Trsf().ScaleFactor(); @@ -457,7 +457,7 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con #if !defined(GL_ES_VERSION_2_0) if (!aCtx->IsGlNormalizeEnabled() - && aCtx->core11 != NULL) + && aCtx->core11ffp != NULL) { const Standard_Real aScale = Graphic3d_TransformUtils::ScaleFactor (aWorldView); if (Abs (aScale - 1.0) > Precision::Confusion()) diff --git a/src/OpenGl/OpenGl_Text.cxx b/src/OpenGl/OpenGl_Text.cxx index 589095afb1..f7dd0cedc9 100644 --- a/src/OpenGl/OpenGl_Text.cxx +++ b/src/OpenGl/OpenGl_Text.cxx @@ -359,7 +359,7 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const // restore Z buffer settings if (theWorkspace->UseZBuffer()) { - glEnable (GL_DEPTH_TEST); + aCtx->core11fwd->glEnable (GL_DEPTH_TEST); } } @@ -514,19 +514,19 @@ void OpenGl_Text::drawText (const Handle(OpenGl_Context)& theCtx, for (Standard_Integer anIter = 0; anIter < myTextures.Length(); ++anIter) { const GLuint aTexId = myTextures.Value (anIter); - glBindTexture (GL_TEXTURE_2D, aTexId); + theCtx->core11fwd->glBindTexture (GL_TEXTURE_2D, aTexId); const Handle(OpenGl_VertexBuffer)& aVerts = myVertsVbo.Value (anIter); const Handle(OpenGl_VertexBuffer)& aTCrds = myTCrdsVbo.Value (anIter); aVerts->BindAttribute (theCtx, Graphic3d_TOA_POS); aTCrds->BindAttribute (theCtx, Graphic3d_TOA_UV); - glDrawArrays (GL_TRIANGLES, 0, GLsizei(aVerts->GetElemsNb())); + theCtx->core11fwd->glDrawArrays (GL_TRIANGLES, 0, GLsizei(aVerts->GetElemsNb())); aTCrds->UnbindAttribute (theCtx, Graphic3d_TOA_UV); aVerts->UnbindAttribute (theCtx, Graphic3d_TOA_POS); } - glBindTexture (GL_TEXTURE_2D, 0); + theCtx->core11fwd->glBindTexture (GL_TEXTURE_2D, 0); } // ======================================================================= @@ -634,10 +634,10 @@ void OpenGl_Text::drawRect (const Handle(OpenGl_Context)& theCtx, Handle(OpenGl_ShaderProgram)()); #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL + if (theCtx->core11ffp != NULL && theCtx->ActiveProgram().IsNull()) { - glBindTexture (GL_TEXTURE_2D, 0); + theCtx->core11fwd->glBindTexture (GL_TEXTURE_2D, 0); } #endif theCtx->SetColor4fv (theColorSubs); @@ -747,10 +747,10 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, } #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL + if (theCtx->core11ffp != NULL && theCtx->caps->ffpEnable) { - glDisable (GL_LIGHTING); + theCtx->core11fwd->glDisable (GL_LIGHTING); } #endif @@ -769,14 +769,14 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, #if !defined(GL_ES_VERSION_2_0) // activate texture unit GLint aTexEnvParam = GL_REPLACE; - if (theCtx->core11 != NULL) + if (theCtx->core11ffp != NULL) { - glDisable (GL_TEXTURE_1D); - glEnable (GL_TEXTURE_2D); - glGetTexEnviv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &aTexEnvParam); + theCtx->core11fwd->glDisable (GL_TEXTURE_1D); + theCtx->core11fwd->glEnable (GL_TEXTURE_2D); + theCtx->core11ffp->glGetTexEnviv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &aTexEnvParam); if (aTexEnvParam != GL_REPLACE) { - glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + theCtx->core11ffp->glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); } } #endif @@ -797,8 +797,8 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, case Aspect_TODT_BLEND: { #if !defined(GL_ES_VERSION_2_0) - glEnable (GL_COLOR_LOGIC_OP); - glLogicOp (GL_XOR); + theCtx->core11fwd->glEnable (GL_COLOR_LOGIC_OP); + theCtx->core11ffp->glLogicOp (GL_XOR); #endif break; } @@ -849,9 +849,9 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, } #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL) + if (theCtx->core11ffp != NULL) { - glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aTexEnvParam); + theCtx->core11ffp->glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aTexEnvParam); } #endif @@ -859,28 +859,28 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, { if (theTextAspect.Aspect()->AlphaMode() == Graphic3d_AlphaMode_MaskBlend) { - glDisable (GL_BLEND); + theCtx->core11fwd->glDisable (GL_BLEND); } if (!myIs2d) { - glDisable (GL_DEPTH_TEST); + theCtx->core11fwd->glDisable (GL_DEPTH_TEST); } #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL) + if (theCtx->core11ffp != NULL) { - glDisable (GL_TEXTURE_2D); + theCtx->core11fwd->glDisable (GL_TEXTURE_2D); } #endif const bool aColorMaskBack = theCtx->SetColorMask (false); - glClear (GL_STENCIL_BUFFER_BIT); - glEnable (GL_STENCIL_TEST); - glStencilFunc (GL_ALWAYS, 1, 0xFF); - glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE); + theCtx->core11fwd->glClear (GL_STENCIL_BUFFER_BIT); + theCtx->core11fwd->glEnable (GL_STENCIL_TEST); + theCtx->core11fwd->glStencilFunc (GL_ALWAYS, 1, 0xFF); + theCtx->core11fwd->glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE); drawRect (theCtx, theTextAspect, OpenGl_Vec4 (1.0f, 1.0f, 1.0f, 1.0f)); - glStencilFunc (GL_ALWAYS, 0, 0xFF); + theCtx->core11fwd->glStencilFunc (GL_ALWAYS, 0, 0xFF); theCtx->SetColorMask (aColorMaskBack); } @@ -890,9 +890,9 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, { theCtx->core11fwd->glDisable (GL_BLEND); } - glDisable (GL_STENCIL_TEST); + theCtx->core11fwd->glDisable (GL_STENCIL_TEST); #if !defined(GL_ES_VERSION_2_0) - glDisable (GL_COLOR_LOGIC_OP); + theCtx->core11fwd->glDisable (GL_COLOR_LOGIC_OP); #endif // model view matrix was modified diff --git a/src/OpenGl/OpenGl_TextureFormat.cxx b/src/OpenGl/OpenGl_TextureFormat.cxx index b9ad0f03a6..02b1d0a727 100644 --- a/src/OpenGl/OpenGl_TextureFormat.cxx +++ b/src/OpenGl/OpenGl_TextureFormat.cxx @@ -126,7 +126,7 @@ OpenGl_TextureFormat OpenGl_TextureFormat::FindFormat (const Handle(OpenGl_Conte #if defined(GL_ES_VERSION_2_0) const bool useRedRedAlpha = false; #else - const bool useRedRedAlpha = (theCtx->core11 == NULL); + const bool useRedRedAlpha = (theCtx->core11ffp == NULL); #endif switch (theFormat) { diff --git a/src/OpenGl/OpenGl_VertexBuffer.cxx b/src/OpenGl/OpenGl_VertexBuffer.cxx index 56b90b1afc..882912b6fc 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.cxx +++ b/src/OpenGl/OpenGl_VertexBuffer.cxx @@ -305,7 +305,7 @@ bool OpenGl_VertexBuffer::HasNormalAttribute() const // ======================================================================= void OpenGl_VertexBuffer::unbindFixedColor (const Handle(OpenGl_Context)& theCtx) { - theCtx->core11->glDisableClientState (GL_COLOR_ARRAY); + theCtx->core11ffp->glDisableClientState (GL_COLOR_ARRAY); theCtx->core11fwd->glDisable (GL_COLOR_MATERIAL); // invalidate FFP material state after GL_COLOR_MATERIAL has modified it (took values from the vertex color) diff --git a/src/OpenGl/OpenGl_VertexBuffer.lxx b/src/OpenGl/OpenGl_VertexBuffer.lxx index 78ae2f2f5f..48f5fe6369 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.lxx +++ b/src/OpenGl/OpenGl_VertexBuffer.lxx @@ -26,7 +26,7 @@ inline void OpenGl_VertexBuffer::bindAttribute (const Handle(OpenGl_Context)& if (theCtx->ActiveProgram().IsNull()) { #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL) + if (theCtx->core11ffp != NULL) { bindFixed (theCtx, theAttribute, theNbComp, theDataType, theStride, theOffset); } @@ -60,27 +60,27 @@ inline void OpenGl_VertexBuffer::bindFixed (const Handle(OpenGl_Context)& theC { case Graphic3d_TOA_POS: { - theCtx->core11->glEnableClientState (GL_VERTEX_ARRAY); - theCtx->core11->glVertexPointer (theNbComp, theDataType, theStride, theOffset); + theCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY); + theCtx->core11ffp->glVertexPointer (theNbComp, theDataType, theStride, theOffset); return; } case Graphic3d_TOA_NORM: { - theCtx->core11->glEnableClientState (GL_NORMAL_ARRAY); - theCtx->core11->glNormalPointer (theDataType, theStride, theOffset); + theCtx->core11ffp->glEnableClientState (GL_NORMAL_ARRAY); + theCtx->core11ffp->glNormalPointer (theDataType, theStride, theOffset); return; } case Graphic3d_TOA_UV: { - theCtx->core11->glEnableClientState (GL_TEXTURE_COORD_ARRAY); - theCtx->core11->glTexCoordPointer (theNbComp, theDataType, theStride, theOffset); + theCtx->core11ffp->glEnableClientState (GL_TEXTURE_COORD_ARRAY); + theCtx->core11ffp->glTexCoordPointer (theNbComp, theDataType, theStride, theOffset); return; } case Graphic3d_TOA_COLOR: { - theCtx->core11->glEnableClientState (GL_COLOR_ARRAY); - theCtx->core11->glColorPointer (theNbComp, theDataType, theStride, theOffset); - theCtx->core11->glColorMaterial (GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE); + theCtx->core11ffp->glEnableClientState (GL_COLOR_ARRAY); + theCtx->core11ffp->glColorPointer (theNbComp, theDataType, theStride, theOffset); + theCtx->core11ffp->glColorMaterial (GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE); theCtx->core11fwd->glEnable (GL_COLOR_MATERIAL); return; } @@ -102,7 +102,7 @@ inline void OpenGl_VertexBuffer::unbindAttribute (const Handle(OpenGl_Context)& if (theCtx->ActiveProgram().IsNull()) { #if !defined(GL_ES_VERSION_2_0) - if (theCtx->core11 != NULL) + if (theCtx->core11ffp != NULL) { unbindFixed (theCtx, theAttribute); } @@ -123,9 +123,9 @@ inline void OpenGl_VertexBuffer::unbindFixed (const Handle(OpenGl_Context)& th { switch (theMode) { - case Graphic3d_TOA_POS: theCtx->core11->glDisableClientState (GL_VERTEX_ARRAY); return; - case Graphic3d_TOA_NORM: theCtx->core11->glDisableClientState (GL_NORMAL_ARRAY); return; - case Graphic3d_TOA_UV: theCtx->core11->glDisableClientState (GL_TEXTURE_COORD_ARRAY); return; + case Graphic3d_TOA_POS: theCtx->core11ffp->glDisableClientState (GL_VERTEX_ARRAY); return; + case Graphic3d_TOA_NORM: theCtx->core11ffp->glDisableClientState (GL_NORMAL_ARRAY); return; + case Graphic3d_TOA_UV: theCtx->core11ffp->glDisableClientState (GL_TEXTURE_COORD_ARRAY); return; case Graphic3d_TOA_COLOR: unbindFixedColor (theCtx); return; case Graphic3d_TOA_CUSTOM: { diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx index 2dbf9ce7e8..57191a1d08 100644 --- a/src/OpenGl/OpenGl_View.cxx +++ b/src/OpenGl/OpenGl_View.cxx @@ -1659,7 +1659,7 @@ void OpenGl_View::Redraw() #endif myXRSession->SubmitEye ((void* )(size_t )anXRFbo->ColorTexture()->TextureId(), aGraphicsLib, Aspect_ColorSpace_sRGB, Aspect_Eye_Right); - ::glFinish(); + aCtx->core11fwd->glFinish(); if (myRenderParams.ToMirrorComposer) { @@ -2030,14 +2030,10 @@ bool OpenGl_View::redrawImmediate (const Graphic3d_Camera::Projection theProject myWorkspace->UseZBuffer() = Standard_True; myWorkspace->UseDepthWrite() = Standard_True; - glDepthFunc (GL_LEQUAL); - glDepthMask (GL_TRUE); - glEnable (GL_DEPTH_TEST); -#if !defined(GL_ES_VERSION_2_0) - glClearDepth (1.0); -#else - glClearDepthf (1.0f); -#endif + aCtx->core11fwd->glDepthFunc (GL_LEQUAL); + aCtx->core11fwd->glDepthMask (GL_TRUE); + aCtx->core11fwd->glEnable (GL_DEPTH_TEST); + aCtx->core11fwd->glClearDepth (1.0); render (theProjection, theDrawFbo, theOitAccumFbo, Standard_True); @@ -2118,7 +2114,7 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection, #if !defined(GL_ES_VERSION_2_0) // Disable current clipping planes - if (aContext->core11 != NULL) + if (aContext->core11ffp != NULL) { const Standard_Integer aMaxPlanes = aContext->MaxClipPlanes(); for (Standard_Integer aClipPlaneId = GL_CLIP_PLANE0; aClipPlaneId < GL_CLIP_PLANE0 + aMaxPlanes; ++aClipPlaneId) @@ -2176,10 +2172,10 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection, #if !defined(GL_ES_VERSION_2_0) // Switch off lighting by default - if (aContext->core11 != NULL + if (aContext->core11ffp != NULL && aContext->caps->ffpEnable) { - glDisable(GL_LIGHTING); + aContext->core11fwd->glDisable (GL_LIGHTING); } #endif @@ -2893,7 +2889,7 @@ bool OpenGl_View::copyBackToFront() myIsImmediateDrawn = Standard_False; #if !defined(GL_ES_VERSION_2_0) const Handle(OpenGl_Context)& aCtx = myWorkspace->GetGlContext(); - if (aCtx->core11 == NULL) + if (aCtx->core11ffp == NULL) { return false; } @@ -2939,9 +2935,9 @@ bool OpenGl_View::copyBackToFront() } } - aCtx->core11->glRasterPos2i (0, 0); - aCtx->core11->glCopyPixels (0, 0, myWindow->Width() + 1, myWindow->Height() + 1, GL_COLOR); - //aCtx->core11->glCopyPixels (0, 0, myWidth + 1, myHeight + 1, GL_DEPTH); + aCtx->core11ffp->glRasterPos2i (0, 0); + aCtx->core11ffp->glCopyPixels (0, 0, myWindow->Width() + 1, myWindow->Height() + 1, GL_COLOR); + //aCtx->core11ffp->glCopyPixels (0, 0, myWidth + 1, myHeight + 1, GL_DEPTH); aCtx->EnableFeatures(); diff --git a/src/OpenGl/OpenGl_Window.cxx b/src/OpenGl/OpenGl_Window.cxx index 8d1a3c617b..e503759083 100644 --- a/src/OpenGl/OpenGl_Window.cxx +++ b/src/OpenGl/OpenGl_Window.cxx @@ -778,7 +778,7 @@ void OpenGl_Window::Init() myGlContext->ResizeViewport (aViewport); #if !defined(GL_ES_VERSION_2_0) myGlContext->SetDrawBuffer (GL_BACK); - if (myGlContext->core11 != NULL) + if (myGlContext->core11ffp != NULL) { glMatrixMode (GL_MODELVIEW); } diff --git a/src/OpenGl/OpenGl_Window_1.mm b/src/OpenGl/OpenGl_Window_1.mm index 8b51fd0ab0..4b24c53e8f 100644 --- a/src/OpenGl/OpenGl_Window_1.mm +++ b/src/OpenGl/OpenGl_Window_1.mm @@ -379,7 +379,7 @@ void OpenGl_Window::Init() ::glViewport (0, 0, myWidth, myHeight); #if !defined(GL_ES_VERSION_2_0) ::glDrawBuffer (GL_BACK); - if (myGlContext->core11 != NULL) + if (myGlContext->core11ffp != NULL) { ::glMatrixMode (GL_MODELVIEW); } diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index 3a6683a963..0bc8348bce 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -144,19 +144,19 @@ OpenGl_Workspace::OpenGl_Workspace (OpenGl_View* theView, const Handle(OpenGl_Wi // General initialization of the context #if !defined(GL_ES_VERSION_2_0) - if (myGlContext->core11 != NULL) + if (myGlContext->core11ffp != NULL) { // enable two-side lighting by default - glLightModeli ((GLenum )GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); - glHint (GL_POINT_SMOOTH_HINT, GL_FASTEST); + myGlContext->core11ffp->glLightModeli ((GLenum )GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + myGlContext->core11fwd->glHint (GL_POINT_SMOOTH_HINT, GL_FASTEST); if (myGlContext->caps->ffpEnable) { - glHint (GL_FOG_HINT, GL_FASTEST); + myGlContext->core11fwd->glHint (GL_FOG_HINT, GL_FASTEST); } } - glHint (GL_LINE_SMOOTH_HINT, GL_FASTEST); - glHint (GL_POLYGON_SMOOTH_HINT, GL_FASTEST); + myGlContext->core11fwd->glHint (GL_LINE_SMOOTH_HINT, GL_FASTEST); + myGlContext->core11fwd->glHint (GL_POLYGON_SMOOTH_HINT, GL_FASTEST); if (myGlContext->Vendor() == "microsoft corporation" && !myGlContext->IsGlGreaterEqual (1, 2)) { @@ -189,7 +189,7 @@ Standard_Boolean OpenGl_Workspace::Activate() ViewMatrix_applied = &myDefaultMatrix; StructureMatrix_applied = &myDefaultMatrix; - if (myGlContext->core11 == NULL) + if (myGlContext->core11ffp == NULL) { if (myGlContext->caps->ffpEnable) {