Closed u8slvn closed 1 week ago
Thanks for the bug report.
I cannot seem to reproduce this on Ubuntu, perhaps this is a windows only issue
This seems like the same problem as #2571 and #2376
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. pygame.display.quit()
and pygame.display.init()
. Haven't tested though.
I cannot seem to reproduce this on Ubuntu, perhaps this is a windows only issue
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 think it would work to quit and re-initialize the video system while doing it. pygame.display.quit() and pygame.display.init().
I just tested it and it does the trick! Thks!
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.
No, I'm using pip installed pygame-ce 2.4.1 (SDL 2.28.5, Python 3.11.6)
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.