0 votes

enter image description hereI'd like to use a 3rd party library written in C++ and include it in my gdscript in order to control the logic of the game. I've heard about gdnative. How can I use those C++ library files and interface them with the gdscript code without having to modify those file (too many of them) ? What I need is use these library as an API from gdscript.

Something like in the figure.
PS: I read the tutorial here but it talks only about one file with godot headers. But couldn't understand how I can talk with that 3rd party code.

in Engine by (14 points)

there are two ways to do it. GDNative or C++ modules

GDNative only exposes a subset of what you can do with c++ modules

you kinda have to be more specific and what classes you wish to touch


1 Answer

+1 vote

The tutorial in the news is obsolete now. Up to date documentation is pending to be written anytime soon, but in the meantime this example exists: https://github.com/GodotNativeTools/GDNative-demos/tree/master/c/SimpleDemo (that one is in pure C though).

There is also this C++ demo: https://github.com/GodotNativeTools/GDNative-demos/tree/master/cpp/kinematic_character

by (29,042 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.