How to create a screensaver on linux!

I saw that screensaver on linux with opengl was perfect!
So I want to programe it myself, but I have
no document of it, who can give me some doc
or site!

Thanks!

I cannot really help you there, but you might have a look at xscreensaver sources or docs about it. Just google.

I think you’ll need to catch all events from the X window root so that you first can start if no user action happened during a certain amount of time. But I don’t know how to do that (maybe with getting all events even if outside of your window).
Then, you’ll certainly have to draw to fullscreen and do your job.

So, you’ll need at least, X11 libs, glx and gl.

Hope that helps.

I’ve never actually done it myself
but as far as I know any normal opengl app
capable of running on the root window
(i.e the background) can be used as a screensaver
with xscreensaver all you need to do (I think) is make it terminate on a mouse/keyboard event.

accessing the root window is not necessary. you just have to create a fullscreen window without decorations.

if you are using Xlib, you have to set override_redirect = true in the XSetWindowAttributes struct and add CWOverrideRedirect to the valuemask when you create the window.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.