-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update dynamic values in the Device context #20
Conversation
@@ -73,6 +73,7 @@ Dictionary make_device_context(const Ref<RuntimeConfig> &p_runtime_config) { | |||
device_context["model"] = model; | |||
} | |||
|
|||
// Note: Godot Engine doesn't support changing screen resolution. |
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.
Like, ever? How do Godot games support different screens?
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.
Godot doesn't change the physical resolution of your desktop environment, it changes resolution scale instead. I.e., projects 720p on 1080p resolution, for example, like consoles do. Most modern games do the same, some also support changing the real resolution. But this way it makes Alt-Tab
faster, and fewer issues with it. Upscaling is cheap these days.
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.
So the resolution reported is the actual, physical screen resolution and not the resolution the game was running in?
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.
Yep. The rendering resolution is referred to as the viewport size (of the window), and you can have multiple windows as well, on different displays - it can get really complicated. You can also have nested viewports, so technically, the game could be rendered at higher resolution nested viewport, downscaled to window viewport size and upscaled to main screen resolution. 😄 Not that I recommend it.
Reference to doc: https://docs.godotengine.org/en/stable/tutorials/rendering/multiple_resolutions.html
2bcfe22
to
c707078
Compare
The current default is to set context values during initialization, which works for most cases. The only context that is currently updated is "godot_performance".
This PR introduces a code path that updates values in the standard
Device
context just before the event is sent.Values that are dynamically updated in the Device context with this PR:
orientation
,free_memory
,usable_memory
,free_storage
.