glVertexPointer(glDrawElement)

BlitzMax Forums/OpenGL Module/glVertexPointer(glDrawElement)

@rtur(Posted 2005) [#1]
Hi ppl
Is there any example about glVertexPointer(glDrawElement) and GLSL in BMax?


Haramanai(Posted 2005) [#2]
go to http://www.opengl.org/documentation/red_book_1.0/

and see for almost anything you wan't about opengl. I can write to you an example but i think it's better to tell you to see the red book.


N(Posted 2005) [#3]
Local vertices:Float[] =
     [-1.0#, -1.0#, 0.0#,..
      1.0#, -1.0#, 0.0#,..
      0.0#, 1.0#, 0.0#]

Local indices:Short[] = [0:Short, 1:Short, 2:Short]

glEnableClientState(GL_VERTEX_ARRAY)
glVertexPointer(3, GL_FLOAT, 0, Varptr vertices[0])
glDrawElements(GL_TRIANGLES, indices.Length, GL_UNSIGNED_SHORT, Varptr indices[0])


I believe that should work.


@rtur(Posted 2005) [#4]
Thanks!