[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] OSX pygame almost ready



Forwarded Message from Bob Ippolito
----------------------------------------------------------------------
For those of you that don't already know, I've been working (too) hard
on porting pygame and everything else it needs to the OS X platform (aka
Darwin, as far as Python is concerned).  The good news is that it's
almost done!  Though, there are a few outstanding issues that probably
won't get fixed by release

1)  Running scripts from the command line is sketchy, OS X doesn't like
this at all (but I'm doing my best to make it work as well as humanly
possible without access to private apple frameworks and documentation).
Unfortunately this makes it quite difficult to pass command line
arguments to python scripts, but running a python script is as easy as
double clicking it.  So try and make as many things as possible
configurable by methods inside the application rather than depending on
a command line.  Besides, windows users don't like using the command
line either  [:)]

2)  SDL's Quartz renderer is new and still has a few bugs, all of which
crop up when the user does something outside of the window.  If the
focus leaves the SDL window, the mouse positions may be off until they
click the title bar of the window.  Also, it seems to lose the
framebuffer when you minimize and restore.  It also isn't very good
about giving the mouse pointer back (if it's made invisible) if the
mouse leaves the window, but it does if you switch applications.

3) Fullscreen takes over the WHOLE screen, this isn't really natural for
OS X, there's practically always a title bar at top.. also, rumor has it
that if really bad things happen during fullscreen you might need to
reboot.  So try not to have bugs in your app if it's fullscreen by
default  [;)]

4)  OpenGL does work, and it works well.  Except, GL_VERTEX_ARRAY /
GL_VERTEX_ARRAY_EXT doesn't seem to be supported, at least on this
g4-400 with the stock video card.  This is unfortunate, but when
developing your application you can check for this support pretty easily
with something like:
glVertexSupport = 1
try:
    glEnable(GL_VERTEX_ARRAY)
except:
    glVertexSupport=0

and then changing the "drawing" parts of your code to accomodate both
traditional and vertex array methods

5)  Switching between fullscreen and windowed mode isn't supported.  I
believe this is true for other platforms, so you shouldn't really do it
anyways.

6)  Windows aren't resizable

7)  I have no idea if you can do multiple windows, I wouldn't try it
though.  I think this is fragile in SDL anyways if it's supported at all

8)  changing the app's icon isn't implemented, but it wouldn't be
terribly difficult to do.  though, OS X likes it's icons at 128x128, so
I don't know if it's really worth implementing it since you'll probably
replace the nice pygame logo with something chunky looking  [;)]

9)  I don't know how well the joystick support works, but I don't have
one.  But, I do know, if you don't have one and try and use the joystick
module it will throw a fit.  Nothing terrible, but please put a
try:except: around any code that talks to the joystick.

--

Issues aside, here's what the package will include (all of these will be
compiled, an easy to build version is very difficult to produce but I'll
provide source for the really brave).  Everything is dynamically linked,
and the distribution will include all development headers and man pages
if appropriate for everything listed.  Python and all of the SDL
components are built as frameworks, the others are just dylib bundles
and header files in the /usr/local/ tree or installed into python's
framework.

I will not provide a lick of support for anyone attempting to install
this on anything prior to Mac OS X 10.1.2, a lot has changed since
10.0.  Also, I recommend that the developers tools be installed, I don't
think not having them installed will be a problem, but I don't have a
computer without them to test this on (nor do I want a computer without
the developers tools  [;)]

SDL 1.2.3 w/ some patches by me to fix bugs (windows now close on cmd-q
and if the red dot is clicked, as per normal behavior)
SDL_image 1.2.1 w/ libpng 3.1.2.1, libjpeg 62
SDL_mixer 1.2.1 w/ libsmpeg 0.4.0.1.2, libogg 0.1.0, libvorbis/enc/file
0.0.1
SDL_ttf 2.0.4 w/ freetype 6.2.0 (from cvs a couple weeks ago)
Python 2.2 w/ libdl from darwin cvs (patched to NOT use python's
brokeass dylib loader) and (harmless) distutils patches that I needed to
make to build everything
Numeric 20.3 (no patches!)
PyOpenGL 2.0.0.44 (build scripts patched, WGL fluff removed,
GL_VERTEX_ARRAY_EXT support removed)
pygame 1.3 (build scripts patched, pygame.macosx created (small
bootstrap required when python started from terminal), icon provided)

of course, my changes will merge with pete's latest and become pygame
1.4 (if he changes the version constant this time  [;)] , and hopefully I
can get my modifications for everything else into their source trees so
someday it'll be an easy build.  I have been working on this for a
couple weeks on and off so may have neglected to mention other fixes I
have made.  I've pretty much had to at the least hack the
configure/libtool scripts for everything mentioned, usually a bit more.

some recent screenshots of this in action can be seen at
http://redivi.com/~bob -- and a pkg file will be available quite soon!

..

no, I haven't written a "py2app" yet for OS X, so don't ask, but I'm
considering it.

no, this doesn't have anything to do with fink.  I don't like
dependencies, and fink is a dependency that is too complicated for some
users.  I will not be building fink packages because I don't have the
time and because it just wouldn't work well inside fink's "chroot jail"
install tree.  Frameworks should be in /Library/Frameworks or
~/Library/Frameworks.  I opted to put everything in /Library/Frameworks
for systems

-bob





____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org