-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdizzy-xscreensaver
executable file
·62 lines (47 loc) · 1.25 KB
/
dizzy-xscreensaver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use lib 'lib';
use OpenGL qw(:all);
use OpenGL::XScreenSaver 0.04;
use Math::Trig;
use Time::HiRes qw(sleep time);
use Dizzy::Handlers;
use Dizzy::Core;
use Dizzy::GLFeatures;
# parse XSS options
OpenGL::XScreenSaver::init();
# now we can parse the standard options
my %options = Dizzy::Core::init_arguments();
# initialize OpenGL
if (!OpenGL::XScreenSaver::start()) {
print STDERR "dizzy-xscreensaver: XLIB error, dying\n";
exit(1);
}
Dizzy::GLFeatures::update_capabilities();
# initialize dizzy subsystems
Dizzy::Core::init_subsystems(%options);
# main loop
my ($w, $h) = (0, 0);
my ($nw, $nh);
while (1) {
($nw, $nh) = OpenGL::XScreenSaver::dimensions();
if ($nw != $w or $nh != $h) {
($w, $h) = ($nw, $nh);
Dizzy::Render::init_projection($w / $h);
}
Dizzy::Handlers::invoke("render");
OpenGL::XScreenSaver::update();
}
__END__
=head1 NAME
B<dizzy-xscreensaver> - XScreenSaver compliant variant of dizzy
=head1 SYNOPSIS
B<dizzy-xscreensaver> [I<options>]
=head1 DESCRIPTION
For a description of what Dizzy is and what options it takes, refer to the
L<dizzy> manpage.
This program is a version of Dizzy that can be used as a XScreenSaver hack. It
is not designed to be run directly by users.
=cut