Breaking Blitzmax

BlitzMax Forums/OpenGL Module/Breaking Blitzmax

PaulJG(Posted 2005) [#1]
Dont know why but this code:
glEnableClientState(GL_VERTEX_ARRAY)	
glGenBuffersARB(1, Varptr(obj_ptr.vert))
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj_ptr.vert)
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sglfloat*Sizeof(obj_ptr.shape_verts), obj_ptr.shape_verts, GL_STATIC_DRAW_ARB)

glGenBuffersARB(1, Varptr(obj_ptr.norm))
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj_ptr.norm)
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sglfloat*Sizeof(obj_ptr.shape_norms), obj_ptr.shape_norms, GL_STATIC_DRAW_ARB)

glGenBuffersARB(1, Varptr(obj_ptr.col))
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj_ptr.col)
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sglfloat*Sizeof(obj_ptr.shape_cols), obj_ptr.shape_cols, GL_STATIC_DRAW_ARB)

glGenBuffersARB(1, Varptr(obj_ptr.tex))
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj_ptr.tex)
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sglfloat*Sizeof(obj_ptr.shape_texs), obj_ptr.shape_texs, GL_STATIC_DRAW_ARB)
glDisableClientState(GL_VERTEX_ARRAY)

glEnableClientState(GL_ELEMENT_VERTEX_ARRAY)
glGenBuffersARB(1, Varptr(obj_ptr.ind))
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj_ptr.ind)
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, sglint*Sizeof(obj_ptr.shape_faces), obj_ptr.shape_faces, GL_STATIC_DRAW_ARB)
glDisableClientState(GL_ELEMENT_VERTEX_ARRAY)

.. breaks the 'bglDrawText' command ???

Although the code compiles and runs fine. If I comment it out I get the text back - otherwise its missing !.

Any ideas please ?


PaulJG(Posted 2005) [#2]
Never mind - sorted it myself.

The glEnableClientState's where breaking it.

Just as a pointer, using the ELEMENT_VERTEX_ARRAY instruction to store the face indexes in, actually slowed down my program by quite a few FPS.