Limit refresh rate to 60 FPS
parent
3b1967db22
commit
62d7913f85
|
@ -59,6 +59,7 @@ class CaptureButton(Button):
|
|||
screen.blit(ren, topleft)
|
||||
|
||||
def run(self):
|
||||
print(self.photoboite.clock.get_fps())
|
||||
pygame.event.set_blocked((pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP))
|
||||
self.capture_mode = True
|
||||
|
||||
|
@ -148,6 +149,8 @@ class Photoboite:
|
|||
|
||||
self.font = pygame.font.Font(pygame.font.match_font('calibri'), 180)
|
||||
|
||||
self.clock = pygame.time.Clock()
|
||||
|
||||
|
||||
def screen(self):
|
||||
if os.getenv('DISPLAY'):
|
||||
|
@ -174,6 +177,8 @@ class Photoboite:
|
|||
return pygame.display.set_mode()
|
||||
|
||||
def draw(self):
|
||||
self.clock.tick(60)
|
||||
|
||||
self.screen.fill(self.background)
|
||||
|
||||
self.camera.draw_on(self.screen)
|
||||
|
|
Loading…
Reference in New Issue