]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Memory management (method glDeleteBuffersARB is called)
authorouv <ouv@opencascade.com>
Fri, 21 Oct 2005 12:39:11 +0000 (12:39 +0000)
committerouv <ouv@opencascade.com>
Fri, 21 Oct 2005 12:39:11 +0000 (12:39 +0000)
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx

index 913f0c94847cb2728169ba39d14f598f1858c534..0709a853a702c869c3941e97ccafcd8ae87d542b 100755 (executable)
@@ -282,7 +282,7 @@ GLhandleARB VISU_OpenGLPointSpriteMapper::InitShader()
   else
     cout << "Loading vertex program... failed" << endl << endl;
   */
-  delete shader;
+  free( shader );
 
   glMatrixMode( GL_MODELVIEW );
   glLoadIdentity();
@@ -447,8 +447,6 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act)
     return;
   }
 
-  //cout << "Using OpenGLPointSpriteMapper" << endl;
-
   vtkIdType numPts;
   vtkPolyData *input= this->GetInput();
 
@@ -800,9 +798,10 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(int idx,
   glPointSize( this->DefaultPointSize );
 
 #ifdef GL_ARB_vertex_buffer_object
-  PFNGLGENBUFFERSARBPROC glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)dlsym( this->OpenGLLibrary, "glGenBuffersARB" );
-  PFNGLBINDBUFFERARBPROC glBindBufferARB = (PFNGLBINDBUFFERARBPROC)dlsym( this->OpenGLLibrary, "glBindBufferARB" );
-  PFNGLBUFFERDATAARBPROC glBufferDataARB = (PFNGLBUFFERDATAARBPROC)dlsym( this->OpenGLLibrary, "glBufferDataARB" );
+  PFNGLGENBUFFERSARBPROC    glGenBuffersARB    = (PFNGLGENBUFFERSARBPROC)dlsym( this->OpenGLLibrary, "glGenBuffersARB" );
+  PFNGLBINDBUFFERARBPROC    glBindBufferARB    = (PFNGLBINDBUFFERARBPROC)dlsym( this->OpenGLLibrary, "glBindBufferARB" );
+  PFNGLBUFFERDATAARBPROC    glBufferDataARB    = (PFNGLBUFFERDATAARBPROC)dlsym( this->OpenGLLibrary, "glBufferDataARB" );
+  PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)dlsym( this->OpenGLLibrary, "glDeleteBuffersARB" );
 
 #ifdef GL_ARB_shader_objects
   PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB =
@@ -879,6 +878,8 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(int idx,
   glDisableClientState(GL_COLOR_ARRAY);
   glDisableClientState(GL_VERTEX_ARRAY);
 
+  glDeleteBuffersARB( 1, &aBufferObjectID );
+
 #ifdef GL_ARB_shader_objects
   glUseProgramObjectARB( 0 );
 #endif