50 lines
823 B
C++
50 lines
823 B
C++
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <math.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
|
|
#include <GL/gl.h>
|
|
#include <GL/glu.h>
|
|
|
|
#include "Tunnel.h"
|
|
|
|
Tunnel::Tunnel()
|
|
{
|
|
m_last_ticks = 0;
|
|
srand(time(NULL) + getpid());
|
|
}
|
|
|
|
Tunnel::~Tunnel()
|
|
{
|
|
}
|
|
|
|
bool Tunnel::expose (GnomeScreensaver & gs)
|
|
{
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Tunnel::configure (GnomeScreensaver & gs)
|
|
{
|
|
glMatrixMode(GL_PROJECTION);
|
|
glLoadIdentity();
|
|
gluPerspective(60.0, gs.getAspectRatio() / gs.getNumMonitors(),
|
|
0.01, 1000.0);
|
|
|
|
glMatrixMode(GL_MODELVIEW);
|
|
glLoadIdentity();
|
|
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
|
|
|
|
glViewport(0, 0, gs.getWidth(), gs.getHeight());
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Tunnel::update (GnomeScreensaver & gs)
|
|
{
|
|
return true;
|
|
}
|