PDA

View Full Version : Will the memory be free after executing glDeleteLists()



shengj
03-31-2003, 09:42 AM
Currently, I'm writing codes using OpenGL to render 2D and 3D models of ocean currents, temperature, salinity and so on. Since a number of numerical data involved in these models, it is hard and unreasonable to increase machine memory continuely to execute and/or improve the effects of rendering. Therefore, I'm considering to use glDeleteLists() command following glCallList() immediately to release the space. Unfortunately, it doesn't work well. Are there any other ways to carry out implementation without increasing machine memory?

jwatte
03-31-2003, 09:54 AM
Why are you creating a display list of you only want to call it once and then delete it?

shengj
03-31-2003, 11:44 AM
Originally posted by jwatte:
Why are you creating a display list of you only want to call it once and then delete it?

Dear Jwatte,

Actually, I'm frequently using this list that identifies the same attributes. For instance, there are 10 diferent levels in ocean depth. Each level has its own ocean currents (defined by velocity), sea water temperature and salinity as well. There are 30 time steps at each level with respect to the changes of velocity, temperature and salinity. Therefore, I'm creating a show list starting from index0 to index29, for example, at level 0 (surface of ocean). After executing glCallList(), the gl DeleteLists() function is executed immediately for the purpose of next use of this list in order not to increase the memory occupied.
However, I find glDeleteLists() is working without increasing memory occupied significantly. But there are still about 34MBytes memory occupied after rendering each level. I don't know what the reason is. Are there any other good way to do this job? Any comments will highly be appreciated!

Relic
03-31-2003, 09:00 PM
You are not frequently using the list if you calling glDeleteLists immediately after you have rendered it (once?). Deletion and especially rebuilding the new list takes some time.
If you want complete control about the memory allocations in your program you shouldn't use display lists. You can't control the OpenGL implementation's memory handling.
If you're concerned about memory consumption, render geometry data using vertex arrays instead and reuse them for the different levels.

shengj
04-01-2003, 11:23 AM
Originally posted by Relic:
You are not frequently using the list if you calling glDeleteLists immediately after you have rendered it (once?). Deletion and especially rebuilding the new list takes some time.
If you want complete control about the memory allocations in your program you shouldn't use display lists. You can't control the OpenGL implementation's memory handling.
If you're concerned about memory consumption, render geometry data using vertex arrays instead and reuse them for the different levels.

Thank you very much! It works well without building gl_List.