#if !defined(GL_ES_VERSION_2_0)
myPointSpriteOrig (GL_UPPER_LEFT),
myRenderMode (GL_RENDER),
+ myShadeModel (GL_SMOOTH),
myPolygonMode (GL_FILL),
#else
myPointSpriteOrig (0),
myRenderMode (0),
+ myShadeModel (0),
myPolygonMode (0),
#endif
myToCullBackFaces (false),
if (core11 != NULL)
{
::glGetIntegerv (GL_RENDER_MODE, &myRenderMode);
+ ::glGetIntegerv (GL_SHADE_MODEL, &myShadeModel);
}
// cache read buffers state
return anOldGlNormalize;
}
+// =======================================================================
+// function : SetShadeModel
+// purpose :
+// =======================================================================
+void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel)
+{
+#if !defined(GL_ES_VERSION_2_0)
+ if (core11 != NULL)
+ {
+ const Standard_Integer aModel = theModel == Graphic3d_TOSM_FACET
+ || theModel == Graphic3d_TOSM_PBR_FACET ? GL_FLAT : GL_SMOOTH;
+ if (myShadeModel == aModel)
+ {
+ return;
+ }
+ myShadeModel = aModel;
+ core11->glShadeModel (aModel);
+ }
+#else
+ (void )theModel;
+#endif
+}
+
// =======================================================================
// function : SetPolygonMode
// purpose :