]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fixed bug with displaying of the point sprites on the machines with weak video cards.
authorouv <ouv@opencascade.com>
Fri, 16 Dec 2005 16:30:43 +0000 (16:30 +0000)
committerouv <ouv@opencascade.com>
Fri, 16 Dec 2005 16:30:43 +0000 (16:30 +0000)
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx

index 1041ef4bd76d6a64361815b120c949ce1da80fa5..f52a7bc601bf5b25827b2992cd6fef2ca673d436 100755 (executable)
@@ -378,7 +378,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold( float theAlphaT
   this->PointSpriteAlphaThreshold = theAlphaThreshold;
 }
 //-----------------------------------------------------------------------------
-void VISU_OpenGLPointSpriteMapper::InitExtensions()
+bool VISU_OpenGLPointSpriteMapper::InitExtensions()
 {
   char* ext = (char*)glGetString( GL_EXTENSIONS );
   //cout << "OpenGL extensions : " << ext << endl;
@@ -391,13 +391,14 @@ void VISU_OpenGLPointSpriteMapper::InitExtensions()
 
     this->UseOpenGLMapper = true;
 
-    return;
+    return false;
   }
 
   if( this->UseShader )
     this->InitShader();
 
   this->ExtensionsInitialized = 1;
+  return true;
 }
 
 //-----------------------------------------------------------------------------
@@ -432,13 +433,12 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act)
 
   if( !this->ExtensionsInitialized && isUseThisMapper )
   {
-    this->InitExtensions();
-    //act->GetProperty()->SetPointSize( 10.0f );
+    if( !this->InitExtensions() )
+      return;
   }
 
   if( !isUseThisMapper )
   {
-    //cout << "Using OpenGLMapper" << endl;
     MAPPER_SUPERCLASS::RenderPiece( ren, act );
     return;
   }
index a05b57adcc9df4210719dc0f7e8134308b8e8def..1ddb55fff3421cd6d6a54d0999f5ae2519b49cd9 100755 (executable)
@@ -228,7 +228,7 @@ protected:
                               vtkActor *act);
 
   //! Initializing OpenGL extensions.
-  void              InitExtensions();
+  bool              InitExtensions();
 
   //! Activate Point Sprites.
   void              InitPointSprites();