Hi,
i really would be happy, if someone could tell me, what i’m making wrong.
Everytime i want to work with lists, my screen stays blank, so i reduced my problem for a single triangle i can rotate. It works fine, when i have the code:
glBegin(GL_TRIANGLES);
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT_AND_BACK,GL_SHININESS,mat_shininess);
glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,mat_diffuse);
glColor3f(1.0,1.0,0.0);
glVertex3f(-5000, -2887, 0);
glVertex3f(5000, -2887, 0);
glVertex3f(0, 5800, 0);
glEnd();
in my display-function.
But when i try to create a list for this object in my init-function like:
LIST_NR_LAND=glGenLists(1);
glNewList(LIST_NR_LAND,GL_COMPILE);
glBegin(GL_TRIANGLES);
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT_AND_BACK,GL_SHININESS,mat_shininess);
glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,mat_diffuse);
glColor3f(1.0,1.0,0.0);
glVertex3f(-5000, -2887, 0);
glVertex3f(5000, -2887, 0);
glVertex3f(0, 5800, 0);
glEnd();
glEndList();
and change the code in my display-function to:
glCallList(LIST_NR_LAND);
nothing happens, i just get a blank-screen.
(LIST_NR_LAND is a global GLuint variable)
If anyone has a clue, why this could happen, please respond. I really changed nothing else in my code and it works fine, when i don’t use a display-list. (But i want to display a fractal-landscape, when i’m finished, so i really need a list)
Bye,
Stefan