From: ouv Date: Fri, 16 Dec 2005 16:30:43 +0000 (+0000) Subject: Fixed bug with displaying of the point sprites on the machines with weak video cards. X-Git-Tag: TG-D5-38-2003_D2005-20-12~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1afb38470f58e84c1e7c2d2b3813a5924026a253;p=modules%2Fvisu.git Fixed bug with displaying of the point sprites on the machines with weak video cards. --- diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 1041ef4b..f52a7bc6 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -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; } diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index a05b57ad..1ddb55ff 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -228,7 +228,7 @@ protected: vtkActor *act); //! Initializing OpenGL extensions. - void InitExtensions(); + bool InitExtensions(); //! Activate Point Sprites. void InitPointSprites();