From: Alberto G. <al...@ti...> - 2003-01-23 11:00:17
|
> I was about to create a set of allegro bindings in python when it occurred > to me that I should check whether it had already been done, first. > > Thank you, you saved me a lot of work :) Great! As you may have noticed, the project is somewhat frozen, so if you are interested in maintaining it, please let me know. > > I had problems getting pyallegro to work in windows. I'm running Windows XP. > I compile in Cygwin. I compile _alpy into a .pyd file (python DLL). I run > Python 2.2.2 in Windows (not cygwin). Allegro is compiled as a DLL for > mingw32, and I create a .a archive for linking using dlltool. When I run > python, I get thus far: > > >>>import alpy > >>>alpy.init_allegro() > > A new window is created, but not displayed (it appears in the taskbar only) > and Python does not accept any more keyboard input. I have to kill python > and the new window at this point. > > The problem, which I have hacked a fix for, seems to be because of the > atexit function. I had to change _alpymodule.c to call > > install_allegro(alpy_system, &errno, NULL); > > instead of > > install_allegro(alpy_system, &errno, atexit); > > Naturally this is a poor solution, since it doesn't call allegro's cleanup > routines on exit. I wonder if the behavior of atexit could be simulated > within DllMain to achieve the right result? Sorry, but I wasn't able to reproduce the problem. Here is my environment: WinME, mingw32 (gcc 2.95.3), Python 2.2.2, latest pyallegro cvs With this environment, everything works fine (apart from a compilation error given by line 4471 - just comment it out or remove the final ';'): this means that I get the invisible window, but I'm still able to interact with the python interpreter correctly. As I have no way of accessing an XP box right now, I can't help you, sorry. Regards, Alberto |