Sign in to follow this  

Deleting a shape in opengl

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

This topic is 4019 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this