//
void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act)
{
- bool isUseThisMapper = !( this->UseOpenGLMapper ||
- this->PrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere );
+ bool isUseThisMapper = this->PrimitiveType != VISU_OpenGLPointSpriteMapper::GeomSphere;
if( isUseThisMapper )
- if( !this->InitExtensions() )
- return;
+ this->InitExtensions();
if( !isUseThisMapper )
{
int VISU_OpenGLPointSpriteMapper::Draw(vtkRenderer *theRenderer, vtkActor *theActor)
{
- if( this->UseOpenGLMapper ||
- this->PrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere )
+ if( this->PrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere )
return MAPPER_SUPERCLASS::Draw( theRenderer, theActor );
vtkUnsignedCharArray *colors = NULL;
delete aColorFunctor;
}
- GLuint aBufferObjectID = 0;
- vglGenBuffersARB( 1, &aBufferObjectID );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
- vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
-
- delete [] aVertexArr;
-
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
- glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
-
- glDisableClientState( GL_COLOR_ARRAY );
- glDisableClientState( GL_VERTEX_ARRAY );
-
- vglDeleteBuffersARB( 1, &aBufferObjectID );
+ if( this->ExtensionsInitialized ) {
+
+ GLuint aBufferObjectID = 0;
+ vglGenBuffersARB( 1, &aBufferObjectID );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
+ vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
+
+ delete [] aVertexArr;
+
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ vglDeleteBuffersARB( 1, &aBufferObjectID );
+ } else { // there are no initialized extensions
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex),
+ (void*)((GLfloat*)((void*)(aVertexArr)) + 4));
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ delete [] aVertexArr;
+ }
}
input->GetVerts()->GetNumberOfCells() +
input->GetLines()->GetNumberOfCells() +
input->GetPolys()->GetNumberOfCells() +
input->GetStrips()->GetNumberOfCells();
-
-
-
}