I guess I’m too dumb…
… to figure out how to use Xrender. People writing Xrender itself obviously know how it works and how to use its API. Also the people behind cairo, glitz, compiz, Qt & Co don’t seem to have a problem with just reading a spec (that’s all which is available documentation-wise) and start implementing their drawing functions based on Xrender. I’m certainly not that smart. I’m not being ironic here. It’s just that I’m currently deeply frustrated! For the last two days I tried to figure out (or better: guess) how to make use of Xrender API-calls (mainly grep’ing around in /usr/include/X11/extensions/Xrender.h). It’s such a drag, when you mainly want to focus on writing your application. But I could not even output a simple blue triangle in a window using XRender-calls… let alone start using Xrender’s filter-functionality to blur a surface-buffer from cairo. I’m interested in this for adding blurred shadows in cairo-clock and the cairo-API - at the moment - still lacks direct support for convolution-filter operations. On the other hand doing the same with OpenGL/GLSL is a easy. I could say… “Well, screw any box that does not have OpenGL/GLSL.”, but such an attitude is complete arse and would severely limit the possible user-base.
I’ve googled sites up and down, searched the mailing-list archives at lists.freedesktop.org, tried to leverage any code-snippets I could extract from found articles and even did my best to get a grip of things by looking at code of gnome-window-decorator (from compiz) and cairo (xlib-backend). But all those steps got me further and further away from the actual problem at hand… writing code for the new cairo-clock. This quickly lead to me being totally demotivated to write any line of code at all. What makes it even worse is the fact that my spare-time is burnt by this with no results at the end.
Sorry, if this sounds like ranting or bashing. It’s not intended as such. It’s just sad that development-documentation in 2006 is still such a sore spot with certain paramount parts of the OpenSource graphics-stack. A “nasty” side-effect is that I’m extremely tempted to switch to Qt. Documentation- and example-code-wise this Qt is pure heaven and as long as I’m sticking to writing OpenSource-code the licence is ok too.
I feel very uneasy atm :/
EDIT: In case anybody wonders what I’m trying… he’s my simple test to get anything drawn using Xrender.
August 24th, 2006 at 12:16 am
awwe, macslow you’re not dumb, you’re just a little slow, bit like my mac ;P
I think examples and documentation is what you need, surely theres something out there. Unfortunately all I can offer is moral support…
wh000p go macslow!
August 24th, 2006 at 12:30 am
Did you already try that:
http://ktown.kde.org/~fredrik/composite_howto.html
August 24th, 2006 at 2:07 am
@ Karl: Obviously only I need this kind of docs and nobody else.
@ Daniel: I’ve read through it, but it didn’t help me understand how do do drawing simple shapes using Xrender.
August 24th, 2006 at 3:03 am
have you tried using the glitz convolution and guassian filters?
also no docs though - I had a go at this and it failed miserably..
I must get around to posting a question on the cairo list…
Greg.
August 24th, 2006 at 4:56 am
This is a constant frustration for me. Time spent up front to make things easy and clear would save the masses a ton of wasted effort. I\’ve been programming for a long time and have wanted to contribute to a few projects but the learning curve is steep. I don\’t want to have to reverse engineer an API. I just want to use it. Just a bit of explanation at the top of a file explaning it\’s basic purpose would go a long way toward helping figure out how things are working together. I don\’t want to be all negative. It\’s gotten a LOT better and I\’m actually working on a PyGtk app as a chance to improve my Python and learn gtk.
August 24th, 2006 at 6:51 am
interesting… trying your test program crashes my X server instantly
August 24th, 2006 at 9:05 am
The triangles path has been almost entirely untested until a few months ago, when we realized that the X Server crashed when you tried to render them, and I got that fixed to make it not crash. I wouldn\’t try to guarantee anything more than that about Render triangles. Do rectangles or trapezoids.
August 24th, 2006 at 10:55 am
MacSlow, did you try visiting channel #xorg-devel and #freedesktop on irc.freenode.net ?
It would be frustrating nobody could give you the little help you need…
Have a good day
August 24th, 2006 at 12:36 pm
@ greg: No. I know that glitz offers something like this, but it is as non-documented as Xrender… even worse.
@ Patrick: I wish the Novell’s, RedHat’s & Co. would pay the maintainers of the projects they employ, at least 25% of their time to write and update the documentation and provide simple example code showing how stuff in intended to be used.
@ sxpert: Hm… I’ve no clue, sorry.
@ Eric: Oh great… this is typical for my "kind of luck"
Not only do I have to tinker with not-so-well-documented stuff… I also tap into the untested/unstable code-paths of those very things. But still thanks for this important hint. Is the other stuff I do in my little Xrender-test program more or less ok?
@ soliste: I’ll try.
August 25th, 2006 at 12:45 am
about Qt temptation…
I’m just starting to hack some code after some long time of playing with it…
I’ve tested and seen code of Enlightenment/gtk/Qt and I’ve selected Qt/KDE.
It’s really cool to have a lot of working examples and cool documentation at hand (especially when you are starting as I am :).
I guess that sometimes (like this one) it’s good to have a Company/Organization that does the _dirty_ work.
It is very common to find guys who want to code and hack as we do… but it isn’t common to find people who want to doc their (or sometimes already written by others) API’s.
I believe that Trolltech have done an excellent work with their product.
Don’t feel bad about being tempted by it; just do what you’ll enjoy more and what will make you more productive and happy.
best regards…
Javier "Nomsio" Jaramillo
August 31st, 2006 at 5:03 am
Hi!
That reminds me of how i spent much of my spare time from January to May.
Though it was on a totally different field: Trying to find a working example of signed javascript + how to for Firefox.
And trying to do some things with XPCom from Firefox, like writing to disk and reading from it, and some more.
I wonder how all the good extensions were written: Don’t these programmers need any documentation?
Ok, they are maybe used to certain schemes of programming, and may be able to find out fast by trial and error.
But *one working* example, and I might learn it too!
Reminds me of the TurboPascal-7.0 Help. In the end I was able to program object-oriented, just by reading the help and the examples.
Good luck for project!
Dieter
October 20th, 2006 at 4:19 am
Go for QT/Trolltech its pure heaven…. not hackish at all, very professional.
And after all, QT apps runs nice under Gnome aswell as kde.
Rgs
Egil