I’m working on an OpenGL program using C and I was wanting to implement a display list to make a collection of shapes, however it wasn’t displaying. I then changed this so that the display list called glutSolidCube(2) (and yes, glut.h is included) and this doesn’t work either. I was wondering if someone could hint to me what I am doing wrong?
This is my global variable
GLuint propellerDL = glGenLists(1);
This is in my init() method, which seems to work fine. It’s called only once at the start of the program.
glNewList(propellerDL, GL_COMPILE); //propeller(); glPushMatrix(); glutSolidCube(2); glPopMatrix(); glEndList();
This is the code in my display method, which runs every frame.
glPushMatrix(); glRotatef(angle, 0, 0, 1); glCallList(propellerDL); glPopMatrix();
This doesn’t seem to display anything, which is frustrating because both propeller(); and glutSolidCube(2); both work fine on their own, it’s just when trying to get them onto a display list that it’s failing somewhere.
If it’s relevant, I’m working on Windows 7, using Visual Studio 2008.
Thanks very much for any advice