[cairo] Cairo and SDL
Dirk De Becker
Dirk.DeBecker at dzine.be
Fri Mar 19 03:43:57 PDT 2010
I would like to use cairo in combination with SDL (without GTK) in a C++
application. However, I am having problems getting started.
My main problem is, how I can make a cairo buffer that is stored in
At present, I am using an ImageSurface, because it is the only thing I
was able to create:
#define WIDTH 1366
#define HEIGHT 768
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
Display * display = XOpenDisplay(NULL);
Cairo::Refptr<Cairo::ImageSurface> my_buffer =
Cairo::FORMAT_ARGB32, WIDTH, HEIGHT, 4*WIDTH);
I believe I need to use an XlibSurface instead of the ImageSurface, but
I did not find yet how to create this using a SDL window.
Can someone give me a hint on this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 339 bytes
Desc: not available
More information about the cairo