Tips and tricks for writing screensaver using xscreensaver?

I have been doing easy OpenGL programming for several months, and now I want to write a screensaver using the xscreensaver library.

I saw How to develop a linux screen saver before asking about it, but I think this specific question is not specific enough.

What I have already done -

  • I downloaded the xscreensaver source and read README.hacking. I am cheating with the code for greynetic.c (one of the jwz intruders suggested for understanding xscreensaver in readme) in the source hacks directory.

  • I read this web page - http://www.dis.uniroma1.it/~liberato/screensaver/simplesquares.html (from one of the answers of a related question). And I downloaded the simplesquares.c code, and I'm trying to run it.

What is my problem -

  • I do not understand how I should collect and implement any changes that I make for any of the screensavers.
  • Compiling the previously mentioned simplesquares.c with gcc and running the executable does not produce any results at all. Am I doing something wrong?

Note You must add -lX11 to the gcc command to link the X11 library when compiling simplesquares.c otherwise it will return undefined support errors.

Edit

When compiling the greynetic.c screensaver, it returns several errors, some of which I reproduced here:

greynetic.c:(.text+0x4f): undefined reference to `XGetWindowAttributes' greynetic.c:(.text+0xa6): undefined reference to `get_boolean_resource' greynetic.c:(.text+0xd9): undefined reference to `get_pixel_resource' greynetic.c:(.text+0x112): undefined reference to `get_pixel_resource' greynetic.c:(.text+0x13e): undefined reference to `get_integer_resource' greynetic.c:(.text+0x185): undefined reference to `XCreateGC' greynetic.c:(.text+0x1dd): undefined reference to `XCreatePixmapFromBitmapData' 

This is probably a communication error.

+6
source share

Source: https://habr.com/ru/post/921479/


All Articles