Hints and tips for writing a screensaver using xscreensaver? [closed]

狂风中的少年 提交于 2019-12-07 03:14:33

问题


I have been doing some light OpenGL programming for a couple of months and now I want to write a screensaver using the xscreensaver library.

I saw How to develop linux screen saver before asking this but I think that particular question is not specific enough.

What I have done already-

  1. I downloaded the xscreensaver source and read README.hacking. I am fooling around with the code for greynetic.c(one of the screensavers jwz suggested for understanding xscreensaver in the readme) in the source's hacks directory.

  2. I read this webpage - http://www.dis.uniroma1.it/~liberato/screensaver/simplesquares.html (from one of the answers of the linked question). And I downloaded the simplesquares.c code and I'm trying to run it.

What my problem is-

  1. I don't understand how I should go about compiling and executing any changes I make to any of the screensavers.
  2. Compiling the previously mentioned simplesquares.c with gcc and running the executable shows no output at all. Am I doing something wrong?

Note: You have to add -lX11 to the gcc command in order to link the X11 library when compiling simplesquares.c Otherwise it will return undefined reference errors.

Edit:

On compiling the screensaver greynetic.c, it returns a few errors, some of which i have 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 linking error.

来源:https://stackoverflow.com/questions/11686699/hints-and-tips-for-writing-a-screensaver-using-xscreensaver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!