54 lines
1014 B
C++
54 lines
1014 B
C++
|
|
#include <GL/gl.h>
|
|
#include <GL/glu.h>
|
|
|
|
#include "Spin.h"
|
|
|
|
bool Spin::expose (GnomeScreensaver & gs)
|
|
{
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
|
|
glPushMatrix();
|
|
glTranslatef(0, 0, -3.0);
|
|
|
|
glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0);
|
|
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();
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Spin::configure (GnomeScreensaver & gs, int width, int height)
|
|
{
|
|
glViewport(0, 0, width, height);
|
|
|
|
glMatrixMode(GL_PROJECTION);
|
|
glLoadIdentity();
|
|
gluPerspective(60.0, (double)width/(double)height, 0.01, 1000.0);
|
|
|
|
glMatrixMode(GL_MODELVIEW);
|
|
glLoadIdentity();
|
|
// gluLookAt(0, 0, 0, 0, 0, 4, 0, 1, 0);
|
|
|
|
glShadeModel(GL_SMOOTH);
|
|
glEnable(GL_LIGHTING);
|
|
glEnable(GL_LIGHT0);
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Spin::update (GnomeScreensaver & gs)
|
|
{
|
|
return true;
|
|
}
|
|
|