You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've attempted to implement the most basic example on a screen size above the given 320x240, and my framerate plunged significantly.
Code:
import sys, pygame
pygame.init()
size = width, height = 640, 480
speed = [2, 2]
black = 0, 0, 0
screen = pygame.display.set_mode(size)
ball = pygame.image.load("intro_ball.gif").convert()
ballrect = ball.get_rect()
clock = pygame.time.Clock()
while 1:
clock.tick(60)
pygame.display.set_caption("FPS: " + str(clock.get_fps()))
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
ballrect = ballrect.move(speed)
if ballrect.left < 0 or ballrect.right > width:
speed[0] = -speed[0]
if ballrect.top < 0 or ballrect.bottom > height:
speed[1] = -speed[1]
screen.fill(black)
screen.blit(ball, ballrect)
pygame.display.flip()
Specs:
System: OSX Mojave 10.14.6
Python: 3.7.4 (installed from python bin, not brew, but path shows it to be using the )
Pygame: 1.9.6
SDL: 2.0.9_1 (installed via brew)
Is there anything I'm obviously missing here? Thank you for your help!
Possibly related to #1032, but no solution was provided in that ticket either. I tried enabling SDL_HINT_RENDER_DRIVER=metal SDL_HINT_RENDER_VSYNC=1 as well, with no difference.
The text was updated successfully, but these errors were encountered:
After a bit of experimentation, it looks like changing the display settings to pygame.FULLSCREEN fixes this issue for some reason. Windowed mode remains slow.
Hello,
I've attempted to implement the most basic example on a screen size above the given 320x240, and my framerate plunged significantly.
Code:
Specs:
System: OSX Mojave 10.14.6
Python: 3.7.4 (installed from python bin, not brew, but path shows it to be using the )
Pygame: 1.9.6
SDL: 2.0.9_1 (installed via brew)
Framerates:
320x240 = ~60fps
640x480 = ~17fps
1024x768 = ~6.8fps
I've tried both
clock.tick()
andclock.tick(60)
.Is there anything I'm obviously missing here? Thank you for your help!
Possibly related to #1032, but no solution was provided in that ticket either. I tried enabling
SDL_HINT_RENDER_DRIVER=metal SDL_HINT_RENDER_VSYNC=1
as well, with no difference.The text was updated successfully, but these errors were encountered: