PDA

View Full Version : Should Display Lists include function calls?



virtualchetan
10-06-2003, 07:14 AM
Hi,

My perception is: We use display lists for faster rendering of fairly static models.Even with no 'physically' remote rendering, its useful to free CPU and give the work to the grphics card.

Now, if I have 'renderBody' function which calls some other functions like 'renderHead','renderLeg', etc.
Will use of Dislay lists help?

i.e.

renderHead()
{
......
}

renderLeg()
{
.........
}

renderBody()
{
glNewList(..)
.........
renderHead();
renderLeg();
............
glEndList();
}


My concern is, even after the list is compiled and getting executed remotely, it will do function calls back to the local machine/CPU


- Chetan

SeskaPeel
10-06-2003, 07:29 AM
When you compile first your list, all your functions gets called, and all valid gl function calls get compiled in your display list.

So, no, your functions will not be called except the very first time you compile the list.

SeskaPeel.

virtualchetan
10-06-2003, 12:18 PM
Originally posted by SeskaPeel:
So, no, your functions will not be called except the very first time you compile the list.
SeskaPeel.

Thanks Seska, I believe the above is true as long as I am not callling ne non-gl api/functions, i.e. if the function calls read a device everytime - they should not be there in the display list, right?

- Chetan

rgpc
10-06-2003, 07:11 PM
Just think of it as Opengl is completely unaware that you are running any code other than the gl calls. Opengl couldn't care less whether you call multiple functions within your code, format hard disks, alter the volume or make coffee. It only cares about the gl specific calls that you make between the glNewList() and glEndList(), and it doesn't care how you call them.