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

Extend sub-pixel rendering support #2609

Merged
merged 7 commits into from
Aug 28, 2023

Conversation

Vankata453
Copy link
Member

@Vankata453 Vankata453 commented Aug 25, 2023

Implements sub-pixel rendering support for the SDL2 renderer. Achieved by replacing drawing functions in SDLPainter with their float equivalents.

Additionally, the DrawingContext size getters now return floating-point values, since before, they would always return an integer value, which didn't account for possible floating-point scale values of the current transform. This helps fix various other graphical glitches.

Fixes #2422.

@Vankata453 Vankata453 added category:code status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs. labels Aug 25, 2023
Previously, the `DrawingContext` size getters would always return an integer value, which didn't account for possible floating-point scale values of the current transform.

Those functions now return floating-point values, which fixes some graphical bugs.
@Vankata453 Vankata453 changed the title SDL sub-pixel rendering support Extend sub-pixel rendering support Aug 26, 2023
@mrkubax10
Copy link
Member

Does this have any impact on performance? Floating point arithmetic tends to be slower.

@Vankata453
Copy link
Member Author

@mrkubax10 To me it made no difference. Either way, in my opinion, we shouldn't sacrifice proper rendering for performance.

@mrkubax10
Copy link
Member

It should be fine then.

@Vankata453 Vankata453 merged commit 154315d into SuperTux:master Aug 28, 2023
@Vankata453 Vankata453 deleted the sdl-sub-pixel-rendering branch August 28, 2023 17:50
@Vankata453 Vankata453 removed the status:needs-review Work needs to be reviewed by other people label Sep 2, 2023
Vankata453 added a commit to Vankata453/supertux that referenced this pull request Sep 22, 2023
Addition to SuperTux#2609 (commit 154315d).

Implements sub-pixel rendering support for lines and triangles on the SDL renderer.
tobbi pushed a commit that referenced this pull request Sep 24, 2023
Addition to #2609 (commit 154315d).

Implements sub-pixel rendering support for lines and triangles on the SDL renderer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:code type:bugfix Pull Requests that fix bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird issue with zooming in and out when using SDL video system
3 participants