1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0032217: Visualization, TKOpenGl - drop propagation of unused FFP functions

OpenGl_GlFunctions no more loads unused FFP functions.
OpenGl_GlCoreXX function tables no more defined two hierarchies with and without FFP functions,
and OpenGl_Context::coreXXback fields have been removed.
Introduced OpenGl_Context::core11ffp as more straightforward naming for obsolete FFP function set.
This commit is contained in:
kgv 2021-03-10 21:59:45 +03:00 committed by bugmaster
parent b470ebea04
commit 43eddb470f
37 changed files with 347 additions and 2099 deletions

View File

@ -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

View File

@ -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<GLint> (theFactor),
static_cast<GLushort> (thePattern));
core11ffp->glLineStipple (static_cast<GLint> (theFactor),
static_cast<GLushort> (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<bool>& 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;

View File

@ -73,72 +73,23 @@ struct OpenGl_ArbSamplerObject;
struct OpenGl_ArbTexBindless;
struct OpenGl_ExtGS;
template<typename theBaseClass_t> struct OpenGl_TmplCore12;
typedef OpenGl_TmplCore12<OpenGl_GlCore11> OpenGl_GlCore12;
typedef OpenGl_TmplCore12<OpenGl_GlCore11Fwd> OpenGl_GlCore12Fwd;
struct OpenGl_GlCore12;
struct OpenGl_GlCore13;
struct OpenGl_GlCore13Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore14;
typedef OpenGl_TmplCore14<OpenGl_GlCore13> OpenGl_GlCore14;
typedef OpenGl_TmplCore14<OpenGl_GlCore13Fwd> OpenGl_GlCore14Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore15;
typedef OpenGl_TmplCore15<OpenGl_GlCore14> OpenGl_GlCore15;
typedef OpenGl_TmplCore15<OpenGl_GlCore14Fwd> OpenGl_GlCore15Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore20;
typedef OpenGl_TmplCore20<OpenGl_GlCore15> OpenGl_GlCore20;
typedef OpenGl_TmplCore20<OpenGl_GlCore15Fwd> OpenGl_GlCore20Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore21;
typedef OpenGl_TmplCore21<OpenGl_GlCore20> OpenGl_GlCore21;
typedef OpenGl_TmplCore21<OpenGl_GlCore20Fwd> OpenGl_GlCore21Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore30;
typedef OpenGl_TmplCore30<OpenGl_GlCore21> OpenGl_GlCore30;
typedef OpenGl_TmplCore30<OpenGl_GlCore21Fwd> OpenGl_GlCore30Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore31;
typedef OpenGl_TmplCore31<OpenGl_GlCore30> OpenGl_GlCore31Back;
typedef OpenGl_TmplCore31<OpenGl_GlCore30Fwd> OpenGl_GlCore31;
template<typename theBaseClass_t> struct OpenGl_TmplCore32;
typedef OpenGl_TmplCore32<OpenGl_GlCore31Back> OpenGl_GlCore32Back;
typedef OpenGl_TmplCore32<OpenGl_GlCore31> OpenGl_GlCore32;
template<typename theBaseClass_t> struct OpenGl_TmplCore33;
typedef OpenGl_TmplCore33<OpenGl_GlCore32Back> OpenGl_GlCore33Back;
typedef OpenGl_TmplCore33<OpenGl_GlCore32> OpenGl_GlCore33;
template<typename theBaseClass_t> struct OpenGl_TmplCore40;
typedef OpenGl_TmplCore40<OpenGl_GlCore33Back> OpenGl_GlCore40Back;
typedef OpenGl_TmplCore40<OpenGl_GlCore33> OpenGl_GlCore40;
template<typename theBaseClass_t> struct OpenGl_TmplCore41;
typedef OpenGl_TmplCore41<OpenGl_GlCore40Back> OpenGl_GlCore41Back;
typedef OpenGl_TmplCore41<OpenGl_GlCore40> OpenGl_GlCore41;
template<typename theBaseClass_t> struct OpenGl_TmplCore42;
typedef OpenGl_TmplCore42<OpenGl_GlCore41Back> OpenGl_GlCore42Back;
typedef OpenGl_TmplCore42<OpenGl_GlCore41> OpenGl_GlCore42;
template<typename theBaseClass_t> struct OpenGl_TmplCore43;
typedef OpenGl_TmplCore43<OpenGl_GlCore42Back> OpenGl_GlCore43Back;
typedef OpenGl_TmplCore43<OpenGl_GlCore42> OpenGl_GlCore43;
template<typename theBaseClass_t> struct OpenGl_TmplCore44;
typedef OpenGl_TmplCore44<OpenGl_GlCore43Back> OpenGl_GlCore44Back;
typedef OpenGl_TmplCore44<OpenGl_GlCore43> OpenGl_GlCore44;
template<typename theBaseClass_t> struct OpenGl_TmplCore45;
typedef OpenGl_TmplCore45<OpenGl_GlCore44Back> OpenGl_GlCore45Back;
typedef OpenGl_TmplCore45<OpenGl_GlCore44> OpenGl_GlCore45;
template<typename theBaseClass_t> struct OpenGl_TmplCore46;
typedef OpenGl_TmplCore46<OpenGl_GlCore45Back> OpenGl_GlCore46Back;
typedef OpenGl_TmplCore46<OpenGl_GlCore45> 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

File diff suppressed because it is too large Load Diff

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore11.hxx>
//! OpenGL 1.2 core based on 1.1 version.
template<typename theBaseClass_t>
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_GlCore11> OpenGl_GlCore12;
//! OpenGL 1.2 without deprecated entry points.
typedef OpenGl_TmplCore12<OpenGl_GlCore11Fwd> OpenGl_GlCore12Fwd;
#endif // _OpenGl_GlCore12_Header

View File

@ -19,27 +19,6 @@
#include <OpenGl_GlCore12.hxx>
//! 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

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore13.hxx>
//! OpenGL 1.4 core based on 1.3 version.
template<typename theBaseClass_t>
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_GlCore13> OpenGl_GlCore14;
//! OpenGL 1.4 without deprecated entry points.
typedef OpenGl_TmplCore14<OpenGl_GlCore13Fwd> OpenGl_GlCore14Fwd;
#endif // _OpenGl_GlCore14_Header

View File

@ -18,12 +18,11 @@
#include <OpenGl_GlCore14.hxx>
/**
* OpenGL 1.5 core based on 1.4 version.
*/
template<typename theBaseClass_t>
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_GlCore14> OpenGl_GlCore15;
//! OpenGL 1.5 without deprecated entry points.
typedef OpenGl_TmplCore15<OpenGl_GlCore14Fwd> OpenGl_GlCore15Fwd;
#endif // _OpenGl_GlCore15_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore15.hxx>
//! OpenGL 2.0 core based on 1.5 version.
template<typename theBaseClass_t>
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_GlCore15> OpenGl_GlCore20;
//! OpenGL 2.0 without deprecated entry points.
typedef OpenGl_TmplCore20<OpenGl_GlCore15Fwd> OpenGl_GlCore20Fwd;
#endif // _OpenGl_GlCore20_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore20.hxx>
//! OpenGL 2.1 core based on 2.0 version.
template<typename theBaseClass_t>
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_GlCore20> OpenGl_GlCore21;
//! OpenGL 2.1 without deprecated entry points.
typedef OpenGl_TmplCore21<OpenGl_GlCore20Fwd> OpenGl_GlCore21Fwd;
#endif // _OpenGl_GlCore21_Header

View File

@ -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<typename theBaseClass_t>
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_GlCore21> 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_GlCore21Fwd> OpenGl_GlCore30Fwd;
#endif // _OpenGl_GlCore30_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore30.hxx>
//! OpenGL 3.1 definition.
template<typename theBaseClass_t>
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_GlCore30> 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_GlCore30Fwd> OpenGl_GlCore31;
#endif // _OpenGl_GlCore31_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore31.hxx>
//! OpenGL 3.2 definition.
template<typename theBaseClass_t>
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_GlCore31Back> OpenGl_GlCore32Back;
//! OpenGL 3.2 core profile.
typedef OpenGl_TmplCore32<OpenGl_GlCore31> OpenGl_GlCore32;
#endif // _OpenGl_GlCore32_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore32.hxx>
//! OpenGL 3.3 definition.
template<typename theBaseClass_t>
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_GlCore32Back> OpenGl_GlCore33Back;
//! OpenGL 3.3 core profile.
typedef OpenGl_TmplCore33<OpenGl_GlCore32> OpenGl_GlCore33;
#endif // _OpenGl_GlCore33_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore33.hxx>
//! OpenGL 4.0 definition.
template<typename theBaseClass_t>
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_GlCore33Back> OpenGl_GlCore40Back;
//! OpenGL 4.0 core profile.
typedef OpenGl_TmplCore40<OpenGl_GlCore33> OpenGl_GlCore40;
#endif // _OpenGl_GlCore40_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore40.hxx>
//! OpenGL 4.1 definition.
template<typename theBaseClass_t>
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_GlCore40Back> OpenGl_GlCore41Back;
//! OpenGL 4.1 core profile.
typedef OpenGl_TmplCore41<OpenGl_GlCore40> OpenGl_GlCore41;
#endif // _OpenGl_GlCore41_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore41.hxx>
//! OpenGL 4.2 definition.
template<typename theBaseClass_t>
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_GlCore41Back> OpenGl_GlCore42Back;
//! OpenGL 4.2 core profile.
typedef OpenGl_TmplCore42<OpenGl_GlCore41> OpenGl_GlCore42;
#endif // _OpenGl_GlCore42_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore42.hxx>
//! OpenGL 4.3 definition.
template<typename theBaseClass_t>
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_GlCore42Back> OpenGl_GlCore43Back;
//! OpenGL 4.3 core profile.
typedef OpenGl_TmplCore43<OpenGl_GlCore42> OpenGl_GlCore43;
#endif // _OpenGl_GlCore43_Header

View File

@ -19,9 +19,10 @@
#include <OpenGl_GlCore43.hxx>
//! OpenGL 4.4 definition.
template<typename theBaseClass_t>
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_GlCore43Back> OpenGl_GlCore44Back;
//! OpenGL 4.4 core profile.
typedef OpenGl_TmplCore44<OpenGl_GlCore43> OpenGl_GlCore44;
#endif // _OpenGl_GlCore44_Header

View File

@ -17,9 +17,10 @@
#include <OpenGl_GlCore44.hxx>
//! OpenGL 4.5 definition.
template<typename theBaseClass_t>
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_GlCore44Back> OpenGl_GlCore45Back;
//! OpenGL 4.5 core profile.
typedef OpenGl_TmplCore45<OpenGl_GlCore44> OpenGl_GlCore45;
#endif // _OpenGl_GlCore45_Header

View File

@ -17,9 +17,10 @@
#include <OpenGl_GlCore45.hxx>
//! OpenGL 4.6 definition.
template<typename theBaseClass_t>
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_GlCore45Back> OpenGl_GlCore46Back;
//! OpenGL 4.6 core profile.
typedef OpenGl_TmplCore46<OpenGl_GlCore45> OpenGl_GlCore46;
#endif // _OpenGl_GlCore46_Header

View File

@ -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
{

View File

@ -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;

View File

@ -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;
}

View File

@ -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<Graphic3d_Vec3> (anIter).GetData());
aCtx->core11ffp->glRasterPos3fv (myAttribs->Value<Graphic3d_Vec3> (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())
{

View File

@ -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())
{

View File

@ -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<float>(theLight.Position().X()), static_cast<float>(theLight.Position().Y()), static_cast<float>(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<float>(theLight.Position().X()), static_cast<float>(theLight.Position().Y()), static_cast<float>(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

View File

@ -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

View File

@ -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<Standard_ShortReal> (aWorldView);
if (Abs (aScale - 1.0) > Precision::Confusion())

View File

@ -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

View File

@ -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)
{

View File

@ -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)

View File

@ -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:
{

View File

@ -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();

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)
{