Display Lists Problem
Alright, I don''t know if anyone else has had this problem before, but I''ll give a try at explaining this.
I have a class in a header file to represent my object. In the constructor I have it perform the following code to program a display list. The variable "Head" is GLuint Head, a member of the class.
Head = glGenLists(1);
GLUquadricObj *obj;
obj = gluNewQuadric();
glNewList(Head,GL_COMPILE);
glColor3f(0.0f,0.0f,1.0f);
gluSphere(obj,1.0f,32,32);
glEndList();
So from there the object Head should be initialized. So, I have a Render() function within the class that will call the list. It only contains the following two lines:
glTranslatef(0.0f,0.0f,-5.0f);
glCallList(Head);
After that render function is called, it doesn''t draw a dang thing. All I see is black, my clear screen color. Has anyone had this problem before? If I separate these into 2 functions and separate them from the class (and have them in main.cpp) then the code works. Any suggestions?
Yikes, sounds like a problem. Make sure your class is getting called every cycle, that could be your problem. (One time I had a similar problem when I was using scissor testing... turns out, after the first time I drew, I forgot to disable the scissor test, so my hud appeared frozen! doh!)
L8r,
The Rainmaker
L8r,
The Rainmaker
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement