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

SDL3: fix renderer logical presentation #7648

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cheyao
Copy link
Contributor

@cheyao cheyao commented Jun 2, 2024

This pull request fixes some clipping issues and mouse offset issues (should it be called this?) with SDL's logical presentation when using sdlrenderer back-end with SDL3.

Here is a video of the behavior after the change and before the change: (Sorry for the bad video quality)
https://imgur.com/a/w9XrzaJ

You can test this change by going to examples/example_sdl3_sdlrenderer3 and adding this after initializing the renderer:

SDL_SetRenderLogicalPresentation(renderer, 1024, 768,
					SDL_LOGICAL_PRESENTATION_LETTERBOX,
					SDL_SCALEMODE_BEST);

and this right after polling the event

SDL_ConvertEventToRenderCoordinates(renderer, &event);

@ocornut
Copy link
Owner

ocornut commented Jul 2, 2024

Hello,
Sorry for not reacting to this yet. We have dozens of similar changes desirable in various backends, partly related to DPI handling but also related to the general possibility of separating imgui coordinates from window coordinates.
SDL3 also supporting this feature add one extra layer into the mix. Please give me some time until I can investigate this (probably after 1.91).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants