[Soya-user] macosx build (October 03, 2004 - 00:04)

 

Greetings.

Thanks to being happy about getting to use a nice little new laptop for 
work, and having to sit in a train for much of today, got Soya to run on 
Mac OS X for the first time now.

It's not perfect yet, but promising I dare to say .. trying to report here
so that someone might take it forward (am tired but try to keep it clear):

0. dependencies: MacPython PackageManager installs most nicely, but the
Pyrex version I got from there was too old (didn't allow for the 'if x:
return' oneliners that are all over the place in Soya) - installing 0.9.3
from the tarball helped. cal3d installed from fink (Debian port) ok.  i
had some problem with ODE that did not solve yet. The Apple GL headers
live in /System/Library/Frameworks/OpenGL.framework/Headers/ and there is
no directory called GL there -- i just symlinked that to
/usr/local/include/GL . also added /usr/include/malloc to include path
'cause malloc.h lives there.

1. compile problems: <_GLUfuncptr> in init.pyx gluTessCallback results in
error in _soya.c function __pyx_f_5_soya_init_gl: _GLUfuncptr undeclared.  
for now, i just commented out those four lines - haven't found what it
breaks. haven't googled yet if that's a known issue with Apple's GLU or 
what, nor don't know what disabling this breaks in Soya (tutorials work).

2. initialization: now this is perhaps the trickiest part, and one where 
this issue relates a bit to what you've been talking about pygame 
interplay. once compiled, trying to run Soya straight out on a mac 
resulted in a horrible deadth, with the process yelling all kinds of NS* 
(the Cocoa classes are still called NS after NextStep :) errors. that is 
due to the app not being initialized as a macosx app when it tries to 
access video etc. luckily, pygame came to rescue here. there, in 
pygame.__init__ , is a nice piece of code that detects if it's run
on sys.platform=='darwin' in a right kind of context (pythonw), calling 
pygame.macosx which does the Cocoa/NS wrapping things. without knowing too 
much about that, i managed to hack in a call from soya init.pyx init_video 
to import soya.macosx , which is here now simply a copy of pygame.macosx 
with the pygame specific parts commented out. with this (well, in reality 
it took me hours to get right, waiting for recompiling after every stupid 
little mistake etc.), soya suddently started ok, with graphics showing, 
and based on little testing with the tutorial files interactive things and 
everyting workes, very good performance too. the wrapping / initing is not 
done all right yet - there's no standard menu, the cursor changes to the 
'spinning beachball of death' over the soya window even though it's 
working ok etc., but following better how pygame does it should fix all 
that.

So that should cover the current situation here. This was quite fun -- 
a good excuse for going through much of the Soya code (didn't have the new 
Pyrex on the train so changed all the if x: returns to have the 
linebreak and intendation at one point to get forward..), and with the new 
features (shadow, cellshading) in Soya, a pretty complete game written in 
it (first tried Slune this week :) and the nice API/model/architecture 
that i've always liked .. and working ports nearly there for win32 & mac 
too, well, I'm happy that this tool is available -- so thanks again! :)
       
On Fri, 1 Oct 2004, Jiba wrote:

> I believe the only use of Pygame with Soya would be for non-graphic
> things, like sound.

This experience showed that the area of cross-platform compatibility might 
benefit from that too..

Drifting to another topic:

I think I saw someone mention on the IRC the possibility of getting pygame
surfaces as textures to Soya .. i don't know if that's feasible, nor
really useful, but certainly an interesting possibility for me .. as I
have sort of procedural texture generators written in pygame already in
place (have used them on the 2d sprites there). The possibilities for
transferring images from one framework to another via the standard string 
representations was already mentioned, and perhaps solves that 
satisfactorically. (is that a word?-)

Then again, one thing that's been useful for me (using PixelShox for VJing 
on a Mac) are video textures on opengl-surfaces -- pygame has the old 
Movie module (mpeg1 support w/ SMPG) ready in place, and the (hopefully) 
upcoming moviext-module wrapping ffmpeg's libavcodec (used in mplayer too) 
with support for basically all video formats .. if i recall correctly, 
mplayer can already somehow work as a frameserver for opengl too, but 
don't know the details about that. admittedly, video textures might not be 
very relevant for games (which is the goal of Soya (though at least i'm 
using it for different things)), but, well, wanted to mention that anyhow 
:)

Sorry for the potential mess in the post -- has been a long day (and a 
week) -- and the drifing; hopefully the important things about running on 
mac got through, and it will be supported in the future..

> Jiba

~Toni



You are on the gna.org mail server.

Generated by mhonarc 2.6.10, Sun Oct 03 00:20:06 2004