Jump to content
  • Advertisement
Sign in to follow this  
n9ine

OpenGL Writing Vertex Buffer into a file (At Run Time)

This topic is 3628 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

Hi all; I want Write Vertex Buffer and Index Buffer (from OpenGl buffers) into a file At Run Time (at key event). How this can be done and what functions in opengl can provide me access to opengl buffers (at run time). Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
One simple way of doing this is by mapping the buffer.
The pointer you get back can be read as every other memory location could be read, too (supposed you provide GL_READ_ONLY or GL_READ_WRITE). You should be able to simply pass it to fwrite, too.
It works the same for either vertex or índex buffer, no difference.

Note that reading back is something you normally don't want to do unless you absolutely have to, for performance reasons.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!