Problem porting a python module that calls SDL on MacOS X

Recently I’ve converted a SDL/OpenGL app with python embedded to a
python library.

It works perfectly under Windows and Linux.
Under MacOS X I get hundreds of NSAutoreleaseNoPool errors when the c
code calls SDL_Init_Video.

The problem, I believe, is that under MacOS X SDL is implemented upon
Cocoa. It expects that I run an application with a main(). But in my
case the main loop is in the python script, which call SDL_Init_Video
and everything else in a function inside the c extension.

Does somebody know a different method, under Darwin and MacOS X, to open
a SDL window from a dynamic library that is not called by a Cocoa
application?

I use distutils to compile. When I import the compiled module inside the
python interpreter I can successfully call other methods, so the module
has been compiled and works for the rest.

Thanks,

c.

Recently I’ve converted a SDL/OpenGL app with python embedded to a
python library.

It works perfectly under Windows and Linux.
Under MacOS X I get hundreds of NSAutoreleaseNoPool errors when the c
code calls SDL_Init_Video.

The problem, I believe, is that under MacOS X SDL is implemented upon
Cocoa. It expects that I run an application with a main(). But in my
case the main loop is in the python script, which call SDL_Init_Video
and everything else in a function inside the c extension.

Does somebody know a different method, under Darwin and MacOS X, to
open a SDL window from a dynamic library that is not called by a Cocoa
application?

I use distutils to compile. When I import the compiled module inside
the python interpreter I can successfully call other methods, so the
module has been compiled and works for the rest.

Look at the pygame source code.

-bobOn Mar 12, 2005, at 13:48, Cesare wrote: