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

Multiple Windows (was Re: [pygame] Starting Window Position)



"Ian Mallett" <geometrian@xxxxxxxxx> wrote:
> I want to have two or more pygame windows running at the same time.
> Can you do that?

One way to accomplish this would be to have two completely separate
processes (not just threads), each running a separate python interpreter.

The next challenge with this approach is to get the two processes to
communicate with each other, but there are several solutions to this,
including establishing a local network connection between the two
processes, or using the filesystem to transfer data back and forth.
(Google "Interprocess Communication" for other suggestions.)


I've been considering what would be required to support multiple windows
within a single process, including multiple fullscreen windows on a system
that has more than one physical display device. One hurdle there is that
the displays may not refresh at the same rate, so it seems to me that you
don't want to have a single game loop, waiting for vblank - instead,
probably, you'd want to have display threads independent of your game
logic thread.

But that's a deep change, and not something that is easily supported by
the SDL foundation of PyGame, to my understanding.

Does anybody have experience with this sort of thing?

-Dave LeCompte