From: san Date: Fri, 22 Jun 2012 07:33:53 +0000 (+0400) Subject: 0023186: Unable to display Graphic3d_ArrayOfPoints after migrating from OCCT 6.5.2 X-Git-Tag: V6_5_4_beta1~159 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=1d03e66d2a13de491a1ec492b0fcec5f94100e88;hp=85e096c3df7e12e72ba4f04e2dfc42ee02621d1f 0023186: Unable to display Graphic3d_ArrayOfPoints after migrating from OCCT 6.5.2 GL_NONE replaced with PARRAY_DRAW_MODE_NONE to disambiguate with GL_POINTS DRAW_MODE_NONE constant moved into OpenGl_PrimitiveArray class to avoid potential name collisions --- diff --git a/src/OpenGl/OpenGl_PrimitiveArray.cxx b/src/OpenGl/OpenGl_PrimitiveArray.cxx index 1461326325..b0dd084a6d 100755 --- a/src/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.cxx @@ -1644,7 +1644,7 @@ void OpenGl_PrimitiveArray::DrawDegeneratesAsBBoxs (const TEL_COLOUR* theEdgeCol // ======================================================================= OpenGl_PrimitiveArray::OpenGl_PrimitiveArray (CALL_DEF_PARRAY* thePArray) : myPArray (thePArray), - myDrawMode (GL_NONE) + myDrawMode (DRAW_MODE_NONE) { switch (myPArray->type) { @@ -1714,7 +1714,7 @@ OpenGl_PrimitiveArray::~OpenGl_PrimitiveArray () // ======================================================================= void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace) const { - if (myPArray == NULL || myDrawMode == GL_NONE) + if (myPArray == NULL || myDrawMode == DRAW_MODE_NONE) return; // create VBOs on first render call diff --git a/src/OpenGl/OpenGl_PrimitiveArray.hxx b/src/OpenGl/OpenGl_PrimitiveArray.hxx index 54a1a2675a..7336404132 100644 --- a/src/OpenGl/OpenGl_PrimitiveArray.hxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.hxx @@ -34,6 +34,13 @@ class Handle(OpenGl_Context); class OpenGl_PrimitiveArray : public OpenGl_Element { public: + // OpenGL does not provie a constant for "none" draw mode. + // So we define our own one that does not conflict with GL constants + // and untilizes common GL invalid value + enum + { + DRAW_MODE_NONE = -1 + }; //! Default constructor OpenGl_PrimitiveArray (CALL_DEF_PARRAY* thePArray); @@ -91,7 +98,7 @@ private: protected: mutable CALL_DEF_PARRAY* myPArray; - GLenum myDrawMode; + GLint myDrawMode; public: