[cairo] SDL and cairo code base

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 29 04:49:57 PST 2009


On Thu, 2009-01-29 at 12:42 +0100, flying.toaster wrote:
> For my first post here comes a newbie question. 
> I have checked the current status of the GIT repository and found references to the cairo-sdl interface dating back to october 2008. I have also checked the tutorial for using cairo with SDL, particularly the cairo clock code, and it uses this interface. 
> 
>  Despite all this, the code apparently didn't make it to the latest release (1.8.6) that is dated after the commit of the SDL code.  With the obvious consequence that the cairo clock SDL sample won't compile. Is this on purpose and is there a plan to include the SDL interface in a further release ?

This is my fault, someone once asked how to use SDL with cairo on IRC
and I saw the example on our website and was ashamed. Hence I wrote a
backend so that one could cleanly integrate cairo and SDL, and updated
the tutorial without thinking about availability for the end-user. As
far as the backend goes, it could benefit from a knowledgeable review of
whether the mixing of premultiplied surfaces is correct and whether we
can use any acceleration exposed by SDL.

However, the current status of that backend is experimental which is why
it was not backported to the stable series and is likely to remain an
optional backend (hence unlikely to be included with distributions) to
avoid incurring one more, rarely used, library dependency. There is a
general plan that we should support dynamical backends, but nobody has
started working on that yet. So for the forseeable future you will need
to compile your own cairo if you want to integrate SDL.

Sadly, I think the best course of action is to write a simple routine to
return an image surface for an SDL surface and add that to the wiki as
an interim measure. (For an example look at cairo-sdl-surface.c ;-)
-ickle



More information about the cairo mailing list