godot-cpp/include/godot_cpp
George Marques 38ee8bfcf7 Change constructor/destructor management of extension classes
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.
2021-09-27 23:08:11 +10:00
..
classes Change constructor/destructor management of extension classes 2021-09-27 23:08:11 +10:00
core Change constructor/destructor management of extension classes 2021-09-27 23:08:11 +10:00
variant Fix formatting of files 2021-09-27 23:08:10 +10:00
godot.hpp Add in driver types and rejig code to make it easier to extend 2021-09-27 23:08:11 +10:00