Closed cedlemo closed 9 years ago
Though I haven't executed your script yet (sorry), generally speaking, OpenGL object handles created by `glGenXXXX(nElems, ptrToArray)'
ex.)
glGenVertexArrays(1, vao_buf)
gl_vao = vao_buf.unpack("L")[0] # `[0]' == The 1st element of array.
should be deleted by passing an array of handles like:
glDeleteVertexArrays( 1, [gl_vao].pack('L') )
Line 57 of /GLExcess/texture.rb may be helpful to understand. Thank you.
I didn't understand how it should work sorry. Now it is clear Thank a lot.
You can see the final script here : https://github.com/ruby-gnome2/ruby-gnome2/pull/500
Good. I've just released opengl-bindings 1.4.0. https://rubygems.org/gems/opengl-bindings Now you can safely commit your new sample scripts that use `load_lib'. Thank you.
here is the example:
For the signal "unrealize" of the widget I try to clean all the allocated data (vao and shader program).
The script works well unitl I close the window which trigger the "unrealize" event and the glVertexArrays result in a segfault:
I don't really know how to use
glDeleteVertexArrays
and I haven't found any example in your sample scripts.Regards