Spin showing spinning quad but not LogoBox

This commit is contained in:
Josh Holtrop 2010-11-25 23:06:52 -05:00
parent e423d46c3e
commit 70e737e78f
3 changed files with 24 additions and 1 deletions

View File

@ -52,6 +52,10 @@ LogoBox::LogoBox()
glPopMatrix(); glPopMatrix();
glEndList(); glEndList();
} }
else
{
cerr << "Error loading dwlogo.obj" << endl;
}
} }
m_drawList = _drawList; m_drawList = _drawList;
m_width = _width; m_width = _width;

View File

@ -49,5 +49,8 @@ int main (int argc, char *argv[])
GnomeScreensaver gs(&argc, &argv, configure, expose, update, 12); GnomeScreensaver gs(&argc, &argv, configure, expose, update, 12);
gs.mainloop(); gs.mainloop();
for (int i = 0; i < sizeof(modes)/sizeof(modes[0]); i++)
delete modes[i];
return 0; return 0;
} }

View File

@ -7,9 +7,21 @@
bool Spin::expose (GnomeScreensaver & gs) bool Spin::expose (GnomeScreensaver & gs)
{ {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix(); glPushMatrix();
glTranslatef(0, 0, -3.0);
glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0); glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0);
m_logobox.draw(); m_logobox.draw();
glBegin(GL_QUADS);
glColor3f(1, 0.6, 0);
glNormal3f(0, 0, 1);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glVertex2f(-1, -1);
glVertex2f(1, 0);
glEnd();
glPopMatrix(); glPopMatrix();
return true; return true;
@ -25,7 +37,11 @@ bool Spin::configure (GnomeScreensaver & gs, int width, int height)
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
gluLookAt(0, 0, 0, 0, 0, 4, 0, 1, 0); // gluLookAt(0, 0, 0, 0, 0, 4, 0, 1, 0);
glShadeModel(GL_SMOOTH);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
return true; return true;
} }