Open akien-mga opened 8 years ago
Is there maybe an unofficial C++ / GDNative tutorial for Godot so we can already start using it?
It could be added later here: https://godot.readthedocs.io/en/3.0/getting_started/scripting/index.html (referred on the page https://godot.readthedocs.io/en/3.0/about/faq.html#which-languages-are-supported-in-godot).
It would also be good to compare C++ and GDScript code, like it is done with C#: https://godot.readthedocs.io/en/3.0/getting_started/step_by_step/scripting.html#handling-a-signal
Having a working C++ only example would save me quite some troubles right now 👍
There is a tutorial which may be a little out of date http://docs.godotengine.org/en/latest/tutorials/plugins/gdnative/gdnative-cpp-example.html
There is also a lot of info on the GDNative Github https://github.com/GodotNativeTools/godot-cpp/blob/master/README.md
godotengine/godot#4525 and this issue were about writing Godot games in C++ by compiling the engine from source, most likely with modules which I don't think is possible right now (not without modifying the engine). GDNative and godot-cpp didn't exist at that point.
I'm still not sure if GDNative is what I want.
I need low-level, unrestricted Godot and C++ capabilities. I'm trying to figure out if I can port an existing game to Godot and having a limited scripting API is a non-starter.
Can I do with GDNative C++ bindings everything I could do when I would directly edit Godot's source code? (except directly removing or altering Godot functionality of course, I don't want to fork Godot and I'm trying to use it in a way which makes updating as simple as possible, while still having all low-level functionality)
That is also how I interpreted the original issue godotengine/godot#4525:
There is no easy way I can know how to use godot completely in C++.
So I want to make some things more clear in the documentation that I see as very unclear:
https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html
This is the tutorial I'm referencing btw. I can't find it in this repo.
It says in this note godot-cpp now includes godot_headers as a nested submodule
but then later says You should now have demo, godot-cpp, godot_headers, and src directories in your GDNative module.
Same Once you've downloaded the SConstruct file, place it in your GDNative module folder besides godot-cpp, godot_headers and demo, then run:
resource_name = "gdexample"
There is no explanation of resource name. Where does it come from? What is it's purpose?
Lastly, I think we need a concrete repo linked in this example that provides a working demo of it.
Thoughts? Answers? I'm glad to provide these changes with help.
resource_name = "gdexample" There is no explanation of resource name. Where does it come from? What is it's purpose?
In Godot, all Resources have a resource_name
property which is used for the purposes of serialization (and sometimes special purposes, like in GDNative).
But does it have to be called anything special, or does it just have to be unique? Like class name comes from the code.
But does it have to be called anything special, or does it just have to be unique?
I don't know, I haven't used GDNative myself. I don't have much time to dedicate to it, unfortunately :slightly_frowning_face:
Moved from https://github.com/godotengine/godot/issues/4525