Re: [pygame] Is pygame event thread save? or I need use lock to post user event in thread?

2008-11-24 Thread Peter Shinners

halida wrote:

I want to use multi-thread in pygame game loop,
with main draw and display.update thread,
 event process thread,
game update thread.
and I will use event.post(drawEvent) to tell main thread  to update
screen.
do I need use threading.Lock()  to lock it? or just let it go?
it is too hard to read pygame source code for me.
  


Posting an event is thread safe, you will not need to worry about locking.

I'm pretty sure you must still get events from the main thread. Getting 
events is very tied to the platform.




Re: [pygame] Pygame CTypes

2008-11-24 Thread Peter Shinners

pymike wrote:
I still think it'd be cool to have a simple pure-python SDL wrapper. I 
tried a few times but I kept blowing up my computer ;-(


On Mon, Nov 17, 2008 at 9:42 AM, Luke Paireepinart 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:


The SoC student who wrote Pygame Ctypes is one of the main authors of
Pyglet, so check that out if you're curious, OP.  RJones is the other
(he replied earlier in this thread.)

On 11/16/08, Nicholas Dudfield [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 Unacceptable Right Doun To Mah Tippy Teepee Toes




Definitely check the code for ctypes pygame. It is cleanly separated 
between the SDL binding and the Pygame api. I'd still recommend looking 
at Pyglet, but the SDL ctyles is high quality. There is a small example 
and the original SDL unit tests have been ported to Python.




Re: [pygame] Pygame CTypes

2008-11-24 Thread pymike
I've looked at it before. The ctypes stuff was a bit over my head, but yeah
it was very clean looking. I got an SDL window pop up and an image draw to
it, but I wasn't returning sdl_surfaces right (or something) so I got some
pretty bad crashes LOL

The event stuff is pretty hard to do too :S For some reason I can't access
SDL_Event, so you have to make your own event class. Bummer

I'll probs pick it back up sometime. Right now I'm having fun (and
headaches) w/ pyOpenGL :D

Cheers

On Mon, Nov 24, 2008 at 10:02 AM, Peter Shinners [EMAIL PROTECTED] wrote:

 pymike wrote:

 I still think it'd be cool to have a simple pure-python SDL wrapper. I
 tried a few times but I kept blowing up my computer ;-(

 On Mon, Nov 17, 2008 at 9:42 AM, Luke Paireepinart 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

The SoC student who wrote Pygame Ctypes is one of the main authors of
Pyglet, so check that out if you're curious, OP.  RJones is the other
(he replied earlier in this thread.)

On 11/16/08, Nicholas Dudfield [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 Unacceptable Right Doun To Mah Tippy Teepee Toes



 Definitely check the code for ctypes pygame. It is cleanly separated
 between the SDL binding and the Pygame api. I'd still recommend looking at
 Pyglet, but the SDL ctyles is high quality. There is a small example and the
 original SDL unit tests have been ported to Python.




-- 
- pymike
Stop loling into a false sense of hilarity


Re: [pygame] Window specific changes to Pygame config.py

2008-11-24 Thread Lenard Lindstrom

René Dudfield wrote:

nice one :)
  

Thanks

--
Lenard Lindstrom
[EMAIL PROTECTED]



Re: [pygame] Is pygame event thread save? or I need use lock to post user event in thread?

2008-11-24 Thread René Dudfield
hi,

Posting an event is *not* really thread-good.  It will work, but will
start raising exceptions if you do it from multiple threads.  You can
make a post function that retries on exceptions, but then you may get
worse performance.

Use the fastevent module instead if you want to use threads.  The only
main difference is that you can't peek at the event queue... which no
one really does any way.  It is designed to be much faster with
threads, and is thread-good :)

Using the fastevent module is much nicer, and I hope we will finally
make it into pygame 1.9 as the default event module.

I've done a number of programs using threads, and the fastevent module
is the way to go.


cu!



On Tue, Nov 25, 2008 at 2:33 AM, Peter Shinners [EMAIL PROTECTED] wrote:
 halida wrote:

 I want to use multi-thread in pygame game loop,
 with main draw and display.update thread,
  event process thread,
 game update thread.
 and I will use event.post(drawEvent) to tell main thread  to update
 screen.
 do I need use threading.Lock()  to lock it? or just let it go?
 it is too hard to read pygame source code for me.


 Posting an event is thread safe, you will not need to worry about locking.

 I'm pretty sure you must still get events from the main thread. Getting
 events is very tied to the platform.




Re: [pygame] Window specific changes to Pygame config.py

2008-11-24 Thread Lenard Lindstrom

Lenard Lindstrom wrote:


René Dudfield wrote:

nice one :)
  

Thanks

I see Marcus wasn't kidding when he said he has reworked the build 
process for Pygame Reloaded. So I will refrain from making further 
changes to Pygame's configure and build system. It does what I need, 
work with the new Windows prebuilt.


--
Lenard Lindstrom
[EMAIL PROTECTED]



[pygame] Ludumdare 48 hour, from scratch, game making comp. December 5th-7th weekend.

2008-11-24 Thread René Dudfield
Hello,

Ludum Dare #13 is coming soon!! December 5th-7th weekend.


Ludum Dare is a regular community driven game development competition.
The goal is, given a theme and 48 hours, to develop a game from
scratch. Ludum Dare aims to encourage game design experimentation, and
provide a platform to develop and practice rapid game prototyping.

You can start suggesting themes now, with voting to start by the end
of the month(December 1st 2008). http://ludumdare.com/wiki/start

www.ludumdare.com - the super awesome website, refresh hourly
irc://irc.afternet.org/ludumdare #ludumdare - the compo IRC channel,
waste your time here
http://www.ludumdare.com/compo/ - the compo blog, be sure to sign up here
http://www.ludumdare.com/wiki/ - the compo wiki, submit themes  read rules here
http://www.ludumdare.com/planet/ - the compo planet, read about our
exciting lives here



cu,