From 1afb38470f58e84c1e7c2d2b3813a5924026a253 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 16 Dec 2005 16:30:43 +0000 Subject: [PATCH] Fixed bug with displaying of the point sprites on the machines with weak video cards. --- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 10 +++++----- src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) 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(); -- 2.39.2