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

Merge/cleanup renderer viewport calculation code. #496

Merged
merged 7 commits into from
Nov 1, 2024

Conversation

AliceLR
Copy link
Owner

@AliceLR AliceLR commented Oct 27, 2024

This fixes numerous comments complaining about fix_viewport_ratio being used in render functions by instead calculating the viewport whenever the window is resized with a new, similar function in graphics.c. Doing this also allows the integer scaling state to be precalculated for all scaling renderers, which helps mainly opengl2 right now (but could be extended to opengl1 and glsl). The longstanding "FIXME" about the ratio being calculated using floats has also been resolved.

There are two places where this couldn't be fully fixed: opengl2 and glsl using the viewport variables in render_layer to set the viewport every time a layer is rendered. Doing this correctly requires a new start of frame callback, which would be a good idea for other reasons (charset and palette update).

  • get_screen_coords_scaled/set_screen_coords_scaled also need to use the new render viewport variables.
  • The GX renderer viewport setup uses fix_viewport_ratio to generate the viewport in an unusal way and it needs to be converted.

@AliceLR AliceLR force-pushed the remove-fix-viewport-ratio branch from e5adc0f to be81cc8 Compare October 31, 2024 09:10
@AliceLR AliceLR merged commit 442a702 into master Nov 1, 2024
16 checks passed
@AliceLR AliceLR deleted the remove-fix-viewport-ratio branch November 1, 2024 06:49
AliceLR added a commit that referenced this pull request Nov 1, 2024
@AliceLR AliceLR mentioned this pull request Nov 1, 2024
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant