[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Summer of Code 2008



On Friday 21 March 2008 19:58:26 Ian Mallett wrote:
> This multi-window stuff looks nice, but it seems like PyGame should handle
> it naturally:

With due respect, from the docs - 
   * Pygame (and SDL) doesn't support multiple windows.

... http://www.pygame.org/docs/ref/display.html#pygame.display.set_mode

The SDL limitation is the real problem there. Extending SDL would be the 
solution there.

Currently, in order to have multiple windows, you need to use multiple 
processes. As a result, this API ...
> ScreenSize = (200,150)
> Surface1 = pygame.display.set_mode(ScreenSize)
> Surface2 = pygame.display.set_mode(ScreenSize)
> Surface3 = pygame.display.set_mode(ScreenSize)

... is harder to achieve than you might expect. You may be able to layer 
something like this on top of the Kamaelia code - but doing it that way won't 
perform as well as having the local process manage its local display. (which 
is what the Kamaelia code does)

I thought it /may/ be of interest because it specifically provides an easy way
of working round the single window limitation to have multiple pygame windows
in a single application. (It's quite fun having multiple pygame windows open 
to be honest :) (alternative definitions of fun are available ;)

Also means your games can naturally use all the cores on a multicore machine, 
but that's a minor detail :)

:-)


Michael.