0022734: Memory allocation error in OpenGl
[occt.git] / src / OpenGl / OpenGl_Text.cxx
index fa8929c..0bc7cc0 100644 (file)
@@ -1,22 +1,30 @@
-// File:      OpenGl_Text.cxx
-// Created:   13 July 2011
-// Author:    Sergey ZERCHANINOV
-// Copyright: OPEN CASCADE 2011
-
+// Created on: 2011-07-13
+// Created by: Sergey ZERCHANINOV
+// Copyright (c) 2011-2012 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#include <OpenGl_GlCore11.hxx>
 #include <OpenGl_Text.hxx>
-
-#if (!defined(_WIN32) && !defined(__WIN32__))
-  #include <X11/Xlib.h>
-#endif
-
-#include <OpenGl_tgl_all.hxx>
-#include <GL/gl.h>
-
-#include <OpenGl_Memory.hxx>
-
 #include <OpenGl_AspectText.hxx>
 #include <OpenGl_Structure.hxx>
 
+#include <GL/glu.h> // gluUnProject()
+
 /*----------------------------------------------------------------------*/
 
 OpenGl_Text::OpenGl_Text (const TCollection_ExtendedString& AText,
@@ -90,7 +98,6 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
 
   AWorkspace->SetTextParam(&myParam);
 
-  GLboolean       blend_state = GL_FALSE; 
   GLdouble        modelMatrix[16], projMatrix[16];
   GLint           viewport[4];
   GLdouble        objrefX, objrefY, objrefZ;
@@ -113,8 +120,6 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
     switch (aspect_text->DisplayType())
     {
     case Aspect_TODT_BLEND:
-      blend_state = glIsEnabled(GL_BLEND);
-      if (!blend_state) glEnable(GL_BLEND);
       glEnable(GL_COLOR_LOGIC_OP);
       glLogicOp(GL_XOR);
       break;
@@ -205,7 +210,6 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
   if (flag_zbuffer) glEnable(GL_DEPTH_TEST);
   if (aspect_text->DisplayType() == Aspect_TODT_BLEND)
   {
-    if (!blend_state) glDisable(GL_BLEND);
     glDisable(GL_COLOR_LOGIC_OP);
   }
 }