Skip to content
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

pygame._sdl2.sdl2.error: Parameter 'dst' is invalid when calling Renderer.to_surface() if logical_size is 80,1 (or 1,80) #3244

Open
ImNotMeAnymore opened this issue Nov 26, 2024 · 0 comments
Labels
bug Not working as intended Experimental Experimental code

Comments

@ImNotMeAnymore
Copy link

ImNotMeAnymore commented Nov 26, 2024

Environment:
OS: Pop_OS 22.04 LTS
pygame-ce version: 2.5.2
python version: 3.12.2

Current behavior:
Making a pygame._sdl2.video.Renderer object and changing it's logical size to 1,80 or 80,1 and then trying to use .to_surface() on said object will raise:

File "video.pyx", line 1253, in pygame._sdl2.video.Renderer.to_surface
pygame._sdl2.sdl2.error: Parameter 'dst' is invalid

The window needs to be larger than logical_size

Expected behavior:
This is closely related to #3245 so it heavily depends on how that is solved, but I think it should either:
a) if 1,80(or 80,1) is an invalid value raise an error when setting it, not when calling to_surface (no other than 80 seems to cause trouble outside of the issue mentioned above)
b) make it work like any other value (needs above issue to be solved)
c) make to_surface() raise a more comprehensive error, 'dst' is invalid says nothing, especially if logical_size was changed someplace else

Test code

from pygame import Window
from pygame._sdl2.video import Renderer

win = Window(size=(100,100))
ren = Renderer(win)
ren.logical_size = 80,1

"[Any amount of code]"

ren.to_surface()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended Experimental Experimental code
Projects
None yet
Development

No branches or pull requests

2 participants