compat.godot-cpp
#includeC++ bindings for the Godot GDExtension API (pre-generated bindings, no Python/SCons needed)
#include <godot_cpp/classes/editor_dock.hpp>
mcpp add compat.godot-cpp@10.0.0-rc1
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// Behavioral test for compat.godot-cpp 10.0.0-rc1 -- godot-cpp's own 10.x
// version line, whose bindings target Godot 4.6.
//
// The point of a second member is that it can tell the two versions apart, so
// the first thing asserted is WHICH bindings arrived: the generated version
// header and a class that exists in 4.6 and not in 4.5. The rest mirrors the
// 4.5 member so a behavioural difference between the two would show up as a
// diff between two otherwise identical tests.
//
// As there, everything asserted is pure math or compile-time: anything routed
// through the gdextension_interface_* pointers needs a Godot process that has
// loaded the extension.
#include <godot_cpp/classes/editor_dock.hpp> // new in Godot 4.6
#include <godot_cpp/classes/global_constants.hpp>
#include <godot_cpp/classes/node.hpp>
#include <godot_cpp/core/version.hpp>
#include <godot_cpp/variant/aabb.hpp>
#include <godot_cpp/variant/basis.hpp>
#include <godot_cpp/variant/color.hpp>
#include <godot_cpp/variant/vector2.hpp>
#include <godot_cpp/variant/vector3.hpp>
// …
tests/examples/godot-cpp-v10/tests/godot_cpp_v10.cpp · 项目 tests/examples/godot-cpp-v10
构建
- targets
godot-cpp (lib)- language
c++23- import std
- no
- include dirs
*/include, */gen/include, */gdextension
特性
| 特性 | 声明了 |
|---|---|
| default | implies |
| gdextension | defines |
源文件 (4)
*/src/*.cpp*/src/*/*.cpp*/gen/src/*.cpp*/gen/src/*/*.cpp