Spin: spin a logo on each monitor
This commit is contained in:
parent
15dc4f8d75
commit
27e302f126
@ -6,22 +6,27 @@
|
|||||||
|
|
||||||
bool Spin::expose (GnomeScreensaver & gs)
|
bool Spin::expose (GnomeScreensaver & gs)
|
||||||
{
|
{
|
||||||
|
int n_monitors = gs.getNumMonitors();
|
||||||
|
int width = gs.getWidth() / n_monitors;
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
for (int i = 0; i < n_monitors; i++)
|
||||||
|
{
|
||||||
|
glViewport(width * i, 0, width, gs.getHeight());
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Spin::configure (GnomeScreensaver & gs)
|
bool Spin::configure (GnomeScreensaver & gs)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, gs.getWidth(), gs.getHeight());
|
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPerspective(60.0, gs.getAspectRatio(), 0.01, 1000.0);
|
gluPerspective(60.0, gs.getAspectRatio(), 0.01, 1000.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user