PDA

View Full Version : Display lists and glArrayElement()



ryoko666
10-25-2012, 12:09 PM
I have a display list which has glArrayElement() calls included in it. The problem is that I'm updating the data in the arrays (mostly vertex coords), but the newly updated data doesn't show up when painting the display list. It uses the old values that were present when the display list was created. I'm guessing the display list only fetches the array element values when the list is generated and uses the cached values rather than re-fetching them when the list is executed later. Is there a way around this while still using glArrayElements()?

Alfonse Reinheart
10-25-2012, 12:31 PM
Display lists don't reference vertex data stored elsewhere. They are an exact replica of what you did at the time they were created. This includes the contents of any vertices rendered at the time of creation.

If you want to be able to modify the vertex data, use buffer objects (http://www.opengl.org/wiki/Vertex_Specification#Vertex_Buffer_Object), not a display list.