From 020008b23b3f63994c2dac65e300cc08e0e337f7 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 21 Oct 2005 12:39:11 +0000 Subject: [PATCH] Memory management (method glDeleteBuffersARB is called) --- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 913f0c94..0709a853 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -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 -- 2.39.2