PDA

View Full Version : glCallLists()



David Doria
03-04-2008, 02:38 PM
I am trying to use glCallLists(), but having some issues.

I tried to make a demo to create 2 lists.

GLuint list = glGenLists(2);
glNewList(list,GL_COMPILE);
//add stuff to first list
glEndList();

glNewList(list+1,GL_COMPILE);
//add stuff to second list
glEndList();

//this works fine:
glCallList(list);
glCallList(list+1);

//this doesn't work
glCallLists(2,GL_UNSIGNED_INT, list);


I also tried this with no success:
glCallLists(2,GL_UNSIGNED_INT, glListBase(list));

Where am I going wrong?

Thanks!

Dave

-NiCo-
03-04-2008, 03:21 PM
The third parameter to glCallLists should be an array of offsets to the listbase you provide with the glListBase call.

Try:
GLuint offsets[] = {0,1};
glListBase(list);
glCallLists(2,GL_UNSIGNED_INT,&offsets[0]);

David Doria
03-05-2008, 07:31 AM
awesome, works perfect!