-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling pygame.display.set_mode
a second time crashes with SCALED
flag if it hasn't been called with it the first time.
#2737
Comments
Thanks for the bug report. I cannot seem to reproduce this on Ubuntu, perhaps this is a windows only issue |
If you're trying to run code that switches between SCALED and not-scaled, I think it would work to quit and re-initialize the video system while doing it.
This is in a whole stream of renderer semantics issues, and all the earliest reports were on Linux, so that's surprising. Are you using an old system SDL? It's an SDL version thing. |
I just tested it and it does the trick! Thks! |
No, I'm using pip installed |
simplest repro: import pygame
pygame.init()
pygame.display.set_mode([800, 600])
pygame.display.set_mode([800, 600], flags=pygame.SCALED) |
Environment:
Current behavior:
When the method
pygame.display.set_mode
is called a second time withSCALED
flag and hasn't been called the first time withSCALED
flag, pygame crash with the following error:The error happens only when
set_mode
is called withSCALED
flag and if it hasn't been set with it before.Expected behavior:
This seems to happen only since 2.4.0, I tested it with 2.3.2 and it works properly.
Steps to reproduce:
set_mode
withoutSCALED
flag.set_mode
a second time withSCALED
flag makes pygame crash.Or:
set_mode
withSCALED
flag.set_mode
a second time without it, this will work as intended.set_mode
a third time withSCALED
flag, then it crashes.Test code
Just press SPACE key to switch mode.
The text was updated successfully, but these errors were encountered: