OpenGl_Workspace::Activate() now implicitly disables OpenGl_Caps::ffpEnable when it is unsupported.
OpenGl_AspectsSprite::build() now ignores OpenGl_Caps::pntSpritesDisable when Display Lists are unsupported.
return;
}
- if (!theCtx.IsNull()
- && theCtx->core20fwd != NULL
- && !theCtx->caps->pntSpritesDisable)
+ if (theCtx->core20fwd != NULL
+ && (!theCtx->caps->pntSpritesDisable || theCtx->core11 == NULL))
{
// Creating texture resource for using it with point sprites
Handle(Image_PixMap) anImage = aNewMarkerImage->GetImage();
}
}
}
- else
+ else if (theCtx->core11 != NULL)
{
#if !defined(GL_ES_VERSION_2_0)
// Creating list with bitmap for using it in compatibility mode
// =======================================================================
void OpenGl_Context::SetLineWidth (const Standard_ShortReal theWidth)
{
+#if !defined(GL_ES_VERSION_2_0)
if (core11 != NULL)
+#endif
{
// glLineWidth() is still defined within Core Profile, but has no effect with values != 1.0f
core11fwd->glLineWidth (theWidth * myLineWidthScale);
void OpenGl_GlFunctions::load (OpenGl_Context& theCtx,
Standard_Boolean theIsCoreProfile)
{
+#if defined(GL_ES_VERSION_2_0)
+ (void )theIsCoreProfile;
+ theCtx.core11 = NULL;
+#else
const bool isCoreProfile = theIsCoreProfile;
theCtx.core11 = !isCoreProfile ? (OpenGl_GlCore11* )this : NULL;
+#endif
theCtx.core11fwd = (OpenGl_GlCore11Fwd* )this;
theCtx.core15 = NULL;
theCtx.core15fwd = NULL;
{
OpenGl_TextureFormat aFormat;
aFormat.SetImageFormat (theFormat);
+#if defined(GL_ES_VERSION_2_0)
+ const bool useRedRedAlpha = false;
+#else
+ const bool useRedRedAlpha = (theCtx->core11 == NULL);
+#endif
switch (theFormat)
{
case Image_Format_GrayF:
{
aFormat.SetNbComponents (1);
- if (theCtx->core11 == NULL)
+ if (useRedRedAlpha)
{
aFormat.SetInternalFormat (theCtx->arbTexFloat ? GL_R32F : GL_R8);
aFormat.SetPixelFormat (GL_RED);
case Image_Format_AlphaF:
{
aFormat.SetNbComponents (1);
- if (theCtx->core11 == NULL)
+ if (useRedRedAlpha)
{
aFormat.SetInternalFormat (theCtx->arbTexFloat ? GL_R32F : GL_R8);
aFormat.SetPixelFormat (GL_RED);
case Image_Format_Gray:
{
aFormat.SetNbComponents (1);
- if (theCtx->core11 == NULL)
+ if (useRedRedAlpha)
{
aFormat.SetInternalFormat (GL_R8);
aFormat.SetPixelFormat (GL_RED);
case Image_Format_Alpha:
{
aFormat.SetNbComponents (1);
- if (theCtx->core11 == NULL)
+ if (useRedRedAlpha)
{
aFormat.SetInternalFormat (GL_R8);
aFormat.SetPixelFormat (GL_RED);
ViewMatrix_applied = &myDefaultMatrix;
StructureMatrix_applied = &myDefaultMatrix;
+ if (myGlContext->core11 == NULL)
+ {
+ if (myGlContext->caps->ffpEnable)
+ {
+ #if defined(GL_ES_VERSION_2_0)
+ Message::SendWarning ("Warning: FFP is unsupported by OpenGL ES");
+ #else
+ Message::SendWarning ("Warning: FFP is unsupported by OpenGL Core Profile");
+ #endif
+ myGlContext->caps->ffpEnable = false;
+ }
+ }
+
ResetAppliedAspect();
// reset state for safety