diff --git a/modes/Spin.cc b/modes/Spin.cc index def37f1..f3c08cf 100644 --- a/modes/Spin.cc +++ b/modes/Spin.cc @@ -6,22 +6,27 @@ 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); - glPushMatrix(); + for (int i = 0; i < n_monitors; i++) + { + glViewport(width * i, 0, width, gs.getHeight()); - glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0); - m_logobox.draw(); + glPushMatrix(); - glPopMatrix(); + glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0); + m_logobox.draw(); + + glPopMatrix(); + } return true; } bool Spin::configure (GnomeScreensaver & gs) { - glViewport(0, 0, gs.getWidth(), gs.getHeight()); - glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60.0, gs.getAspectRatio(), 0.01, 1000.0);