diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-16 14:40:52 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-16 14:41:07 +0100 |
commit | 7a79eee5234b48334c32099e55c16cc7068c0174 (patch) | |
tree | c6e08b5fc1a15c14a1556c7102cf2811c648640b | |
parent | fd60724c3d6ccc3007a9c9555cca5555f789cd91 (diff) |
Expose OS::get_current_video_driver to scripting languages
-rw-r--r-- | core/bind/core_bind.cpp | 13 | ||||
-rw-r--r-- | core/bind/core_bind.h | 9 | ||||
-rw-r--r-- | doc/classes/Animation.xml | 6 | ||||
-rw-r--r-- | doc/classes/MultiMesh.xml | 18 | ||||
-rw-r--r-- | doc/classes/OS.xml | 17 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 18 | ||||
-rw-r--r-- | doc/classes/TabContainer.xml | 2 | ||||
-rw-r--r-- | doc/classes/Tabs.xml | 2 |
8 files changed, 72 insertions, 13 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index f17d7372e2..f6828ea76a 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -225,8 +225,12 @@ int _OS::get_video_driver_count() const { return OS::get_singleton()->get_video_driver_count(); } -String _OS::get_video_driver_name(int p_driver) const { - return OS::get_singleton()->get_video_driver_name(p_driver); +String _OS::get_video_driver_name(VideoDriver p_driver) const { + return OS::get_singleton()->get_video_driver_name((int)p_driver); +} + +_OS::VideoDriver _OS::get_current_video_driver() const { + return (VideoDriver)OS::get_singleton()->get_current_video_driver(); } int _OS::get_audio_driver_count() const { @@ -1108,6 +1112,8 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_video_driver_count"), &_OS::get_video_driver_count); ClassDB::bind_method(D_METHOD("get_video_driver_name", "driver"), &_OS::get_video_driver_name); + ClassDB::bind_method(D_METHOD("get_current_video_driver"), &_OS::get_current_video_driver); + ClassDB::bind_method(D_METHOD("get_audio_driver_count"), &_OS::get_audio_driver_count); ClassDB::bind_method(D_METHOD("get_audio_driver_name", "driver"), &_OS::get_audio_driver_name); ClassDB::bind_method(D_METHOD("get_connected_midi_inputs"), &_OS::get_connected_midi_inputs); @@ -1276,6 +1282,9 @@ void _OS::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "window_position"), "set_window_position", "get_window_position"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "window_size"), "set_window_size", "get_window_size"); + BIND_ENUM_CONSTANT(VIDEO_DRIVER_GLES2); + BIND_ENUM_CONSTANT(VIDEO_DRIVER_GLES3); + BIND_ENUM_CONSTANT(DAY_SUNDAY); BIND_ENUM_CONSTANT(DAY_MONDAY); BIND_ENUM_CONSTANT(DAY_TUESDAY); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 1c8b985d73..f3bc4644d8 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -103,6 +103,11 @@ protected: static _OS *singleton; public: + enum VideoDriver { + VIDEO_DRIVER_GLES3, + VIDEO_DRIVER_GLES2, + }; + enum PowerState { POWERSTATE_UNKNOWN, /**< cannot determine power status */ POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ @@ -152,7 +157,8 @@ public: Array get_fullscreen_mode_list(int p_screen = 0) const; virtual int get_video_driver_count() const; - virtual String get_video_driver_name(int p_driver) const; + virtual String get_video_driver_name(VideoDriver p_driver) const; + virtual VideoDriver get_current_video_driver() const; virtual int get_audio_driver_count() const; virtual String get_audio_driver_name(int p_driver) const; @@ -355,6 +361,7 @@ public: _OS(); }; +VARIANT_ENUM_CAST(_OS::VideoDriver); VARIANT_ENUM_CAST(_OS::PowerState); VARIANT_ENUM_CAST(_OS::Weekday); VARIANT_ENUM_CAST(_OS::Month); diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index a7cae709a4..eaaa64d53d 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -648,6 +648,12 @@ The animation step value. </member> </members> + <signals> + <signal name="tracks_changed"> + <description> + </description> + </signal> + </signals> <constants> <constant name="TYPE_VALUE" value="0" enum="TrackType"> Value tracks set values in node properties, but only those which can be Interpolated. diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 7986461840..565e19c229 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -48,6 +48,14 @@ Return the transform of a specific instance. </description> </method> + <method name="get_instance_transform_2d" qualifiers="const"> + <return type="Transform2D"> + </return> + <argument index="0" name="instance" type="int"> + </argument> + <description> + </description> + </method> <method name="set_instance_color"> <return type="void"> </return> @@ -81,6 +89,16 @@ Set the transform for a specific instance. </description> </method> + <method name="set_instance_transform_2d"> + <return type="void"> + </return> + <argument index="0" name="instance" type="int"> + </argument> + <argument index="1" name="transform" type="Transform2D"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="color_format" type="int" setter="set_color_format" getter="get_color_format" enum="MultiMesh.ColorFormat"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index f6ad71b6e2..5e71ed094e 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -159,6 +159,13 @@ <description> </description> </method> + <method name="get_current_video_driver" qualifiers="const"> + <return type="int" enum="OS.VideoDriver"> + </return> + <description> + Returns the currently used video driver, using one of the values from [enum OS.VideoDriver]. + </description> + </method> <method name="get_date" qualifiers="const"> <return type="Dictionary"> </return> @@ -459,14 +466,16 @@ <return type="int"> </return> <description> + Returns the number of video drivers supported on the current platform. </description> </method> <method name="get_video_driver_name" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="driver" type="int"> + <argument index="0" name="driver" type="int" enum="OS.VideoDriver"> </argument> <description> + Returns the name of the video driver matching the given [code]driver[/code] index. This index is a value from [enum OS.VideoDriver], and you can use [method get_current_video_driver] to get the current backend's index. </description> </method> <method name="get_virtual_keyboard_height"> @@ -806,6 +815,12 @@ </member> </members> <constants> + <constant name="VIDEO_DRIVER_GLES2" value="1" enum="VideoDriver"> + The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web. + </constant> + <constant name="VIDEO_DRIVER_GLES3" value="0" enum="VideoDriver"> + The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web. + </constant> <constant name="DAY_SUNDAY" value="0" enum="Weekday"> Sunday. </constant> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 09b9167149..0f795b4bf8 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -74,15 +74,15 @@ Return the ID of the item at index [code]idx[/code]. </description> </method> - <method name="get_item_index" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <description> - Return the index of the item with the given [code]id[/code]. - </description> - </method> + <method name="get_item_index" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + Return the index of the item with the given [code]id[/code]. + </description> + </method> <method name="get_item_metadata" qualifiers="const"> <return type="Variant"> </return> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 04285b62df..3c5bc25def 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -216,6 +216,8 @@ </theme_item> <theme_item name="tab_bg" type="StyleBox"> </theme_item> + <theme_item name="tab_disabled" type="StyleBox"> + </theme_item> <theme_item name="tab_fg" type="StyleBox"> </theme_item> <theme_item name="top_margin" type="int"> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index de57250d8b..b22d9d73da 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -279,6 +279,8 @@ </theme_item> <theme_item name="tab_bg" type="StyleBox"> </theme_item> + <theme_item name="tab_disabled" type="StyleBox"> + </theme_item> <theme_item name="tab_fg" type="StyleBox"> </theme_item> <theme_item name="top_margin" type="int"> |