// OpenGL Functions setting light, colour, texture etc void Init() { //Clear screen of all colours glClearColor(0,0,0,0); //Depth Test glEnable(GL_DEPTH_TEST); //Shade model glShadeModel(GL_SMOOTH); //Enable lighting glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glLightModelx(GL_LIGHT_MODEL_TWO_SIDE, 0); //Specify different types of light GLfloat Light0Pos[] = {4.0f, 4.0f, 4.0f, 1.0f}; glLightfv(GL_LIGHT0, GL_POSITION, Light0Pos ); GLfloat Light0Amb[] = {0.8f, 0.8f, 0.8f, 1.0f}; glLightfv(GL_LIGHT0, GL_AMBIENT, Light0Amb ); GLfloat Light0Diff[] = {1.0f, 1.0f, 1.0f, 1.0f}; glLightfv(GL_LIGHT0, GL_DIFFUSE, Light0Diff ); GLfloat Light0Spec[] = {1.0f, 1.0f, 1.0f, 1.0f}; glLightfv(GL_LIGHT0, GL_SPECULAR, Light0Spec ); //Set Materials GLfloat MaterialAmb[] = {0.2f, 0.2f, 0.2f, 1.0f}; glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT , MaterialAmb); GLfloat MaterialDif[] = {0.7f, 0.7f, 0.7f, 1.0f}; glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE , MaterialDif); GLfloat MaterialSpec[] = {0.5f, 0.5f, 0.5f, 1.0f}; glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR , MaterialSpec); glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS , 50.0f); sterioObj.Update(); }
void glLightModelxLogged(GLenum pname, GLfixed param) { printf("glLightModelx(%s, %i)\n", GLEnumName(pname), param); glLightModelx(pname, param); }