Scaffold base build files for dual mode
This commit is contained in:
@@ -1,5 +1,46 @@
|
||||
//
|
||||
// Created by andrew on 3/17/26.
|
||||
//
|
||||
#include "register_types.h"
|
||||
|
||||
#include "register_types.h"
|
||||
#ifdef GD_EXTENSION_BUILD
|
||||
#include <gdextension_interface.h>
|
||||
#include <godot_cpp/core/defs.hpp>
|
||||
#include <godot_cpp/godot.hpp>
|
||||
|
||||
using namespace godot;
|
||||
|
||||
void initialize_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Register classes here
|
||||
}
|
||||
|
||||
void uninitialize_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
// Initialization.
|
||||
GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||
godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
|
||||
|
||||
init_obj.register_initializer(initialize_module);
|
||||
init_obj.register_terminator(uninitialize_module);
|
||||
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
|
||||
|
||||
return init_obj.init();
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(GODOT_MODULE_BUILD)
|
||||
#include "register_types.h"
|
||||
|
||||
void register_types() {
|
||||
// Register classes here
|
||||
}
|
||||
|
||||
void unregister_types() {
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user