[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Upper Limit on Framerate
- To: "pygame-users@xxxxxxxx" <pygame-users@xxxxxxxx>
- Subject: [pygame] Upper Limit on Framerate
- From: "Ian Mallett" <geometrian@xxxxxxxxx>
- Date: Thu, 21 Aug 2008 00:49:18 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 21 Aug 2008 03:49:22 -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:mime-version:content-type; bh=RS8bDBAYjNtmSMENMWlR/9PdoHhCoIHo4XvrKRsAWFk=; b=xDTFIO1NsT0kQmTQZvdTnb+npewJssH2rqSrk8pH60pXXL0Vj7i+jp3lpovvJ1e405 MT9upt+Ku+WH/fv61ElNisJ9rcrAFi2Pmik6in+6f2aAmuqAVRA8PT6uTfDZKjAXe8Jo ZBs6bz8uDaY1jrhJ/+02z7d5xmM0udedaGVyI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=FQ/4fgAKep2YgiKz5KFVKynJR4I1iBYF9+dxZVFk1O7V8JVUnA1w5OTK2HNLkP4V7v C8nfZ94lc8d0Q2s9e/77bS/7mReDKL3EbF+B0CRcxT9g9k6mxHWHg+gyo7rGiedYP9G+ IcgQXvkvDnNfN8RBWXAqeLlrW3oKpFlTUyJUE=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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