diff options
| author | Karroffel <therzog@mail.de> | 2017-03-18 19:01:11 +0100 |
|---|---|---|
| committer | Karroffel <therzog@mail.de> | 2017-03-18 19:01:11 +0100 |
| commit | fe4f8b95812cd7d4d5ba67473388d8ba287e7c21 (patch) | |
| tree | 98135b3b6a335cc268159009744a9077aff6c927 /include/godot_cpp | |
| parent | cd1bec5515bb1977eb4fd680350d5fab9cec215b (diff) | |
| download | redot-cpp-fe4f8b95812cd7d4d5ba67473388d8ba287e7c21.tar.gz | |
added support for tool scripts
Diffstat (limited to 'include/godot_cpp')
| -rw-r--r-- | include/godot_cpp/Godot.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/godot_cpp/Godot.hpp b/include/godot_cpp/Godot.hpp index 13086c8..0fab5ba 100644 --- a/include/godot_cpp/Godot.hpp +++ b/include/godot_cpp/Godot.hpp @@ -54,6 +54,20 @@ void register_class() T::_register_methods(); } +template<class T> +void register_tool_class() +{ + godot_instance_create_func create = {}; + create.create_func = _godot_class_instance_func<T>; + + godot_instance_destroy_func destroy = {}; + destroy.destroy_func = _godot_class_destroy_func<T>; + + + godot_script_register_tool_class(T::___get_type_name(), T::___get_base_type_name(), create, destroy); + T::_register_methods(); +} + |
