Open icculus opened 1 month ago
I recently ported my game to SDL3 after watching your Quake3 tutorial video (thansk for that). I can confirm that I'm getting some wonky behavior now. I was using viewports and renderer logical size in combination to allow for fullscreen or windowed mode (non re-sizable). After porting to SDL3 it's visually obvious that the viewports and scaling don't sync up. The View scales but I only get the top left part of it rendered.
Here's an image in windowed mode:
And here's the clipping I get in fullscreen:
Send me a link to the game's source (or binaries, if closed source) and I'll take a look.
https://github.com/Oliveshark/breakhack/tree/feature/sdl3_port
SDL_SetRendererLogicalPresentation: https://github.com/Oliveshark/breakhack/blob/c504b8b096d5cf6e5e64d784ae8db16884596c7e/src/main.c#L269
Toggle fullscreen: https://github.com/Oliveshark/breakhack/blob/c504b8b096d5cf6e5e64d784ae8db16884596c7e/src/main.c#L779
(The offset variable here used to be how the render content was centered in SDL2. What the LETTERBOX mode attempts to do in SDL3 I'd assume)
Edit: Added some links to the interesting code
As mentioned in https://github.com/libsdl-org/SDL/pull/10867#issuecomment-2375250237 ...
We would need this for perfect compatibility with SDL2, where logical presentation piggybacks on the scale and viewport--SDL3 now has them separated into separate states--but I also suspect that no app ever used both scaling/viewport and logical presentation at the same time, so I'm making a note in case we want to come back to this later.