rendered paste bodyvoid onInit() {
//Shading states
glShadeModel(GL_SMOOTH);
//glShadeModel(GL_FLAT);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
//glPolygonMode(GL_FRONT,GL_LINE);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
//Depth states
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
//glDisable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
//Blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
//Set projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f, (float)WIDTH/HEIGHT, 1.0f, 1000.0f);
glViewport(0, 0, WIDTH, HEIGHT);
//Set view matrix
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//float amb[4] = {1.0, 1.0, 1.0, 1.0};
//float spec[4] = {1.0, 1.0, 1.0, 1.0};
//float diff[4] = {1.0, 1.0, 1.0, 1.0};
float amb[4] = {0.5, 0.5, 0.5, 1.0};
float spec[4] = {1.0, 1.0, 1.0, 1.0};
float diff[4] = {1.0, 1.0, 1.0, 1.0};
// glEnable(GL_LIGHTING);
// glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_AMBIENT, amb);
glLightfv(GL_LIGHT0, GL_SPECULAR, spec);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diff);
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, lightDir);
glClearColor(0.9,0.9,0.9,1.0);
//3ds
object = new CModel_3DS("..\\content\\box.3ds");
q = gluNewQuadric();
//Ladda shader
reloadShader();
//Ladda textur
texture1 = new Texture("..\\content\\color_map.png", 6);
texture2 = new Texture("..\\content\\normal_map.png", 6);
texture3 = new Texture("..\\content\\skybox\\craterlake_north.bmp",6);
texture4 = new Texture("..\\content\\skybox\\craterlake_south.bmp",6);
texture5 = new Texture("..\\content\\skybox\\craterlake_west.bmp",6);
texture6 = new Texture("..\\content\\skybox\\craterlake_east.bmp",6);
texture7 = new Texture("..\\content\\skybox\\craterlake_up.bmp",6);
texture8 = new Texture("..\\content\\skybox\\craterlake_down.bmp",6);