summaryrefslogtreecommitdiffstats
path: root/test/src/example.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-09-21 04:01:28 +0200
committerBastiaan Olij <mux213@gmail.com>2021-09-27 23:08:11 +1000
commitb4632e317d06acac62b2d5f4af02ce4dbdd57687 (patch)
tree0a64f02f999c2530679e4bfe2e062628a8d58bc2 /test/src/example.cpp
parentcc88df05e7b58d64f65dd2137dc79324a3379b61 (diff)
downloadredot-cpp-b4632e317d06acac62b2d5f4af02ce4dbdd57687.tar.gz
Fix creation (and godot-side deletion) of extended objects.
Proper initialization for godot-cpp classes with memnew. Extension classes (i.e. the `GDCLASS` macro) behave differently from regular wrapped classes, and requires Godot to initialize them during object construction. This commit update the GDCLASS macro to not create/destroy the instance during the bindings callback, but during the extension callbacks. When setting the object instance, the bindings instance is set to the pointer of the extension instance so that it can later be retrieved normally via `object_get_instance_bindings`.
Diffstat (limited to 'test/src/example.cpp')
0 files changed, 0 insertions, 0 deletions