Originally posted by soda: Well I have lots of display lists (>50) and it is easier and faster to manipulate them giving colors in the declaration (I use only the index)
The glColor is not an expensive operation. Blending is expensive.
You loose more than gain from taking the glColor in the displaylist. You don’t need blending at all.
Originally posted by Csiki:
[b] [quote]Originally posted by soda: Well I have lots of display lists (>50) and it is easier and faster to manipulate them giving colors in the declaration (I use only the index)
The glColor is not an expensive operation. Blending is expensive.
You loose more than gain from taking the glColor in the displaylist. You don’t need blending at all.
Originally posted by soda:
Well if I put colors outside the main display list referenced by index_list_12, I’ll have to call each sublist in my draw method
Correct. What’s wrong with that?
So as I have lots objects, I’ll loose the benefit of calling one DL for each object using its index !
What benefit? If you’re concerned about performance, let me tell you, it really doesn’t matter at all.
At least give it a try. That way you can see for yourself.
DLs are for purely static stuff, that’s inherent to their design. They’re simply not the right tool if you want control/flexibility.
You can still call hundreds of display lists with one glCallLists.
If you really want to, you could build display lists with the single color call and put all IDs in an array send it to glCallLists, which is faster than hundreds of glCallList calls.
It’s probably not different to your hierarchy of display lists.
To change the color, you only need to exchange the indices of the color display lists. But you’re wasting a lot of memory instead of calling glColor in immediate mode.
BTW, the original display list can be optimized by leaving away the glEnd-glBegin between the two lines, hey, it’s GL_LINES after all.