Jump to content
  • Advertisement
Sign in to follow this  
LO8

Deleting a shape in opengl

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

Hello, I created a cube and I've made some changes in it. I want to delete the cube and create a new one during the program's run. How can I do it? Is there a function that erases vertexes and deletes the shape? Thanks

Share this post


Link to post
Share on other sites
Advertisement
no.

There is no way to erase vertices after you have rendered them.
I think you misunderstand how frame based real time graphics works.
IF you describe in detail what you want done then i might help you.

Share this post


Link to post
Share on other sites
If your not using any sort of call list and you're keeping the vertices yourself and rendering them with glDrawArray or glDrawElements or even just glVertex calls you can during runtime change those values and see the changes on screen. As for deleting them if your storing the verts say in a pointer you could delete the pointer, have a check that says if this pointer is null then don't draw this cube.

example:
void rendercube()
{
if(pVerts)
{
//some draw code here
}

return;
}

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!