https://github.com/gilzoide/high-level-gdnative-example
Example project for High level GDNative C/C++ API (HGDN)
https://github.com/gilzoide/high-level-gdnative-example
gdnative godot godot-engine
Last synced: about 1 month ago
JSON representation
Example project for High level GDNative C/C++ API (HGDN)
- Host: GitHub
- URL: https://github.com/gilzoide/high-level-gdnative-example
- Owner: gilzoide
- License: unlicense
- Created: 2021-06-29T23:56:32.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-01T14:22:31.000Z (almost 5 years ago)
- Last Synced: 2025-04-07T20:50:08.072Z (about 1 year ago)
- Topics: gdnative, godot, godot-engine
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example project for [High level GDNative C/C++ API (HGDN)](https://github.com/gilzoide/high-level-gdnative)
This project is a working example of HGDN usage. The source C code is located
in the [gdnative](gdnative) folder, with a [Makefile](gdnative/Makefile) for
building it.
The `GDNativeLibrary` Resource [gdnative/example.gdnlib](gdnative/example.gdnlib)
is configured with the Makefile targets' outputs and there is an example of
calling the functions directly using `GDNative.call_native` from GDScript in
the [example_call_native.gd](example_call_native.gd) file.
## Building the GDNative library
Run `make ` command from the `gdnative` folder. If running from project
root, add `-C gdnative` to tell `make` that the Makefile is in the `gdnative`
folder. Available targets are the following:
```sh
# Build for Windows x32. This uses MinGW if not running in Windows itself
$ make -C gdnative windows32
# Build for Windows x64. This uses MinGW if not running in Windows itself
$ make -C gdnative windows64
# Build for Linux x32
$ make -C gdnative linux32
# Build for Linux x64
$ make -C gdnative linux64
# Build for WebAssembly with Emscripten. HTML5 export preset must have GDNative enabled.
$ make -C gdnative wasm32
# Shorthand for building all targets described above at once
$ make -C gdnative all
```
TODO:
- Test Makefile on Windows, possibly will work only for Cygwin/MinGW
- Add OSX, Android and iOS targets