Original Post
Can anyone please help me a fix for this? When I use basic lighting and enable it. From what I can tell if I translate to like -1.5 the program will still work. The object doesn''t get drawn behind the user either. It''s like it doesn''t like to be drawn too close to the user. The object is retangle shape and by moving slowly back more and more the object will rotate farther and farther before it crashes, and all the time the object is in viewing distance to see the whole thing. When I get to like -1.5 it works fine too.
I want to be able to have the object come twards the user.
Here''s my actually code that crashes and if I comment out the glEnable(GL_LIGHTING) it works fine.
glPushMatrix();
glLoadIdentity();
glEnable(GL_LIGHTING); // Enabling this will crash program
// memory cannot be "read" it says
glTranslatef(0.0f,0.0f,-1.0f);
glRotatef(rot1++,0.0f,1.0f,0.0f);
glRotatef(rot2++,1.0f,0.0f,0.0f);
glCallList(m_listObject);
glPopMatrix();
Thats the best I can describe it, can anyone help/had this problem?
Here is how I am enabling lighting.
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
Thanks,
Jim