Re: [pygame] 100% CPU FAQ

2008-08-11 Thread René Dudfield
yeah, SDL 1.3 can use an opengl video driver. SDL 1.3 isn't finished yet... but is fairly usable at the moment. At a guess it won't be finished for at least 6 months, probably more. On Thu, Aug 7, 2008 at 4:35 AM, Kevin <[EMAIL PROTECTED]> wrote: > Isn't SDL 1.3 supposed to offer hardware accel

Re: [pygame] 100% CPU FAQ

2008-08-06 Thread Kevin
Isn't SDL 1.3 supposed to offer hardware acceleration as a default, then have software as a backup? It seems like I heard something about that before... On Wed, Aug 6, 2008 at 9:51 AM, Frozenball <[EMAIL PROTECTED]> wrote: > Personally I would love if there were an option to use hardware > accele

Re: [pygame] 100% CPU FAQ

2008-08-06 Thread Frozenball
Personally I would love if there were an option to use hardware acceleration (OpenGL) instead of software rendering. I know there exists an option for that, but it doesn't work that well (requires fullscreen). On Fri, Aug 1, 2008 at 2:56 AM, Brian Fisher <[EMAIL PROTECTED]> wrote: > Pygame using m

Re: [pygame] 100% CPU FAQ

2008-08-04 Thread René Dudfield
hi, Using pyglet your code won't run at all on many more machines, because it depends on opengl. pygame installs fine with binaries for the python available from python.org. If you have any issues what are they? We'd like to fix them. cheers, On Fri, Aug 1, 2008 at 8:42 AM, Python Nutter <[E

Re: [pygame] 100% CPU FAQ

2008-08-01 Thread Brad Montgomery
> ...We'll port it to C. > > while 1{}; I think you mean: while(1) {}; // c has parentheses! :)

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Peter Shinners
techtonik wrote: Hello, I do not know why this question is not present in FAQ yet, but - why pygame always eats 100% of CPU time? The following example shows 100% load even with empty event queue when pygame.event.get() is blocking. Also be aware, the following code will eat 100% cpu. wh

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Greg Ewing
Python Nutter wrote: I was annoyed by the OP's observations as well. I've converted my program to many different Python game/media APIs to observe the differences. Pygame = chew up the most CPU resources There's nothing about pygame that inherently chews up cpu, it's all a matter of how you us

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Greg Ewing
Noah Kantrowitz wrote: If you want to control your framerate (and therefore CPU usage) use pygame.time.Clock. Alternatively, use pygame.time.set_timer to arrange for a USEREVENT to be sent at regular intervals. In your event loop, use pygame.event.wait(), which does block (but only returns one

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Brian Fisher
Pygame using more CPU resources could be completely expected because it uses software rendering while Pyglet/rabbyt would be using openGL (i.e. hardware) Also, because pygame basically requires you to write your own main loop (although it provides facilities to help), it's fairly easy to write loo

RE: [pygame] 100% CPU FAQ

2008-07-31 Thread Noah Kantrowitz
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Python Nutter > Sent: Thursday, July 31, 2008 4:09 PM > To: pygame-users@seul.org > Subject: Re: [pygame] 100% CPU FAQ > > http://pyglet.googlecode.com/issues/attachment?aid

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Brian Fisher
I'm curious, In what way is Pygame currently sorely lacking in OS X installation binaries? What would you like to be different about the binaries here: http://pygame.org/download.shtml The reason I ask is cause for me they all work perfectly fine, and if there was a problem I'd like to help fix i

RE: [pygame] 100% CPU FAQ

2008-07-31 Thread Noah Kantrowitz
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Python Nutter > Sent: Thursday, July 31, 2008 3:55 PM > To: pygame-users@seul.org > Subject: Re: [pygame] 100% CPU FAQ > > I've tested multiple frame rates, > > 1

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Python Nutter
2008/8/1 Noah Kantrowitz <[EMAIL PROTECTED]>: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> On Behalf Of Python Nutter >> Sent: Thursday, July 31, 2008 3:43 PM >> To: pygame-users@seul.org >> Subject: Re: [pygame] 100% CPU

RE: [pygame] 100% CPU FAQ

2008-07-31 Thread Noah Kantrowitz
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Python Nutter > Sent: Thursday, July 31, 2008 3:43 PM > To: pygame-users@seul.org > Subject: Re: [pygame] 100% CPU FAQ > > I was annoyed by the OP's observations as well. I

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Python Nutter
I was annoyed by the OP's observations as well. I've converted my program to many different Python game/media APIs to observe the differences. Pygame = chew up the most CPU resources Pyglet = chews up 28% to 42% CPU (surprised that the low CPU use was on old PowerPC G4 processors and the new lates

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Nicholas Dudfield
Incidentally, if you say "start_time = time.time()" when starting your program, then get the time when ending, subtract start_time, and divide by the number of frames drawn, you get an easy FPS counter. I noticed pygame has functionality for this inbuilt. Clock.get_fps(), "Compute your game's

RE: [pygame] 100% CPU FAQ

2008-07-31 Thread Noah Kantrowitz
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of techtonik > Sent: Thursday, July 31, 2008 4:09 AM > To: pygame-users@seul.org > Subject: Re: [pygame] 100% CPU FAQ > > On Thu, Jul 31, 2008 at 11:31 AM, Noah Kantrowitz <

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread kschnee
By default, Python/Pygame will run as fast as the OS lets it, which means 100% CPU usage. If you want to avoid that, there are several ways. One is to create a Pygame Clock object ("clock = pygame.clock.Clock()", I think) and then, in your main loop, call the clock's tick() function with the desire

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Nicholas Dudfield
for event in []: print time.time() event.get() will return an empty list if the event queue is empty. With your code sample, this is happening many times per second thus using a lot of cpu. Only when there is actually events in the event list will the for block be executed. Stick the time.t

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread techtonik
On Thu, Jul 31, 2008 at 11:31 AM, Noah Kantrowitz <[EMAIL PROTECTED]> wrote: >> >> The following example shows 100% load even with empty event queue when >> pygame.event.get() is blocking. > > That would be because event.get() doesn't block. If you want to control your > framerate (and therefore C

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Nicholas Dudfield
event.wait() will, well, _wait_ for single events while blocking. On Thu, Jul 31, 2008 at 6:31 PM, Noah Kantrowitz <[EMAIL PROTECTED]>wrote: > techtonik wrote: > >> Hello, >> >> I do not know why this question is not present in FAQ yet, but - why >> pygame always eats 100% of CPU time? >> >> Th

Re: [pygame] 100% CPU FAQ

2008-07-31 Thread Noah Kantrowitz
techtonik wrote: Hello, I do not know why this question is not present in FAQ yet, but - why pygame always eats 100% of CPU time? The following example shows 100% load even with empty event queue when pygame.event.get() is blocking. That would be because event.get() doesn't block. If you want

[pygame] 100% CPU FAQ

2008-07-31 Thread techtonik
Hello, I do not know why this question is not present in FAQ yet, but - why pygame always eats 100% of CPU time? The following example shows 100% load even with empty event queue when pygame.event.get() is blocking. import time if __name__ == "__main__": import pygame pygame.init() siz