From: C R. <re...@ho...> - 2003-01-23 08:10:55
|
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 :) 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? _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail |