.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "OpenGL::XScreenSaver 3pm" .TH OpenGL::XScreenSaver 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" OpenGL::XScreenSaver \- prepare environment for writing OpenGL\-based XScreenSaver hacks .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use OpenGL qw(:all); \& use OpenGL::XScreenSaver; \& \& OpenGL::XScreenSaver::init(); \& # GetOptions(...); # parse your own options, if any \& \& OpenGL::XScreenSaver::start(); \& \& while (1) { \& glClear(...); \& # draw your scene here \& OpenGL::XScreenSaver::update(); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module allows you to write OpenGL XScreenSaver hacks in Perl. It prepares the \s-1GL\s0 to be used with XScreenSaver. .PP Read the synopsis for how your program might look. .SS "Description of functions" .IX Subsection "Description of functions" The \fB\fBinit()\fB\fR function will return a true value if a window to draw on has been found, and a false value if a window will have to be created. This value can be ignored unless you want to make sure that your screenhack cannot be executed outside XScreenSaver (e.g. if your standalone version comes as an extra binary with keyboard control, which would be useless in a screensaver). .PP The \fB\fBstart()\fB\fR function will open the connection to the X server and bind to the window \s-1ID\s0 or create a new window to draw on (depends on if it was called standalone or from XScreenSaver). .PP The \fB\fBupdate()\fB\fR function should be called when you finished rendering the frame. It will flush output and swap the buffers. In the future it might also handle a minimal set of X events when run in standalone mode (like window deletion requests by the window manager). .PP The \fB\fBdimensions()\fB\fR function returns a list with the width and the height of the currently used window. .SS "About screenhacks" .IX Subsection "About screenhacks" What follows is a short description of how it works and what XScreenSaver expects a screenhack to do. .PP XScreenSaver tells the hack on startup what window \s-1ID\s0 the hack shall draw to. This is either a small window mapping to the screen in the preview dialog, or a fullscreen window. The window \s-1ID\s0 is passed either via the \fB\-window\-id\fR option or via the \fB\s-1XSCREENSAVER_WINDOW\s0\fR environment variable. \fB\fBinit()\fB\fR of this module checks both of these. .PP XScreenSaver handles all user input including exiting and pausing the screensaver. The process is sent a \s-1SIGSTOP\s0 when the unlock screen is displayed, obviously a \s-1SIGCONT\s0 when it is dismissed, and when the pointing device is moved or the screen gets unlocked XScreenSaver sends a \s-1SIGTERM.\s0 This means that no event handling is required by your screenhack whatsoever. This again keeps the design of a screenhack dead simple. .SH "SEE ALSO" .IX Header "SEE ALSO" OpenGL .SH "AUTHORS & COPYRIGHTS" .IX Header "AUTHORS & COPYRIGHTS" Made 2010 by Lars Stoltenow. OpenGL::XScreenSaver is free software; you may redistribute it and/or modify it under the same terms as Perl itself.