This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

GDNative C++ Beginner questions

panicqpanicq Posts: 54Member
edited February 2020 in Programming


I'm quite new to GDNative C++, however I managed to create simple scripts following the documentation but I still have some questions:

1) What are the best practices for memory management ? I've seen that a lot of classes have a static _new() method but how should I manage the memory of the object (delete, share etc...) ?
2) How can I use the Dictionary class ? It's not templated and only accepts Variants.
3) How can I cast nodes (in order to use get_node properly) ?
4) Where can I find more documentation about PoolArrays (initialization for instance) ?
5) What is Ref used for ? Is it like a smart pointer ?

I'm sure I will have more soon or later :D

Thank you in advance !

Tags :

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.