glDeleteLists

ok im trying to use the glcalllists() to draw couple of objects, so what im trying to do when ever their is a collision detection between one of the list object and other object to delete the list object, but im not figuring out how the deletelists function work and if there is any simpler way thanks in advance and sorry for my English :eek:

Deletelists works by taking an ID as a parameter. This ID was generated via the call to genlists. There’s nothing much more to say really.

so the deletelists is supposed to delete the object of that list ,but the problem is im trying to use this function but its not working any examples or suggestions please thanks for your time because im trying to take the syntax of the delete list and apply it in my code and nothing is happening :slight_smile:

I’m not sure I’m following you. Deletelists instructs OpenGL to delete the object with that supplied ID. Whether or not the driver actually deletes the object is down to the implementation. It is expected that if you have deleted ID then you won’t be calling ID again in the future.

I get the idea that you believe display list objects directly correspond to objects you see on screen. And therefore deleting it should cause the object on the screen to disappear.

This is not how it works.

A display list is just the instructions needed to render something. Whether it actually gets rendered is up to you. You must render it with a glCallList call. If you don’t call this, then the display list doesn’t get rendered. You can use glCallList multiple times in the same frame. You can change the current matrix between calling glCallList, which will cause the object to be rendered in different places.

The purpose of glDeleteLists is to say, “I’m finished with this display list and will never use it again.” It’s like the standard C “free” or C++'s “delete”. You only call it when you are done with the object forever.

ok ok…i understood what your trying to say, so you mean glDeletelist is dont delete the object from the scene.ok im trying to work on the pacman game and im trying to let the pac eat the object and when it hit the object i want to delete the object from the scene as if the pac ate the object so any idea how to do so… or any method to delete it thanks for your time :slight_smile:

The only way an object appears is for you to draw it. So stop drawing it, and it won’t show up.

how ?

If you are drawing the dots or other objects then you must know how to NOT draw them.
Perhaps you should post your drawing code because you don’t seem to have a handle on it.