Allow GDExtensions to register virtual methods and call them on scripts

This commit is contained in:
David Snopek
2024-01-30 11:25:25 -06:00
parent 36847f6af0
commit 8fbb7cf795
14 changed files with 316 additions and 2 deletions

View File

@@ -24,6 +24,7 @@
#include <godot_cpp/variant/variant.hpp>
#include <godot_cpp/core/binder_common.hpp>
#include <godot_cpp/core/gdvirtual.gen.inc>
using namespace godot;
@@ -181,6 +182,9 @@ public:
// Virtual function override (no need to bind manually).
virtual bool _has_point(const Vector2 &point) const override;
virtual void _input(const Ref<InputEvent> &event) override;
GDVIRTUAL2R(String, _do_something_virtual, String, int);
String test_virtual_implemented_in_script(const String &p_name, int p_value);
};
VARIANT_ENUM_CAST(Example::Constants);