Files Classes Functions Hierarchy
#include <graphmisc.h>
Public Member Functions | |
| OpenGLinitialisation () | |
| Turns on lighting and depth test. | |
| void | light0Init () |
| Read the light parameters for LIGHT0 into OpenGL. | |
| void | materialInit () |
| Read in the material parameters into OpenGL. | |
Static Public Attributes | |
| static GLfloat | light_ambient [] |
| static GLfloat | light_diffuse [] |
| static GLfloat | light_specular [] |
| static GLfloat | light_position [] |
| static GLfloat | mat_ambient [] |
| static GLfloat | mat_diffuse [] |
| static GLfloat | mat_specular [] |
| static GLfloat | mat_shininess [] |
Definition at line 22 of file graphmisc.h.
| OpenGLinitialisation::OpenGLinitialisation | ( | ) |
Turns on lighting and depth test.
Definition at line 154 of file graphmisc.cpp.
References light0Init(), and materialInit().
00155 { 00156 light0Init(); 00157 materialInit(); 00158 00159 glEnable(GL_LIGHTING); 00160 glEnable(GL_LIGHT0); 00161 glDepthFunc(GL_LESS); 00162 glEnable(GL_DEPTH_TEST); 00163 //glEnable(GL_NORMALIZE); 00164 glEnable(GL_COLOR_MATERIAL); 00165 }
| void OpenGLinitialisation::light0Init | ( | ) |
Read the light parameters for LIGHT0 into OpenGL.
Definition at line 138 of file graphmisc.cpp.
References light_ambient, light_diffuse, light_position, and light_specular.
Referenced by OpenGLinitialisation().
00139 { 00140 glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 00141 glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 00142 glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 00143 glLightfv(GL_LIGHT0, GL_POSITION, light_position); 00144 }
| void OpenGLinitialisation::materialInit | ( | ) |
Read in the material parameters into OpenGL.
Definition at line 146 of file graphmisc.cpp.
References mat_ambient, mat_diffuse, mat_shininess, and mat_specular.
Referenced by OpenGLinitialisation().
00147 { 00148 glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); 00149 glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); 00150 glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); 00151 glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); 00152 }
GLfloat OpenGLinitialisation::light_ambient [static] |
Initial value:
{ 0.0, 0.0, 0.0, 1.0 }
Definition at line 26 of file graphmisc.h.
Referenced by light0Init().
GLfloat OpenGLinitialisation::light_diffuse [static] |
Initial value:
{ 1.0, 1.0, 1.0, 1.0 }
Definition at line 27 of file graphmisc.h.
Referenced by light0Init().
GLfloat OpenGLinitialisation::light_position [static] |
Initial value:
{ 1.0, 1.0, 1.0, 0.0 }
Definition at line 29 of file graphmisc.h.
Referenced by light0Init().
GLfloat OpenGLinitialisation::light_specular [static] |
Initial value:
{ 1.0, 1.0, 1.0, 1.0 }
Definition at line 28 of file graphmisc.h.
Referenced by light0Init().
GLfloat OpenGLinitialisation::mat_ambient [static] |
Initial value:
{ 0.7, 0.7, 0.7, 1.0 }
Definition at line 31 of file graphmisc.h.
Referenced by materialInit().
GLfloat OpenGLinitialisation::mat_diffuse [static] |
Initial value:
{ 0.8, 0.8, 0.8, 1.0 }
Definition at line 32 of file graphmisc.h.
Referenced by materialInit().
GLfloat OpenGLinitialisation::mat_shininess [static] |
GLfloat OpenGLinitialisation::mat_specular [static] |
Initial value:
{ 1.0, 1.0, 1.0, 1.0 }
Definition at line 33 of file graphmisc.h.
Referenced by materialInit().
1.5.8