0031088: Visualization - GL_INVALID_ENUM while dumping view within OpenGL 1.1
[occt.git] / src / OpenGl / OpenGl_Sampler.cxx
index 24b69b6..54c1e25 100644 (file)
@@ -418,7 +418,8 @@ void OpenGl_Sampler::resetGlobalTextureParams (const Handle(OpenGl_Context)& the
       {
         theCtx->core11fwd->glDisable (GL_TEXTURE_GEN_S);
         theCtx->core11fwd->glDisable (GL_TEXTURE_GEN_T);
-        if (theParams->GenMode() == Graphic3d_TOTM_SPRITE)
+        if (theParams->GenMode() == Graphic3d_TOTM_SPRITE
+         && theCtx->core20fwd != NULL)
         {
           theCtx->core11fwd->glDisable (GL_POINT_SPRITE);
         }