I'm developing an application which make use of display lists offered by OpenGL. My idea is to call display lists for a repeatitive tasks, such as tranformations and server state sets. Actually the implementation allow two display lists per renderable object. In these two cases display lists doesn't contains vertices, normals etc., but only matrices and server states.
My problem now is how to decide when generate a display list: it could happen, in some cases, the properties which have generated a display list changes, causing a new compilation of the display list (think a mouse move which rotate an object).
It could be appropriate to generate a display list only when properties are not changed in N rendering loops? How to quantify this N? Should I disable temporarly specific display lists?
Note: the source could be found at Renderable (187:201) and at RenderState (315:356). Sorry for identation (I think it's my VS...) I've notice only right now. :(
OT: how to reformat only identation? :)