Commit ace2c6ad authored by Oliver Bock's avatar Oliver Bock

Moved material/color setup to top

parent 2bde7292
......@@ -253,6 +253,19 @@ void PulsarAnimationWidget::paintGL()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// TODO: should be located elsewhere
static GLfloat no_mat[] = {0.0, 0.0, 0.0, 1.0};
static GLfloat mat_diffuse[] = {0.5, 0.5, 0.5, 1.0};
static GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
static GLfloat low_shininess[] = {2.5};
static GLfloat translucent[] = {1.0, 1.0, 1.0, 0.33};
glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
......@@ -284,19 +297,6 @@ void PulsarAnimationWidget::paintGL()
}
glPopMatrix();
// TODO: should be located elsewhere
static GLfloat no_mat[] = {0.0, 0.0, 0.0, 1.0};
static GLfloat mat_diffuse[] = {0.5, 0.5, 0.5, 1.0};
static GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
static GLfloat low_shininess[] = {2.5};
static GLfloat translucent[] = {1.0, 1.0, 1.0, 0.33};
glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
// draw companion
glPushMatrix();
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment