Jump to content
  • Advertisement
Sign in to follow this  
Scribe

Deleting objects

This topic is 4814 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 guys, I was wondering, if i made a quad and binded a texture to it, i know how to delete the texture, but how would i also go about erasing the quad vertex data? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The vertex data (otherwise you are using VBOs) is always in your system RAM, so to delete this kind of data, you should remove the array you used... What are you using tor ender your geometry? glBegin/glEnd? VertexArrays? VBOs?
In the first two cases data are not static into the VRAM, since you have to resend every time everything... in the latter there is a gl API to release a VBO ^^

Share this post


Link to post
Share on other sites
i was using glBegin glEnd. I would rather not send this data each loop, so i'm looking into VBOs but i'm very new at this so i was wondering if you could show me an example of using a vertex array? for drawing quads.

Share this post


Link to post
Share on other sites
before looking at VBOs, i'd look at "normal" vertex-arrays. perhaps they are sufficient for your needs?

something like this would work:

GLfloat vertices[4][2] = {
{ 0.0f, 0.0f },
{ 0.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 0.0f } };

glVertexPointer( 2, GL_FLOAT, 0, (GLvoid*)vertices );
glEnableClientState( GL_VERTEX_ARRAY );
glDrawArrays( GL_QUAD, 0, 4 );
glDisableClientState( GL_VERTEX_ARRAY );

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!