[OLPC-Games] Advisory: Require explicit imports of OLPCGames sub-modules

Mike C. Fletcher mcfletch at vrplumber.com
Sat Dec 22 21:31:06 EST 2007


Hi Everyone,

I'm looking at how to clean up the OLPCGames code base so that it's
easily maintained and more flexible.  I particularly want to get to the
point where our functionality is not all tied to the embed-pygame-in-GTK
approach and we don't pull in every major GTK/Pango/Cairo library for
every single Pygame game (egads!).  At the moment it looks like we will
be stuck with at least GObject to get activity-level interactions (e.g.
notification of "activation" and the like) (a pain because GObject takes
a very long time to load and isn't really doing much for us), but I'd
like to make pretty much everything else optional.

To that end, I'm planning on requiring explicit importing of OLPCGames
sub-modules (and likely module.init() operations for a few of them). 
That is, if you are currently just doing:

    import olpcgames
    olpcgames.pangofont.install()

your code would need to become:

    from olpcgames import pangofont
    pangofont.install()

or

    import olpcgames.pangofont
    olpcgames.pangofont.install()

(same for mesh, activity, and camera).

I'm guessing most activities have been using explicit imports anyway. 
If you haven't, please update your code base to use them, as the next
release of OLPCGames likely will require them.

Don't get too excited about the elimination of the GTK wrapper.  At the
moment I don't have a good plan for that.  Pippy is just forcing the
screen to be full-size, which won't work for size-constrained games.  We
also, AFAIK don't have any hardware support anyway, so we're not going
to get a lot of benefit other than memory and load-time speed out of
dropping the GTK wrapper (assuming it's even doable with Pygame (the
X-windows stuff looks like it'll be a pain when we're working through
Pygame)).

Anyway, enjoy yourselves,
Mike

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com



More information about the Games mailing list