Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

angry

glVertexPointer

This topic is 5489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think I read somewhere that the vertex array which you pass to the glVertexPointer function must be static, in means of can''t change their indiviual posititons, is that correct? If so, is it then the only way to render dynamically objects(terrains in my case) using a for loop and make calls to glVertex*?

Share this post


Link to post
Share on other sites
Advertisement
You can modify the contents of the array but you have call glVertexPointer on the array again after you changed it.

Share this post


Link to post
Share on other sites
AFAIK with the standard way of glVertexPointer and glDrawArrays/glDrawElements the buffer does not need to be static as in "cannot change" (maybe they means the c++ static attribute?).

You can simply alter the values in the array (I presume you just have a float vBuffer[terrainWidth*terrainHeight] somewhere) and pass a glVertexPointer(...) to OpenGL each frame. That's what I used to do in my terrain renderer until I decided to use locked vertex buffers (i don't need dynamic terrain).

EDIT: hehe, Dark One beat me to it

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don't post crap!

[edited by - sander on July 7, 2003 5:41:02 PM]

Share this post


Link to post
Share on other sites
Above is right, however what you may be thinking of are Compiled Vertex Arrays, which generally should not change.

[edited by - Mulligan on July 8, 2003 1:25:32 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!