glCallLists()

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

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]);

awesome, works perfect!