-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge/cleanup renderer viewport calculation code. (#496)
`fix_viewport_ratio` has been replaced with renderer-specific viewport initialization functions `set_window_viewport_centered` and `set_window_viewport_scaled`. The renderer callback `set_viewport` is now assigned to one of these, and is called by the function `video_window_update_viewport`, which must be called by the `create_window` function if it changes the window size. The window viewport is used in places that previously called `fix_viewport_ratio`, which was primarily setting SDL update rects and `glViewport`. It is also used to convert between window space and screen space coordinates, which was previously done by two renderer callbacks `get_screen_coords` and `set_screen_coords`. These callbacks have been dummied out and the merged replacements `get_screen_coords_viewport`/`set_screen_coords_viewport` are called directly instead. If these callbacks are needed again in the future, they can be uncommented (the only place that used custom implementations was the GP2X renderer). Finally, the viewport ratio is provided to `set_viewport` as a numerator and denominator now instead of as an enum. This allows `create_window` and `resize_window` to modify the ratio for cases such as non-square pixels (as the GX renderer was doing with a hack previously). This must be done in both functions if used.
- Loading branch information
Showing
24 changed files
with
530 additions
and
346 deletions.
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
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
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
Oops, something went wrong.