Closed cryovat closed 12 years ago
Hi Cryovat,
This seems definitely a bug in the RacketGL binding.
The second parameter of glBufferData should simply be an integer, not a vector, but the binding incorrectly requires a vector.
If you are adventurous, the following should fix it (untested):
Replace in readspec.rkt the line
(cons "GLsizeiptr" (pointer-to '_int32))
by
(cons "GLsizeiptr" '_int32)
and then regenerate the bindings.
Please note that I haven't tested VBOs at all yet, so expect some roughness along the way.
Stephan
On 13-05-12 23:33, cryovat wrote:
Hi,
First of all, thanks for your work on this library!
I've been tinkering with it for some time now, but whenever I try to use vertex buffer objects, I always end up crashing hard when trying to get data into the buffer. I'm using code like the following:
(define verts (make-f32vector 16)) (define verts-size (* (ctype-sizeof _float) (f32vector-length verts))) (define vbo (u32vector-ref (glGenBuffers 1) 0)) (glBindBuffer GL_ARRAY_BUFFER vbo) (glBufferData GL_ARRAY_BUFFER (s32vector verts-size) ; Length of array in bytes (f32vector->cpointer verts) ; Causes crash, #f is fine GL_STATIC_DRAW)
Is the crash caused by errors in my code, or is there any deeper issues at play here?
Reply to this email directly or view it on GitHub: https://github.com/stephanh42/RacketGL/issues/4
I pushed this change (actually with _intptr rather than _int32).
Wow, thank you for the incredibly fast reply and fix. You rock! :-)
Hi,
First of all, thanks for your work on this library!
I've been tinkering with it for some time now, but whenever I try to use vertex buffer objects, I always end up crashing hard when trying to get data into the buffer. I'm using code like the following:
Is the crash caused by errors in my code, or is there any deeper issues at play here?