diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 83a6fe0940..ed923c1c4b 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -170,6 +170,8 @@ protected: } \ \ public: \ + typedef m_class self_type; \ + \ static void initialize_class() { \ static bool initialized = false; \ if (initialized) { \ @@ -372,6 +374,8 @@ protected: } \ \ public: \ + typedef m_class self_type; \ + \ static void initialize_class() {} \ \ static ::godot::StringName &get_class_static() { \ @@ -381,6 +385,17 @@ public: \ static ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ + } \ + \ + static GDExtensionObjectPtr create(void *data) { \ + return nullptr; \ + } \ + \ + static GDExtensionClassInstancePtr recreate(void *data, GDExtensionObjectPtr obj) { \ + return nullptr; \ + } \ + \ + static void free(void *data, GDExtensionClassInstancePtr ptr) { \ } \ \ static void *_gde_binding_create_callback(void *p_token, void *p_instance) { \ diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index 46032fb958..bafd2ce1b3 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -173,6 +173,7 @@ class ClassDB { template void ClassDB::_register_class(bool p_virtual) { + static_assert(TypesAreSame::value, "Class not declared properly, please use GDCLASS."); instance_binding_callbacks[T::get_class_static()] = &T::_gde_binding_callbacks; // Register this class within our plugin