You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Merge pull request #111334 from Calinou/doc-displayserver-refresh-rate-vsync
Document relationship between refresh rate and V-Sync in DisplayServer
This commit is contained in:
@@ -1789,11 +1789,11 @@
|
||||
[b]Note:[/b] One of the following constants can be used as [param screen]: [constant SCREEN_OF_MAIN_WINDOW], [constant SCREEN_PRIMARY], [constant SCREEN_WITH_MOUSE_FOCUS], or [constant SCREEN_WITH_KEYBOARD_FOCUS].
|
||||
</description>
|
||||
</method>
|
||||
<method name="screen_get_refresh_rate" qualifiers="const">
|
||||
<method name="screen_get_refresh_rate" qualifiers="const" keywords="vsync">
|
||||
<return type="float" />
|
||||
<param index="0" name="screen" type="int" default="-1" />
|
||||
<description>
|
||||
Returns the current refresh rate of the specified screen. Returns [code]-1.0[/code] if [param screen] is invalid or the [DisplayServer] fails to find the refresh rate for the specified screen.
|
||||
Returns the current refresh rate of the specified screen. When V-Sync is enabled, this returns the maximum framerate the project can effectively reach. Returns [code]-1.0[/code] if [param screen] is invalid or the [DisplayServer] fails to find the refresh rate for the specified screen.
|
||||
To fallback to a default refresh rate if the method fails, try:
|
||||
[codeblock]
|
||||
var refresh_rate = DisplayServer.screen_get_refresh_rate()
|
||||
|
||||
Reference in New Issue
Block a user