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 1 commit 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);

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