forked from libsdl-org/SDL
-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[OGC] Add support for Custom Aspect Ratios #91
Open
Fancy2209
wants to merge
26
commits into
devkitPro:ogc-sdl-2.28
Choose a base branch
from
Fancy2209:Widescreen
base: ogc-sdl-2.28
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8eaebcf
Adds WIP Widescreen Support
Fancy2209 37151df
Fix Cursor
Fancy2209 62191d5
Add orthoWidth to draw init log
Fancy2209 19e2688
Delete accidentally commited file
Fancy2209 e1f2bfd
Fix orthoWidth in Renderer
Fancy2209 6570d34
Add missing include
Fancy2209 4a73bb7
Remove resizing from Renderer, doesn't work properly
Fancy2209 fc69931
Fix SDL Renderer and OGC_set_viewport
Fancy2209 ab85398
Remove debug logging
Fancy2209 d6efcad
Update src/render/ogc/SDL_render_ogc.c
Fancy2209 4dc34db
Apply reviews
Fancy2209 7afc872
Merge branch 'Widescreen' of https://github.com/Fancy2209/SDL into Wi…
Fancy2209 016de5f
Close comment
Fancy2209 a5d6187
Expand comment
Fancy2209 7fc3f5c
Fix build
Fancy2209 052e287
Fix Widescreen Vide Mode Width Calculation
Fancy2209 027d5d2
Fix mouse Widescreen Viewport
Fancy2209 5219b8f
Revert ogcmouse changes, simply swap the names of screen_w and viewpo…
Fancy2209 d1b37b4
Assorted Fixes
Fancy2209 412eb51
Delete .vscode
Fancy2209 e254a96
Better region check when setting the video mode center point
Fancy2209 072708b
Make code much cleaner
Fancy2209 95c62a7
Merge branch 'Widescreen' of https://github.com/Fancy2209/SDL into Wi…
Fancy2209 40e5e47
Remove unused header
Fancy2209 984d25b
Add SDL_OGC_ASPECT_RATIO
Fancy2209 ad259a7
Make OGC_get_aspect_ratio return a float and scale the mouse only bas…
Fancy2209 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that GX_SetViewport and GX_SetScissor can be set to the EFB size (that is, we can consider
w
andh
to be in pixels), and if we want to play with the aspect ratio we can play with the width parameter passed to guOrtho.In other words, I would set leave the calls to GX_SetViewport and GX_SetScissor exactly as they were, then call OGC_get_aspect_ratio_dimensions right from within this function and call
Of course, this needs to be checked. :-) The thing is, if you pass the same values to both functions (GX_SetViewport and guOrtho) you get a 1:1 mapping, which is not what we want for widescreen cases (or for any case where the ratio is not 4/3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave up aspect correcting apps that aren't using 16:9
Fixing this here would cause issues, as I've showed before it makes VVVVVVV less wide than it should.
The whole guOrtho thing being a new var really felt like a hack, and I think leaving it as is is the best approach, especially since some apps resize the viewport twice every frame and it will distort the image more than it should if we do it