Closed ashtonmeuser closed 1 year ago
I'm not really familiar with how this worked in GDNative - can you share how you expect to use the _new()
method?
Is there a reason you can't do something like:
Ref<Crypto> crypto;
crypto.instantiate();
Ref<CryptoKey> key = crypto->generate_rsa(4096);
I don't know what you're trying to do with the Crypt
class :-)
Thanks! That works. I was looking for a single-line replacement for Godot 3.x's Crypto::_new()->generate_random_bytes(n)
but this can be (hackily) achieved with [n]()->PackedByteArray{Ref<Crypto> c;c.instantiate();return c->generate_random_bytes(n);}()
. Closing this issue.
Godot version
4.1.2-stable
godot-cpp version
godot-4.1.2-stable
System information
MacOS 13.4, Windows 10
Issue description
The generated Crypto class has no way of declaring a new reference. In the Godot 3.x branch of the C++ bindings, there exists a static
_new()
method. No such method exists in the 4.x branch. That means that users must manually useunreference()
or errors indicating orphaned objects is thrown.Steps to reproduce
Build Godot C++ bindings. View resultant _godot-cpp/gen/include/godotcpp/classes/crypto.hpp file. Note that there is no static
_new()
method (or similar equivalent).Minimal reproduction project
N/A