Sam Lantinga

Results 1875 comments of Sam Lantinga

> Same size as the window. And that's exactly what happens if you use SDL_LOGICAL_PRESENTATION_STRETCH.

In our example above, the renderer would see a 5x3 window and know that it needs letterboxing. Since the output viewport must be whole pixels, it will round as close...

Because they're doing different jobs. If you want it to round the same way as the window, use SDL_LOGICAL_PRESENTATION_STRETCH.

Can you provide specific numbers for all those variables? I'm going to drop them into testsprite and see if I can reproduce what you're seeing. Also, you probably want to...

You're welcome! FYI, I noticed that with some window sizes, toggling the status bar repeatedly shrinks the window. Here's the fix: ```c SDL_SetWindowSize(sdlWindow, w, (int)SDL_roundf((float)(height * w) / width)); ```

Here's the patch to testsprite that I'm using to test this. I'm running into rendering issues, documented in https://github.com/libsdl-org/SDL/issues/11704, so we'll have to fix those before coming back to this....

> > You're welcome! > > FYI, I noticed that with some window sizes, toggling the status bar repeatedly shrinks the window. Here's the fix: > > ```c > >...

I went ahead and implemented the letterbox vs stretch approach that I suggested above, and the latest SDL code works great with this patch to testsprite: ```diff diff --git a/test/testsprite.c...

> For macos/AppKit, SDL provides a pointer to the `NSWindow` with the `SDL_PROP_WINDOW_COCOA_WINDOW_POINTER` property, but `raw-window-handle` wants a `NSView` pointer. As far as I know getting the `NSView` from the...

This should just be EMSCRIPTEN: https://github.com/Ravbug/sdl3-sample/blob/edbf595cace68d40023f30e85c4d19a7d4eae1c5/CMakeLists.txt#L14