diff options
author | Jeff Ward <jeff@fuzzybinary.com> | 2023-08-15 20:03:49 -0400 |
---|---|---|
committer | Jeff Ward <jeff@fuzzybinary.com> | 2023-09-19 22:33:32 -0400 |
commit | 60851af4daf2d64631cfa87718da068b2ae47a4f (patch) | |
tree | 57a4f354475ec8f2f1e1d18130590a57e615e520 /core/object/object.h | |
parent | 571cd0eb791b37e9a8adda9f909251138170f6b7 (diff) | |
download | redot-engine-60851af4daf2d64631cfa87718da068b2ae47a4f.tar.gz |
Add functions for non-ptr style virtual calls in GDExtension
This adds two functions to `GDExtensionClassCreationInfo` that allow for developers to supply a generic virtual call function along with user data to be sent to that call.
If `get_virutal_call_data_func` is not null, extensions call this function to get user data to pass to a supplied `call_virtual_with_data_func`. Both must be provided is one is provided.
If `get_virtual_call_data_func` is null, Godot falls back to the old `get_virtual_func` logic.
Fixes #63275
Co-authored-by: David Snopek <dsnopek@gmail.com>
Diffstat (limited to 'core/object/object.h')
-rw-r--r-- | core/object/object.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/object/object.h b/core/object/object.h index 3a698f7526..7da1c68edf 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -347,6 +347,8 @@ struct ObjectGDExtension { GDExtensionClassCreateInstance create_instance; GDExtensionClassFreeInstance free_instance; GDExtensionClassGetVirtual get_virtual; + GDExtensionClassGetVirtualCallData get_virtual_call_data; + GDExtensionClassCallVirtualWithData call_virtual_with_data; }; #define GDVIRTUAL_CALL(m_name, ...) _gdvirtual_##m_name##_call<false>(__VA_ARGS__) |