PS : Please don't link me to a tutorial page with C++ code

IMHO that's not always the truth. Sometime displaylists win, sometimes vertexarrays are faster. I think it depends on what you're trying to do.Polo wrote:I hear the Vertex Arrays were a lot much faster[...]
No tutorial? Fine...PS : Please don't link me to a tutorial page with C++ code
Code: Select all
Dim vertices.f(23)
Dim indices.b(23)
Restore vertices
For i=0 To 23
Read vertex.f
vertices(i) = vertex
Next
Restore indices
For i=0 To 23
Read index.b
indices(i) = index
Next
DataSection
vertices:
Data.f -1.0, 1.0, 1.0
Data.f 1.0, 1.0, 1.0
Data.f 1.0, -1.0, 1.0
Data.f -1.0, -1.0, 1.0
Data.f -1.0, 1.0, -1.0
Data.f 1.0, 1.0, -1.0
Data.f 1.0, -1.0, -1.0
Data.f -1.0, -1.0, -1.0
indices:
Data.b 0, 1, 2, 3
Data.b 4, 5, 1, 0
Data.b 3, 2, 6, 7
Data.b 5, 4, 7, 6
Data.b 1, 5, 6, 2
Data.b 4, 0, 3, 7
EndDataSection
Code: Select all
glEnableClientState_(#GL_VERTEX_ARRAY)
glVertexPointer_(3, #GL_FLOAT, 0, vertices())
glDrawElements_(#GL_QUADS, 24, #GL_UNSIGNED_BYTE, indices())
They are defined in the opengl include.What values are #GL_VERTEX_ARRAY, #GL_FLOAT, #GL_QUADS, #GL_UNSIGNED_BYTE ?
Well, just take your favourite searchengine. There are a lot of tutorials on this.And is there a tutorial for beginners explaining vertices and indices? Or life, the universe and everything?
Well, perhaps not like that, but you see what I mean ?memaddress.l = AllocateMemory(0, 100, 0)
PokeF(memaddress, 125.23)
PokeF(memaddress+4, 125.23)
PokeF(memaddress+8, 125.23)
[...]
;and....
glVertexPointer_(3, #GL_FLOAT, 0, memaddress.l)