I have several questions about the Display Lists in OpenGL SC 1.0.1:
if I understand well, a display list saves a sequence of OpenGL primitives commands, to be reused after at runtime. Now, let's say that I also include in this Display List an assignment that changes the value of a parameter that was declared out of the static sequence. -> Would this parameter be updated, during the generation of the Display List, or when this Display List will be called at runtime ?
I use to generate all my Display Lists at initialization of the OpenGL context only. But, in my application, for several reasons, I do glClear at each cycle at runtime. -> After a glClear command, do you think that all my Display Lists are deleted ? Because, by doing so, I notice that my graphical components that are generated through Display Lists are never drawn.
Display lists are created once, at exactly the point when you call glNewList. That list is then repeated verbatim when you call glCallList. I'm not sure what you mean by parameter exactly, but if you mean:
a) a C++ variable, then this will have no effect. The OpenGL calls in a display list are recorded as is. What loop variables etc used to get to that call are not recorded. b) an OpenGL state variable (for example, a call to enable GL_LIGHTING). This will be recorded (since the display list will capture the call to glEnable).
glClear has no effect on display lists. glClear simply clears the back buffer to black (or colour you set via glClearColor). Obviously once you've cleared all the pixel data, you'll need to redraw it again, so you'll need to set the projection matrix, set the correct transform matrix for your geometry in the display list, and call glCallList again to repeat the list of actions within that list.
Having said all of that, I'd strongly advise steering well clear of display lists, and move to something nicer (e.g. VBO + VAO + GLSL Shaders, or VBO + Fixed Function Pipeline). Display lists have a large number of problems, including: