[cairo] Lander Game

Alex Mac lots.of.mailing.lists at gmail.com
Tue Jan 9 04:32:58 PST 2007


Thanks for all the emails, I've put a new version up on the website
and I'll try and answer all the points that were raised in one go
here:

As people have mentioned it would be a good idea to cache the static
parts of the background and only update the animating elements, and I
will indeed do that when I actually get around to making this into a
decent game.

Right now the Qt4 branch uses, as behdad pointed out, a QPicture to
cache the background. This works rather like a display list as it is
resolution independant. I would like to try the same out in cairo but
I'm not exactly sure how. I have heard of the "meta-surface" but
apparently it is not publicly accessible in the api?

I have added options to cache the background to both an Image surface
and an Xlib surface using surface_similar(). Although the xlib surface
is a few fps faster than the image surface it causes the game to be
horribly jerky and input events seem to be randomly lost...

I've also changed the Qt4 version so that opengl must be explicitly
enabled so people can test it without OpenGL

(I've also made the given the rocket two thrusters and no
"magic-turning" ability, but thats not too important right now)

With these changes It seems that unaccelerated cairo vs unaccelerated
Qt4 performs pretty much the same (cairo has a 1 fps lead, but this
isn't a very thorough test). However enabling Opengl with the Qt4
branch nearly triples the framerate.

So maybe all this shows is that software rendering is slow and
hardware rendering is fast whatever framework you use :)

Keep the emails coming!
Alex


More information about the cairo mailing list