38ee8bfcf7
This makes sure custom constructors are always called on extension classes. However, note that constructors should not take any parameters, since Godot doesn't support that. Parameters are ignore in memnew macro. Use memnew(MyClass()) instead of memnew(MyClass) since it now needs a value instead of a class name. This macro calls MyClass::_new() (define in GDCLASS macro) which ultimately calls Godot to create the object, ensuring that both the Godot and the extension instances are created. Non Godot classes (that don't derive godot::Object) are constructed as usual an can have parameters. memdelete is also changed for the same reason, as it needs to destroy the Godot object as well, and that automatically frees the bound extension instance. |
||
---|---|---|
.. | ||
binder_common.hpp | ||
builtin_ptrcall.hpp | ||
class_db.hpp | ||
defs.hpp | ||
engine_ptrcall.hpp | ||
error_macros.hpp | ||
math.hpp | ||
memory.hpp | ||
method_bind.hpp | ||
method_ptrcall.hpp | ||
object.hpp | ||
type_info.hpp |