[PyOpenGL-Users] VBO memory not cleaned up ?
Brought to you by:
mcfletch
|
From: Michka P. <mic...@gm...> - 2011-04-24 20:43:29
|
Hello I am trying to use VBO's to display a big colored meshgrid. I have a problem, as I think the buffer is not cleared correctly when I delete it. What I am doing : - Calculate the indexes, vertexes and colors of the meshgrid (on init) - Buffer - Display - On user input (by keyboard), change a parameter (call it "z"), and recalculate a new meshgrid But there seem to be some display bugs, some triangles are not on the right place, and as I go on with new calculations (new "z"), the grid is more and more messed up. I tested with going directly to a new meshgrid (with a fixed parameter "z" on init) , and the meshgrid is displayed without graphical bug. So the bug is not coming from my vertexes array or index array. So : - If I init directly the meshgrid with a specific "z" parameter (for example z=6), no problem - If I go from z=0 to z=6 (by steps of 1), the grid at z=6 is messed up I use the VertexBuffer class from Nathan Ostgard (http://www.siafoo.net/snippet/185), but a little bit modified : For the creation of the buffer : self.buffer = glGenBuffers(1) To delete the buffer : (needed to add int() here, without it there is a TypeError ...) glDeleteBuffers(1, int(self.buffer)) self.buffer = None I checked the deletion of the buffer with glIsBuffer, it says that it is well deleted (Vertexes, color and indexes buffer). So what could be the problem ? Should I post some code to show what I am doing in detail ? Using python 2.7 and opengl 3.0.1 through macports. Thank you in advance ! Michka Popoff |