5 ms·
How do you use c++ in Godot? GDExtention?
by hotdogscout 3y ago
How do you use c++ in Godot?
GDExtention?
- gumballindie 3y agoIndeed: https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html https://docs.godotengine.org/en/stable/tutorials/scripting/g... You only need to make sure your extension API file is in sync with any “main” engine version upgrades. And for major upgrades godot-cpp. Everything compiles really fast in both Linux and Windows and dependencies are easy to set-up. However, there is little C++ documentation but that is because once you get the gist of using their Ref<T> wrapper everything is intuitive (functions and methods map one to one from GDScript). Just download their example and have a look around. Also the engine’s code is _very_ easy to follow if you get stuck and can itself be used as samples. I am really rusty (even rust can be used btw) with C++ and was able to pick things up quite fast. Let me know if you have any questions. But really all I needed to start was their example above.
- hotdogscout 3y agoI've been using SDL 2.0 + GLAD because I thought Godot was iffy with c++, I'll try following their example. Thank you so much.
- TillE 3y ago> Also the engine’s code is _very_ easy to follow This is one of the best parts of Godot, it's small enough to compile pretty quickly, and simple enough that you can jump in and understand the code and debug any problems with minimal friction. The maintainers are also good about quickly accepting small bug fix PRs. And yeah, the development experience with GDExtension is now really nice, though it's best to do a little work to set up a CMake project rather than relying on scons.