[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Cairo + SDL



I'm pretty sure pycairo and pygame are already interoperable:
http://www.pjblog.net/index.php?post/2006/06/23/144-using-pycairo-with-pygame-surface

I think you may also be able to do something like this to do pretty much exactly what that page you linked to does:
--------------
width = 100
height = 100
pygame_surf = pygame.Surface((width, height), 0, 32, (0xff0000, 0x00ff00, 0x0000ff, 0))

data = "">stride = pygame_surf.get_pitch()
cairo_surf = cairo.ImageSurface.create_for_data(data, cairo.FORMAT_RGB24, width, height, stride)

-----

... but I haven't tested it


On Sat, May 2, 2009 at 10:16 AM, Chris McCormick <chris@xxxxxxxxxxxx> wrote:
Hi all,

Recently there was some talk of doing vector graphics in Pygame. Since this is
a subject that is dear to me, I thought I'd ask how hard it would be to
incorporate something like this into Pygame:

<http://cairographics.org/SDL/>

I realise this probably implies a large amount of work, but I just thought I'd
throw it on to the collective heads-up-display. Would be pretty wonderful to be
able to use Cairo's rendering capabilities from inside Pygame! :)

Best,

Chris.

-------------------
http://mccormick.cx