Re: [PythonCE] pygame / distutils
Hi, Rene. Thanks for the clarification on pygame-ctypes. The link where I found the SCUMMVM SDL libraries is here: http://users.uoa.gr/~knakos/scummvm/libraries/release-0-10-0/wince-gcc-libs.tar.bz2 There are a number of files in there, including a .diff file which may shed some light on some of the difficulties in compiling the SDL libraries. The SDL version used is 1.2.6. I believe the latest one is 1.2.13, but I think this should not be a big issue to update later. As far as my progress goes, I have got a small pythonCE script running, which draws some coloured squares to the screen (kind of like one of the slide transition effects in powerpoint). The busy indicator no longer interferes with the display :D Now, I am working on a bit of code to allow user input. I am adapting the code to allow key presses of the PDA's hardware function keys to be detected. I would like this to be a small module that can be used in PythonCE to get the scancode from any key press (from the SIP or the hardware keys). I know that SDL provides this, but I am not sure if it will allow the hardware keys to be detected. From what I understand, there is some extra work in writing a PYD module, in contrast to writing a DLL that is called with ctypes. I have not looked into this in great detail yet, but ultimately, I would like to get some DLLs written in the correct form so they can be used as PYDs. I guess there are some basic rules for Python to 'talk' with its package modules. Anyhow, your plan sounds good, so if there's any way I can help just let me know. Adam On 15/08/2008, René Dudfield [EMAIL PROTECTED] wrote: What is the best way to compile extensions for python CE ? Adam: do you have a link to those SCUMVM files? Any further progress? Why not pygame-ctypes? It was slow, buggy, and non-portable - and C pygame worked fine. The author was paid to do it, and stopped when the money ran out and moved on to pyglet. pygame has a bunch of C code which just can't run fast enough in python. Pygame is not just a SDL wrapper, it's got a bunch of other code in it too. ctypes has an overhead for each call which is annoying for real time apps. However... pygame-ctypes is still useful for some things, and if pypy ever gets fast it will become more important (assuming they never release a C api for pypy). anyway... I'd going to try the following order of things... - get a simple C program to compile and run on the device. - get a simple C python extension module working. - get a simple SDL program working. - get some pygame modules running. - get full pygame test suite working. - port pygame example programs so they work ok on pythonCE too. On Thu, Aug 7, 2008 at 6:47 PM, Adam Walley [EMAIL PROTECTED] wrote: My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some of the past info on it, it seemed like a great idea to use the ctypes module. 2008/8/7 René Dudfield [EMAIL PROTECTED] nice work :) It can be easier to first try and get the SDL test programs compiling. Then try and get a really simple, minimal python extension compiling... and you guessed it, try and get them both compiling together :) There's a few wince folks hanging out on the libsdl mailing list if you have troubles there. cu, On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley [EMAIL PROTECTED] wrote: Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On
Re: [PythonCE] pygame / distutils
Jared Adam, Glad to hear you were able to cross compile sdl with cegcc, this opens the possibility to compile pygame with cegcc, which may yield better results than Microsoft tools :) Some times ago, I've sent Jared a PythonCE 2.5 import library and an scons script to easily compile Python modules with cegcc. I think they'll be useful for compiling pygame. (Btw, I have a working PIL port built this way that I'll be happy to put online soon) Jared, did you manage to compile SDL_Image on top of SDL ? I think it's the only extra dll that is needed by pygame to work. I remember that when compiling with embedded vc++ this dll was compiled almost out of the box since the low level calls were handled by SDL so no porting was required. Would be cool to have SDL_Mixer too. Best regards, Alexandre___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
i tried, but not very hard. configure worked fine, but during make it complained about iconv.h some other includeand looking in legacy versions of cegcc, iconv.h *was* included in the mingw32ce distbut i dunno. Ill probs work on it some more this week, to try to get it working Jared On Fri, Aug 15, 2008 at 12:14 PM, Alexandre Delattre [EMAIL PROTECTED] wrote: Jared Adam, Glad to hear you were able to cross compile sdl with cegcc, this opens the possibility to compile pygame with cegcc, which may yield better results than Microsoft tools :) Some times ago, I've sent Jared a PythonCE 2.5 import library and an scons script to easily compile Python modules with cegcc. I think they'll be useful for compiling pygame. (Btw, I have a working PIL port built this way that I'll be happy to put online soon) Jared, did you manage to compile SDL_Image on top of SDL ? I think it's the only extra dll that is needed by pygame to work. I remember that when compiling with embedded vc++ this dll was compiled almost out of the box since the low level calls were handled by SDL so no porting was required. Would be cool to have SDL_Mixer too. Best regards, Alexandre ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
hi, On Sat, Aug 16, 2008 at 2:14 AM, Alexandre Delattre [EMAIL PROTECTED] wrote: Jared Adam, Glad to hear you were able to cross compile sdl with cegcc, this opens the possibility to compile pygame with cegcc, which may yield better results than Microsoft tools :) Some times ago, I've sent Jared a PythonCE 2.5 import library and an scons script to easily compile Python modules with cegcc. I think they'll be useful for compiling pygame. Do you have a link to that stuff? Or could you email it to me? (Btw, I have a working PIL port built this way that I'll be happy to put online soon) Awesome :) Is there a central place for pythonCE ports? Jared, did you manage to compile SDL_Image on top of SDL ? I think it's the only extra dll that is needed by pygame to work. I remember that when compiling with embedded vc++ this dll was compiled almost out of the box since the low level calls were handled by SDL so no porting was required. Would be cool to have SDL_Mixer too. Best regards, Alexandre ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some of the past info on it, it seemed like a great idea to use the ctypes module. 2008/8/7 René Dudfield [EMAIL PROTECTED] nice work :) It can be easier to first try and get the SDL test programs compiling. Then try and get a really simple, minimal python extension compiling... and you guessed it, try and get them both compiling together :) There's a few wince folks hanging out on the libsdl mailing list if you have troubles there. cu, On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley [EMAIL PROTECTED] wrote: Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On 06/08/2008, René Dudfield [EMAIL PROTECTED] wrote: Hi, if anyone has any project files to build pygame on pythonce I'd love to have them included with pygame. I'm an author/maintainer of pygame and have commit access to svn, so could add project files if someone makes them... I could also add a pygame download for python CE to the pygame.org download page. Or you could add compilation instructions to the pygame wiki here: http://pygame.org/wiki/CompilePythonCE I have a winCE phone so would love to be able to get pygame running on it :) cheers, ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
I, too came across the SCUMM files ;) and have gotten some test SDL c programs to compile under cegcc. On Thu, Aug 7, 2008 at 4:47 AM, Adam Walley [EMAIL PROTECTED] wrote: My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some of the past info on it, it seemed like a great idea to use the ctypes module. 2008/8/7 René Dudfield [EMAIL PROTECTED] nice work :) It can be easier to first try and get the SDL test programs compiling. Then try and get a really simple, minimal python extension compiling... and you guessed it, try and get them both compiling together :) There's a few wince folks hanging out on the libsdl mailing list if you have troubles there. cu, On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley [EMAIL PROTECTED] wrote: Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On 06/08/2008, René Dudfield [EMAIL PROTECTED] wrote: Hi, if anyone has any project files to build pygame on pythonce I'd love to have them included with pygame. I'm an author/maintainer of pygame and have commit access to svn, so could add project files if someone makes them... I could also add a pygame download for python CE to the pygame.org download page. Or you could add compilation instructions to the pygame wiki here: http://pygame.org/wiki/CompilePythonCE I have a winCE phone so would love to be able to get pygame running on it :) cheers, ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Well, I have been attempting to get something working, but have been struggling to get the SDL compiled correctly (without SDL, there is no point in trying to get pygame working). In my investigations, I came across the SCUMM forum. Now the SCUMMVM appears to be a fully working product on various platforms including WinCE. My attempts to compile some simple test programs using the SDL source available from the official SDL site failed (mostly because the source will not compile 'as is' and needs some tweaking which is probably beyond my capabilities). However, the SCUMM forum pointed me to a set of libraries from 'knakos'. I quickly set up a new project, with my simple test program, and lo! it compiled first time and tested correctly on my WM5 device. I assume these SCUMM libraries have already been adapted to work on WinCE, and since the SCUMM idea is to get retro graphical games working, I think that pygame will probably get all the functionality it needs from them. Now, on to getting pygame working! I will attempt to get some of the pygame source modules compiled as PYDs to see if they will import and work under PythonCE. I have not yet attempted to get a DLL compiled using these new libraries so may yet hit a wall. I will report back with any news. Rene, thanks for your comments. It's nice to know there is interest from the pygame side. If anyone else would like to provide comments/advice/code to get pygame working, it will be welcomed. Adam. On 06/08/2008, René Dudfield [EMAIL PROTECTED] wrote: Hi, if anyone has any project files to build pygame on pythonce I'd love to have them included with pygame. I'm an author/maintainer of pygame and have commit access to svn, so could add project files if someone makes them... I could also add a pygame download for python CE to the pygame.org download page. Or you could add compilation instructions to the pygame wiki here: http://pygame.org/wiki/CompilePythonCE I have a winCE phone so would love to be able to get pygame running on it :) cheers, ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Hi, I've been able to make pygame-ctypes works with SDL.dll and SDL_Image.dll built from unofficial wince project files of SDL, with very minimal changes. I'm keen to package this and make it public, but you must note this is very experimental and is a bit slow. The constraints explained by Christopher, especially regarding current directory support, applies here too. I did not manage to compile the C version with evc++4 but I'd like to give a try later with cegcc, unfortunately I do not have the time for this yet. Also, before rushing in compilation, it may be interesting to benchmark pygame and pygame-ctypes on desktop to evaluate if there would be a really speed gain in using a compiled version. As pygame is mostly a wrapper around SDL, I found it hard to evaluate the overhead caused by using ctypes instead of c code. A benchmark would help us to see clearer. Regards, Alexandre ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Christopher and Jared, Thank you for your comments. Christopher would you agree about the sluggishness once pygame is running on a PDA? I suppose I am not too bothered at the moment. For my purposes just being able to access audio and drawing to screen would be fine - though I'm sure sooner or later speed will be needed too. One additional obstacle I face is some extra fiddling to get the compiling done on PellesC (I do not own VS and I believe the free version does not support WinCE compilation). Anyhow, I will attempt to get something working, and if it gives respectable results I will report back. Thanks again for your input. Adam On 26/07/2008, Christopher Fairbairn [EMAIL PROTECTED] wrote: Hi, On Sat 26/07/08 05:13 , Adam Walley [EMAIL PROTECTED] sent: - is there already a way to get distutils working with PythonCE? There has been recent discussions about this, but at current I don't bieleve there is anything available. With respect to SDL and pygame it should be fairly easy to get the various python modules compiled. There have been a couple of releases built for PythonCE in the past and I've personally compiled from source a couple of times. The SDL project has an additional ZIP file that contains Windows CE (Pocket PC) compatible project files that will allow you to build a suitable dll. If you look at the distutils based installation files for the pygame distribution you can determine which source files need to be compiled into the various python modules (*.pyd). What I did was then manually create project files for Visual Studio to build these DLLs (you will need a source release of PythonCE itself for this, as to build a module you will require the python header files). Once I had all the pygame dlls compiled it was then simply a matter of copying them to the correct folder on the PDA. There was no registry settings etc involved. One thing to keep in mind is that some of the sample apps within the Pygame distribution won't work on a PDA without minor modifications. For example they commonly request a window size which is larger than the PDA's screen, and don't account for the lack of current working directory support when specifying file names for bitmap resources etc. Hope this helps, Christopher Fairbairn ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
For compilation have you tried CeGCC? (http://cegcc.sourceforge.net/) Adam Walley wrote: Christopher and Jared, Thank you for your comments. Christopher would you agree about the sluggishness once pygame is running on a PDA? I suppose I am not too bothered at the moment. For my purposes just being able to access audio and drawing to screen would be fine - though I'm sure sooner or later speed will be needed too. One additional obstacle I face is some extra fiddling to get the compiling done on PellesC (I do not own VS and I believe the free version does not support WinCE compilation). Anyhow, I will attempt to get something working, and if it gives respectable results I will report back. Thanks again for your input. Adam On 26/07/2008, *Christopher Fairbairn* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, On Sat 26/07/08 05:13 , Adam Walley [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] sent: - is there already a way to get distutils working with PythonCE? There has been recent discussions about this, but at current I don't bieleve there is anything available. With respect to SDL and pygame it should be fairly easy to get the various python modules compiled. There have been a couple of releases built for PythonCE in the past and I've personally compiled from source a couple of times. The SDL project has an additional ZIP file that contains Windows CE (Pocket PC) compatible project files that will allow you to build a suitable dll. If you look at the distutils based installation files for the pygame distribution you can determine which source files need to be compiled into the various python modules (*.pyd). What I did was then manually create project files for Visual Studio to build these DLLs (you will need a source release of PythonCE itself for this, as to build a module you will require the python header files). Once I had all the pygame dlls compiled it was then simply a matter of copying them to the correct folder on the PDA. There was no registry settings etc involved. One thing to keep in mind is that some of the sample apps within the Pygame distribution won't work on a PDA without minor modifications. For example they commonly request a window size which is larger than the PDA's screen, and don't account for the lack of current working directory support when specifying file names for bitmap resources etc. Hope this helps, Christopher Fairbairn ___ PythonCE mailing list PythonCE@python.org mailto:PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce
Re: [PythonCE] pygame / distutils
Hi, On Sat 26/07/08 05:13 , Adam Walley [EMAIL PROTECTED] sent: - is there already a way to get distutils working with PythonCE? There has been recent discussions about this, but at current I don't bieleve there is anything available. With respect to SDL and pygame it should be fairly easy to get the various python modules compiled. There have been a couple of releases built for PythonCE in the past and I've personally compiled from source a couple of times. The SDL project has an additional ZIP file that contains Windows CE (Pocket PC) compatible project files that will allow you to build a suitable dll. If you look at the distutils based installation files for the pygame distribution you can determine which source files need to be compiled into the various python modules (*.pyd). What I did was then manually create project files for Visual Studio to build these DLLs (you will need a source release of PythonCE itself for this, as to build a module you will require the python header files). Once I had all the pygame dlls compiled it was then simply a matter of copying them to the correct folder on the PDA. There was no registry settings etc involved. One thing to keep in mind is that some of the sample apps within the Pygame distribution won't work on a PDA without minor modifications. For example they commonly request a window size which is larger than the PDA's screen, and don't account for the lack of current working directory support when specifying file names for bitmap resources etc. Hope this helps, Christopher Fairbairn ___ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce