void DisplayDisc() { Window * window = Window::FindCurrentWindow(windows); if (window->handle == BAD_GL_VALUE) return; glViewport(0, 0, window->size.x, window->size.y); vec4 crimson(0.6f , 0.0f , 0.0f , 1.0f); vec3 ambient = vec3(0.0f , 0.0f , 0.0f); vec3 specular = vec3(0.0f , 0.0f , 0.3f); vec3 diffuse = vec3(0.0f , 0.0f , 0.9f); glClearColor(crimson.r , crimson.g , crimson.b , crimson.a); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); glEnable(GL_DEPTH_TEST); mat4 model_matrix = rotate(mat4() , radians(window->LocalTime() * 30.0f) , vec3(0.0f , 1.0f , 0.0f)); model_matrix = scale(model_matrix , vec3(3.0f , 3.0f , 3.0f)); mat4 view_matrix = lookAt(vec3(0.0f , 0.0f , 8.0f) , vec3(0.0f , 0.0f , 0.0f) , vec3(0.0f , 1.0f , 0.0f)); mat4 projection_matrix = perspective(radians(window->fovy) , window->aspect , window->near_distance , window->far_distance); phong_shader.Use(model_matrix , view_matrix , projection_matrix); phong_shader.SetMaterial(diffuse , specular , 128.0f , ambient); phong_shader.SetLightPosition(vec3(0.0f , 0.0f , 1000.0f)); phong_shader.SelectSubroutine(PhongShader::PHONG_WITH_TEXTURE); phong_shader.EnableTexture(textures[2] , 0); disc3.Draw(false); phong_shader.UnUse(); if (window->draw_normals) { constant_shader.Use(model_matrix , view_matrix , projection_matrix); constant_shader.SetMaterial(diffuse , specular , 32.0f , vec3(1.0f , 1.0f , 1.0f)); disc3.Draw(true); constant_shader.UnUse(); } glutSwapBuffers(); disc3.UpdateValues(TestUpdateDisc , window->LocalTime(), nullptr); }