[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Upper Limit on Framerate
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Upper Limit on Framerate
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Thu, 21 Aug 2008 18:03:08 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 21 Aug 2008 04:03:12 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=agfbQ8c64tfUOW2PdItcxRCzJkXj+6pcgCeDP+WDeMw=; b=VctF88cT7WYoflBkbTao1PW9A391VFO5qGDPEPV4rh7FvYF4qPGdLxcoIbWWGzDLYM nlCjdgFiHVM395wUswYy8XlxKBdEyyfuHiBr/6xz9lTnOz+JwT0ZnzsuxHnnWl6q/8qB cjQDsDdyRSIIUakFvU0/A6bgPhCvYBKSVcFEg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=TvACm0m2d0kiBQ4mEC/GbrP4Zg/ieZO38VMmEqFx8Y/UyeqOsLHUEmlMInj5GduZu/ 5IxZgw0XdRmVsHAMuqar0yAVrqR+KJl6LdUbVGJYQMC7ZKeqHBvKuz0UkyheT6d0h7sL fr4Runpn56AUYLFggNVZvsG/NhbQP+5gA5UBE=
- In-reply-to: <a62fab400808210049o19de752elf4320e6f755bb38e@xxxxxxxxxxxxxx>
- References: <a62fab400808210049o19de752elf4320e6f755bb38e@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
hi,
I'd guess lack of precision in the timing, or the time slice the OS
gives your process. Could be 1-10 of a thousand different things
really. From the event subsystem, to the video driver, etc.
On Thu, Aug 21, 2008 at 5:49 PM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
> Hello,
>
> I'm just curious; is there an upper limit on the framerate somehow imposed
> by Clock.tick()? As part of something else, the following code:
>
> import pygame
> from pygame.locals import *
> import sys, os
> pygame.init()
> Screen = (400,300)
> icon = pygame.Surface((1,1)); icon.set_alpha(0);
> pygame.display.set_icon(icon)
> pygame.display.set_caption("Framerate Network Test - Ian Mallett - v.1.0.0 -
> 2008")
> Surface = pygame.display.set_mode(Screen)
> Clock = pygame.time.Clock()
> Message = ""
> def GetInput():
> global Message, Surface, Screen
> for event in pygame.event.get():
> if event.type == QUIT or (event.type == KEYDOWN and event.key ==
> K_ESCAPE):
> pygame.quit();sys.exit()
> def Draw():
> Surface.fill((255,255,255))
> pygame.display.flip()
> def main():
> while True:
> GetInput()
> Draw()
> Clock.tick()
> print Clock.get_fps()
> if __name__ == '__main__': main()
>
> ...runs at one of three values: 5000/3, 2000, and 2500. These are nice big
> numbers, but I can't help but notice that they are significant in their
> roundness (or niceness). Is there a particular reason for this?
>
> Ian
>