{
Q_INIT_RESOURCE( VTKViewer );
- this->ExtensionsInitialized = 0;
+ this->ExtensionsInitialized = ES_None;
this->PointSpriteTexture = 0;
}
//-----------------------------------------------------------------------------
-bool VTKViewer_PolyDataMapper::InitExtensions()
+int VTKViewer_PolyDataMapper::InitExtensions()
{
- if( this->ExtensionsInitialized )
- return true;
-
- InitializeBufferExtensions();
-
char* ext = (char*)glGetString( GL_EXTENSIONS );
if( !IsBufferExtensionsInitialized ||
strstr( ext, "GL_ARB_point_sprite" ) == NULL ||
strstr( ext, "GL_ARB_vertex_buffer_object" ) == NULL )
{
- INFOS("Initializing ARB extensions failed");
- return false;
+ MESSAGE("Initializing ARB extensions failed");
+ return ES_Error;
}
- this->ExtensionsInitialized = 1;
- return true;
+ return ES_Ok;
}
//-----------------------------------------------------------------------------
bool isUsePointSprites = this->MarkerEnabled && this->MarkerType != VTK::MT_NONE;
if( isUsePointSprites )
{
- this->InitExtensions();
+ if( this->ExtensionsInitialized == ES_None )
+ this->ExtensionsInitialized = this->InitExtensions();
this->InitPointSprites();
this->InitTextures();
}
delete aColorFunctor;
}
- if( this->ExtensionsInitialized ) {
+ if( this->ExtensionsInitialized == ES_Ok ) {
GLuint aBufferObjectID = 0;
vglGenBuffersARB( 1, &aBufferObjectID );
vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
*/
class VTKVIEWER_EXPORT VTKViewer_PolyDataMapper : public MAPPER_SUPERCLASS
{
+public:
+ enum ExtensionsState { ES_None = 0, ES_Error, ES_Ok };
+
public:
static VTKViewer_PolyDataMapper* New();
vtkTypeRevisionMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS );
~VTKViewer_PolyDataMapper();
//! Initializing OpenGL extensions.
- bool InitExtensions();
+ int InitExtensions();
//! Activate Point Sprites.
void InitPointSprites();