Hi all:
I am trying to use display list to store a set of commands to execute later, but it doesn’t work. The code is like the following:
int LIST_BASE;
int LIST_INDEX;
LIST_BASE = glGenLists(4);
LIST_LENGTH = 0;
glNewList(LIST_BASE+LIST_LENGTH, GL_COMPILE);
glBegin(GL_QUADS);
for (int i = 0; i < length; i++){
glVertex3f(...);
glVertex3f(...);
...
}
glEnd();
glEndList();
LIST_LENGTH++;
Then in another procedure I call the display list like this:
for (int i = 0; i < LIST_LENGTH; i++){
glCallList(LIST_BASE+i);
}
The LIST_BASE = glGenLists(4); always give the LIST_BASE a value 0. Why is this?
Could anybody help me please!!
Thanks very much!!!