Sign in to follow this  
LO8

Deleting a shape in opengl

Recommended Posts

LO8    122
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
lc_overlord    436
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
daElfangel    122
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

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