Original Post
Hi, first post. Sorry if this is a topic that appears day in, day out but i couldnt see anything about it in the first few pages. I've tried implimenting lesson 6 (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06) into some existing code i have, but the structure is so different in my code and the code used in the example that it doesnt seem to work. I've put in error checking to ensure the image loads and used the default image to minimise problems but still no dice...i think its my draw function thats the problem. With that in mind.... void DrawScene() { int i=0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer glLoadIdentity();// load Identity Matrix glPushMatrix(); //set camera looking down the -z axis, 10 units away from the center gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0); //Where we are, What we look at, and which way is up glPushMatrix(); glRotated(rot, 1 ,0 ,0); glRotatef(rot, 0 ,1 ,0); glLightfv(GL_LIGHT1, GL_AMBIENT, Light_Ambient); glLightfv(GL_LIGHT1, GL_DIFFUSE, Light_Diffuse); glLightfv(GL_LIGHT1, GL_POSITION, Light_Position); glLightfv(GL_LIGHT1, GL_SPECULAR, Light_Specular); glEnable(GL_LIGHT1); glPopMatrix(); glBegin (GL_QUADS); //glMaterialfv(GL_FRONT,GL_EMISSION,mat_emission); //emit blue //front face glNormal3f(0, 0, 1); glVertex3f( -1.0, 1.0, 1.0); glNormal3f(0, 0, 1); glVertex3f( 1.0, 1.0, 1.0); glNormal3f(0, 0, 1); glVertex3f( 1.0, -1.0, 1.0); glNormal3f(0, 0, 1); glVertex3f(-1.0, -1.0, 1.0); //back face glNormal3f(0, 0, -1); glVertex3f( -1.0, 1.0, -1.0); glNormal3f(0, 0, -1); glVertex3f( 1.0, 1.0, -1.0); glNormal3f(0, 0, -1); glVertex3f( 1.0, -1.0, -1.0); glNormal3f(0, 0, -1); glVertex3f(-1.0, -1.0, -1.0); //left face glNormal3f(-1, 0, 0); glVertex3f(-1.0, 1.0, 1.0); glNormal3f(-1, 0, 0); glVertex3f(-1.0, -1.0, 1.0); glNormal3f(-1, 0, 0); glVertex3f( -1.0, -1.0, -1.0); glNormal3f(-1, 0, 0); glVertex3f( -1.0, 1.0, -1.0); //right face glNormal3f(1, 0, 0); glVertex3f(1.0, 1.0, 1.0); glNormal3f(1, 0, 0); glVertex3f(1.0, -1.0, 1.0); glNormal3f(1, 0, 0); glVertex3f(1.0, -1.0, -1.0); glNormal3f(1, 0, 0); glVertex3f(1.0, 1.0, -1.0); //top glNormal3f(0, 1, 0); glVertex3f(-1.0, 1.0, 1.0); glNormal3f(0, 1, 0); glVertex3f(1.0, 1.0, 1.0); glNormal3f(0, 1, 0); glVertex3f(1.0, 1.0, -1.0); glNormal3f(0, 1, 0); glVertex3f(-1.0, 1.0, -1.0); //bottom glNormal3f(0, -1, 0); glVertex3f(-1.0, -1.0, 1.0); glNormal3f(0, -1, 0); glVertex3f(1.0, -1.0, 1.0); glNormal3f(0, -1, 0); glVertex3f(1.0, -1.0, -1.0); glNormal3f(0, -1, 0); glVertex3f(-1.0, -1.0, -1.0); glEnd();//end drawing glPopMatrix(); rot+=0.25; SwapBuffers(ghdc);// Swap the frame buffers. glFlush(); } NB the origonal code had a box with light rotating around it...there were other primatives in there but they were removed 'just in case'...also they made the code snip even longer