From 5a86af6aac0eebb3153e4f8bf2cc2cf85709d5bc Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 30 Nov 2010 15:23:17 -0500 Subject: [PATCH] Spin mode: every other monitor spins in other direction --- modes/Spin.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modes/Spin.cc b/modes/Spin.cc index 8783289..07d3377 100644 --- a/modes/Spin.cc +++ b/modes/Spin.cc @@ -10,13 +10,14 @@ bool Spin::expose (GnomeScreensaver & gs) int width = gs.getWidth() / n_monitors; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - for (int i = 0; i < n_monitors; i++) + for (int monitor_num = 0; monitor_num < n_monitors; monitor_num++) { - glViewport(width * i, 0, width, gs.getHeight()); + glViewport(width * monitor_num, 0, width, gs.getHeight()); glPushMatrix(); - glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0, 0, 1, 0); + glRotatef(gs.getTicks() / 1000.0 * 360.0 / 4.0 + * (monitor_num & 0x1 ? -1.0 : 1.0), 0, 1, 0); m_logobox.draw(); glPopMatrix();