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

Screen scaling proposal (RFC) #165

Open
anyputer opened this issue Jul 29, 2020 · 1 comment
Open

Screen scaling proposal (RFC) #165

anyputer opened this issue Jul 29, 2020 · 1 comment

Comments

@anyputer
Copy link

anyputer commented Jul 29, 2020

Proposal

It would be great if we had two new environment commands: RETRO_ENVIRONMENT_GET_RENDERED_HEIGHT and RETRO_ENVIRONMENT_GET_RENDERED_ASPECT_RATIO.
These would allow hardware rendered cores like N64, PlayStation, Wii emulators to output at the window's resolution!
Owners of ultrawide, ultra HD monitors get to use the aspect ratio and/or resolutions of their amazing screens.
Standalone emulators have these features and they're missing in RetroArch.

RETRO_ENVIRONMENT_GET_RENDERED_HEIGHT - Gets the window height that can be overridden by the frontend
RETRO_ENVIRONMENT_GET_RENDERED_ASPECT_RATIO - Gets the aspect ratio of the window that can be overridden by the frontend

Examples

ParaLLEl N64 can have a resolution option: "Auto" to render at the frontend-provided resolution. It would calculate the width based on the height and aspect ratio of the game.
Dolphin has options to render at a custom aspect ratio and pixel height in the standalone emulator. In this case the core can have "Auto" core options for resolution and aspect ratio.

Proposed Definitions

#define RETRO_ENVIRONMENT_GET_RENDERED_HEIGHT (61 | RETRO_ENVIRONMENT_EXPERIMENTAL)
                                            /* unsigned * --
                                            * Integer value that lets us know the height of the window.
                                            *
                                            * The returned value can be used by cores to automatically
                                            * scale the resolution how it sees fit.
                                            *
                                            * The returned value can be NULL. In this case the core should
                                            * use a sane default (i.e. native resolution in an emulator).
                                            *
                                            * A frontend could override this if desired.
                                            */
#define RETRO_ENVIRONMENT_GET_RENDERED_ASPECT_RATIO (62 | RETRO_ENVIRONMENT_EXPERIMENTAL)
                                            /* float * --
                                            * Float value that lets us know the aspect ratio of the window.
                                            *
                                            * The returned value can be used by cores as a suggestion
                                            * for scaling.
                                            *
                                            * The returned value can be NULL.
                                            *
                                            * A frontend could override this if desired.
                                            */

Unresolved Questions

  • Is rendered a good word for it? Maybe screen, window... the values can be overridden, and the doc comments should reflect that.
  • Would it be better to tackle Integer core configuration field #41 first? I don't think so.
  • Does this make the existing core options for resolution (and possibly aspect ratio) pointless? The frontend would be able to provide it, and emulators can set a core option for the native resolution if necessary.
  • Should we concern about rotation? I don't think so if the core needs to set it, and if RetroArch's Aspect Ratio override doesn't care either.
  • What settings would RetroArch have to override this? Can we use the Aspect Ratio setting, or do we need a new one? The setting for resolution could have values like Window Height (default), Window Height / 2, Core provided (would give NULL making it up to the core to figure it out, like by giving a native resolution).
  • Is the formatting in my proposed definitions correct? Does the explanation for the aspect ratio command suffice?
  • Do we need some sort of callback for when the window size changes? Or does it suffice to check if the current size is different from the previous... or something. Something convenient.
@anyputer
Copy link
Author

...what happens when the window height is greater than the width
this is flawed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant