-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgodot_hyperbolic3d_defines.h
More file actions
74 lines (64 loc) · 2.57 KB
/
Copy pathgodot_hyperbolic3d_defines.h
File metadata and controls
74 lines (64 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
// This file should be included before any other files.
// Uncomment one of these to help IDEs detect the build mode.
// The build system already defines one of these, so keep them
// commented out when committing.
#ifndef GDEXTENSION
//#define GDEXTENSION 1
#endif // GDEXTENSION
#ifndef GODOT_MODULE
//#define GODOT_MODULE 1
#endif // GODOT_MODULE
#if GDEXTENSION
// Extremely common classes used by most files. Customize for your extension as needed.
#include <godot_cpp/classes/ref.hpp>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/core/version.hpp>
#include <godot_cpp/variant/string.hpp>
#define CoreBind godot
#define GDEXTMOD_GUI_INPUT _gui_input
#define GET_NODE_TYPE(m_parent, m_type, m_path) m_parent->get_node<m_type>(NodePath(m_path))
// Including the namespace helps make GDExtension code more similar to module code.
using namespace godot;
#elif GODOT_MODULE
#include "core/object/class_db.h"
#include "core/string/ustring.h"
#include "core/version.h"
#define GDEXTMOD_GUI_INPUT gui_input
#define GET_NODE_TYPE(m_parent, m_type, m_path) Object::cast_to<m_type>(m_parent->get_node(NodePath(m_path)))
#define MOUSE_BUTTON_LEFT MouseButton::LEFT
#ifndef GODOT_VERSION_MAJOR
// Prior to Godot 4.5, the Godot version macros were just "VERSION_*" which did not match the godot-cpp API.
// See https://github.com/godotengine/godot/pull/103557
#define GODOT_VERSION_MAJOR VERSION_MAJOR
#define GODOT_VERSION_MINOR VERSION_MINOR
#define GODOT_VERSION_PATCH VERSION_PATCH
#endif
#if GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR > 6)
// In Godot 4.7, callable_mp was moved to its own header.
#include "core/object/callable_mp.h"
#endif
#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR < 6
// Prior to Godot 4.6, the internal API of free_rid in RenderingServer and other servers did not match the exposed API.
// See https://github.com/godotengine/godot/pull/107139
#define free_rid free
#endif
#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR < 5
// In Godot 4.5 and later, namespaces were capitalized: core_bind -> CoreBind.
#define CoreBind core_bind
#endif
#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR > 4
// In Godot 4.5 and later, Math_TAU was replaced with Math::TAU, and a few other things also moved to the Math namespace.
#define ABS Math::abs
#define Math_E Math::E
#define Math_PI Math::PI
#define Math_SQRT12 Math::SQRT12
#define Math_SQRT2 Math::SQRT2
#define Math_TAU Math::TAU
#endif
#else
#error "Must build as Godot GDExtension or Godot module."
#endif
#ifndef _NO_DISCARD_
#define _NO_DISCARD_ [[nodiscard]]
#endif // _NO_DISCARD_