Advertisement

Deleting a shape in opengl

Started by December 14, 2006 05:20 AM
2 comments, last by AerosolBeard 17 years, 11 months ago
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
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.
Advertisement
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;
}
Just skip the cube's draw calls if you don't want it to display.

EDIT: beaten to it

This topic is closed to new replies.

Advertisement