SDL_WINDOWID equivalent on MacOS X?

Hi,

I’m willing to use a good graphics library to draw a 2D view inside an
application. I’ve been considering SDL (through pygame) but, although
the SDL_WINDOWID trick works under GTK/Linux (and supposedly under
Windows), it is not recognized under MacOS X.

Is there a known way of drawing inside an existing
window/surface/whatever under MacOS X ?
Or, alternatively, is there at least a portable way of retrieving the
raw RGB data from a surface, so I can blit it using another toolkit ?

Regards

Antoine.

The SDL_WINDOWID thing I have no idea. Getting at the RGB data for a
surface is easy though: lock the surface, and then access its pixels
member, then unlock the surface when you’re done. See here:

http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSurface

You can also get at the pixels through pygame with the get_at
functions, or with the surfarray module.

Mike Benfield

Hi,

The SDL_WINDOWID thing I have no idea.

Well, after testing I know that even under Windows (XP) it does not work
properly. Only under Linux/GTK it does :((

Getting at the RGB data for a
surface is easy though: lock the surface, and then access its pixels
member, then unlock the surface when you’re done. See here:

http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSurface

You can also get at the pixels through pygame with the get_at
functions, or with the surfarray module.

Numerous get_at() calls would be too slow in Python. I’ll look into the
surfarray module to know if it lets me get a raw string representation
of the pixels that I could transform into a wx.Bitmap.

Thanks a lot for the answer,

Regards

Antoine.