Few questions on opengl's vertex arrays

Started by
11 comments, last by dopeflow 20 years, 11 months ago
Oh, nevermind, it was a forum tag error...

Height Map Editor | Eternal Lands | Fast User Directory

[edited by - Raduprv on April 30, 2003 11:58:00 PM]
Advertisement
You put posVB as the "elements" pointer. That''s wrong. That should be a number of indices.

DrawArrays is slow, because you get no vertex cache re-use on modern cards.

LockArrays() does two things:
1) tells the driver how many vertices there will be in the array (i e, what the maximum index value will be) -- very useful for HT&L cards
2) tells the driver that it can cache transformed vertices until you unlock, unless you re-specify arrays with new calls to VertexPointer (very useful for software transform cards doing multipass)

DrawRangeElements does 1), but not 2).

As far as GL is concerned, there is only one logical vertex array, starting wherever you put the VertexPointer (and NormalPointer, and TexCoordPointer, etc). When you re-specify some other base address, that''s now "the" vertex array. Thus, you can have as many as you can malloc(); GL doesn''t care.
quote:
You put posVB as the "elements" pointer. That''s wrong. That should be a number of indices.



so you mean when I do
glVertexPointer(3, GL_FLOAT, 0, posVB);

I shouldnt pass posVB? this doesnt makes sense to me, just looked at msdn and it says that third parameter of glVertexPointer should be a pointer to the first element of my array, which is exactly what im doing.

Unless you mean something else?

This topic is closed to new replies.

Advertisement