diff --git a/html/globals.html b/html/globals.html new file mode 100644 index 0000000..88b6a06 --- /dev/null +++ b/html/globals.html @@ -0,0 +1,93 @@ + + + + + + + +godot-cpp-utils: File Members + + + + + + + + + + +
+
+ + + + + + +
+
godot-cpp-utils +
+
A collection of utility classes, functions and macros for use with Godot and GDExtension.
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented file members with links to the documentation:
+
+ + + + diff --git a/html/globals_defs.html b/html/globals_defs.html new file mode 100644 index 0000000..1ef7741 --- /dev/null +++ b/html/globals_defs.html @@ -0,0 +1,93 @@ + + + + + + + +godot-cpp-utils: File Members + + + + + + + + + + +
+
+ + + + + + +
+
godot-cpp-utils +
+
A collection of utility classes, functions and macros for use with Godot and GDExtension.
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented macros with links to the documentation:
+
+ + + + diff --git a/html/godot__macros_8h.html b/html/godot__macros_8h.html new file mode 100644 index 0000000..3ab9b1a --- /dev/null +++ b/html/godot__macros_8h.html @@ -0,0 +1,439 @@ + + + + + + + +godot-cpp-utils: godot_macros.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
godot-cpp-utils +
+
A collection of utility classes, functions and macros for use with Godot and GDExtension.
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
+Macros
+
godot_macros.h File Reference
+
+
+ +

C-style preprocessor macros to simplify using godot's C++ API. +More...

+
#include "godot_cpp/classes/engine.hpp"
+#include "godot_cpp/core/class_db.hpp"
+#include "godot_cpp/variant/string.hpp"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

+#define MACRO_STRING_INNER(_Arg)   #_Arg
 
+#define MACRO_STRING(_Arg)   MACRO_STRING_INNER(_Arg)
 
#define GDPROPERTY(PropName_, PropType_)
 Register property.
 
#define GDPROPERTY_HINTED(PropName_, PropType_, ...)
 Register a hinted property.
 
#define GDFUNCTION(FnName_)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)
 Register a function.
 
#define GDFUNCTION_ARGS(FnName_, ...)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
 Register a function with arguments.
 
#define GDFUNCTION_STATIC(FnName_)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)
 Register a static function.
 
#define GDFUNCTION_STATIC_ARGS(FnName_, ...)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
 Register a static function with arguments.
 
#define GDSIGNAL(...)   godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))
 Declare a godot Observer signal.
 
#define GDRESOURCETYPE(Class_)   godot::vformat("%s/%s:%s", godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)
 Construct godot resource type hint.
 
#define GDEDITORONLY()   if(!godot::Engine::get_singleton()->is_editor_hint()) return;
 Execute the rest of the function only if currently running as editor.
 
#define GDGAMEONLY()   if(godot::Engine::get_singleton()->is_editor_hint()) return;
 Execute the rest of the function only if currently running as game.
 
#define GDENUM(Name_, ...)
 Declare a scoped enum struct.
 
+

Detailed Description

+

C-style preprocessor macros to simplify using godot's C++ API.

+

Macro Definition Documentation

+ +

◆ GDEDITORONLY

+ +
+
+ + + + + + + +
#define GDEDITORONLY()   if(!godot::Engine::get_singleton()->is_editor_hint()) return;
+
+ +

Execute the rest of the function only if currently running as editor.

+

Useful for _ready, _enter/_exit, _process, etc. functions.

+ +
+
+ +

◆ GDENUM

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define GDENUM( Name_,
 ... 
)
+
+Value:
struct Name_ {\
+
enum Value {__VA_ARGS__};\
+
private:\
+
Value value{};\
+
public:\
+
static inline godot::String get_property_hint() { return godot::String(#__VA_ARGS__); }\
+
inline Name_(Value value): value{value} {}\
+
inline Name_(Name_ const &value): value{value.value} {}\
+
}
+
+

Declare a scoped enum struct.

+

Declares a struct Name_ with an enum Value and a single variable and a get_property_hint() function.

+ +
+
+ +

◆ GDFUNCTION

+ +
+
+ + + + + + + + +
#define GDFUNCTION( FnName_)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)
+
+ +

Register a function.

+

Register a function CLASSNAME::FnName_() to godot. Requires setting CLASSNAME as a #define first.

+ +
+
+ +

◆ GDFUNCTION_ARGS

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define GDFUNCTION_ARGS( FnName_,
 ... 
)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
+
+ +

Register a function with arguments.

+

Register a function CLASSNAME::FnName_(...) to godot. Requires setting CLASSNAME as a #define first.

+ +
+
+ +

◆ GDFUNCTION_STATIC

+ +
+
+ + + + + + + + +
#define GDFUNCTION_STATIC( FnName_)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)
+
+ +

Register a static function.

+

Register a static member function CLASSNAME::FnName_() to godot. Requires setting CLASSNAME as a #define first.

+ +
+
+ +

◆ GDFUNCTION_STATIC_ARGS

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define GDFUNCTION_STATIC_ARGS( FnName_,
 ... 
)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
+
+ +

Register a static function with arguments.

+

Register a static member function CLASSNAME::FnName_(...) to godot. Requires setting CLASSNAME as a #define first.

+ +
+
+ +

◆ GDGAMEONLY

+ +
+
+ + + + + + + +
#define GDGAMEONLY()   if(godot::Engine::get_singleton()->is_editor_hint()) return;
+
+ +

Execute the rest of the function only if currently running as game.

+

Useful for _ready, _enter/_exit, _process, etc. functions.

+ +
+
+ +

◆ GDPROPERTY

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define GDPROPERTY( PropName_,
 PropType_ 
)
+
+Value:
godot::ClassDB::bind_method(godot::D_METHOD("get_" #PropName_), &CLASSNAME::get_##PropName_); \
+
godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \
+
godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_), "set_" #PropName_, "get_" #PropName_)
+
+

Register property.

+

Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first. Also requires a CLASSNAME::get_PropName_ and CLASSNAME::set_PropName_ to exist.

+ +
+
+ +

◆ GDPROPERTY_HINTED

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define GDPROPERTY_HINTED( PropName_,
 PropType_,
 ... 
)
+
+Value:
godot::ClassDB::bind_method(godot::D_METHOD("get_" #PropName_), &CLASSNAME::get_##PropName_); \
+
godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \
+
godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_, __VA_ARGS__), "set_" #PropName_, "get_" #PropName_)
+
+

Register a hinted property.

+

Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first, and CLASSNAME::get_PropName and CLASSNAME::set_PropName_ to exist.

+ +
+
+ +

◆ GDRESOURCETYPE

+ +
+
+ + + + + + + + +
#define GDRESOURCETYPE( Class_)   godot::vformat("%s/%s:%s", godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)
+
+ +

Construct godot resource type hint.

+

Use when registering properties of arrays of resource classes.

+ +
+
+ +

◆ GDSIGNAL

+ +
+
+ + + + + + + + +
#define GDSIGNAL( ...)   godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))
+
+ +

Declare a godot Observer signal.

+

Declare the existence of a Observer signal to godot.

+ +
+
+
+ + + + diff --git a/html/search/defines_0.js b/html/search/defines_0.js new file mode 100644 index 0000000..2520b13 --- /dev/null +++ b/html/search/defines_0.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['gdeditoronly_0',['GDEDITORONLY',['../godot__macros_8h.html#a36c0da7ac54da4b5a5a9fe754e68eaa1',1,'godot_macros.h']]], + ['gdenum_1',['GDENUM',['../godot__macros_8h.html#a069154a04e2e9e1df6cbbec0a0fc8829',1,'godot_macros.h']]], + ['gdfunction_2',['GDFUNCTION',['../godot__macros_8h.html#aec4c8284cb9ea77c97a7037176081801',1,'godot_macros.h']]], + ['gdfunction_5fargs_3',['GDFUNCTION_ARGS',['../godot__macros_8h.html#abb5f0f48b26566dab84ff075fdc9fb4e',1,'godot_macros.h']]], + ['gdfunction_5fstatic_4',['GDFUNCTION_STATIC',['../godot__macros_8h.html#ab1d89a5d5f8e83ed25d64195e8e432b6',1,'godot_macros.h']]], + ['gdfunction_5fstatic_5fargs_5',['GDFUNCTION_STATIC_ARGS',['../godot__macros_8h.html#a26ae27fbaa531f900a2e3a2c339975df',1,'godot_macros.h']]], + ['gdgameonly_6',['GDGAMEONLY',['../godot__macros_8h.html#a33ac9c3bfce05f857cfdd472cb00ca89',1,'godot_macros.h']]], + ['gdproperty_7',['GDPROPERTY',['../godot__macros_8h.html#a3dab0009fb317e0fce558e09edd4964c',1,'godot_macros.h']]], + ['gdproperty_5fhinted_8',['GDPROPERTY_HINTED',['../godot__macros_8h.html#a9e70408fe612616931e2c251eb149114',1,'godot_macros.h']]], + ['gdresourcetype_9',['GDRESOURCETYPE',['../godot__macros_8h.html#ae0818ebba543d3c6e8a61f460509451f',1,'godot_macros.h']]], + ['gdsignal_10',['GDSIGNAL',['../godot__macros_8h.html#abed0b44fb9b7da904a745cd09219ddea',1,'godot_macros.h']]] +]; diff --git a/html/search/files_0.js b/html/search/files_0.js new file mode 100644 index 0000000..8d25cea --- /dev/null +++ b/html/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['godot_5fmacros_2eh_0',['godot_macros.h',['../godot__macros_8h.html',1,'']]] +];