From: ouv Date: Fri, 21 Oct 2005 12:39:11 +0000 (+0000) Subject: Memory management (method glDeleteBuffersARB is called) X-Git-Tag: TG-D5-38-2003_D2005-20-12~128 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=020008b23b3f63994c2dac65e300cc08e0e337f7;p=modules%2Fvisu.git Memory management (method glDeleteBuffersARB is called) --- 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