dik what this was but pushing ancient changes

This commit is contained in:
2024-10-18 18:00:23 -04:00
parent e7201941fe
commit fdeb0bae4f
28 changed files with 161 additions and 47 deletions

8
Source/Library.hpp Normal file
View File

@ -0,0 +1,8 @@
#pragma once
namespace SE {
}

View File

@ -21,14 +21,14 @@ sources = Glob("./*.cpp")
if env["platform"] == "osx":
library = env.SharedLibrary(
EditorDir + "/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
EditorDir + "/bin/SENative.{}.{}.framework/SENative.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
else:
library = env.SharedLibrary(
EditorDir + "/bin/libgdexample.{}.{}.{}{}".format(
EditorDir + "/bin/SENative.{}.{}.{}{}".format(
env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"]
),
source=sources,

View File

@ -1,7 +1,7 @@
#include "gdexample.h"
namespace godot {
namespace SE {
#pragma region GodotRT
@ -37,4 +37,4 @@ GDExample::~GDExample()
{}
} // godot
} // SE

View File

@ -3,7 +3,10 @@
#include <godot_cpp/godot.hpp>
#include <godot_cpp/classes/sprite2d.hpp>
namespace godot {
namespace SE {
using namespace godot;
class GDExample : public Sprite2D
{
@ -26,4 +29,5 @@ public:
~GDExample();
};
}
} // SE

View File

@ -3,18 +3,20 @@
#include "gdexample.h"
namespace godot {
void register_types(ModuleInitializationLevel p_level)
void register_types(godot::ModuleInitializationLevel p_level)
{
using namespace godot;
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE)
return;
ClassDB::register_class<GDExample>();
ClassDB::register_class<SE::GDExample>();
}
void unregister_types(ModuleInitializationLevel p_level)
void unregister_types(godot::ModuleInitializationLevel p_level)
{
using namespace godot;
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE)
return;
@ -24,12 +26,14 @@ void unregister_types(ModuleInitializationLevel p_level)
extern "C"
{
GDNativeBool GDN_EXPORT
example_library_init(
SENative_Init(
GDNativeInterface const* p_interface,
GDNativeExtensionClassLibraryPtr const p_library,
GDNativeInitialization* r_initialization)
{
godot::GDExtensionBinding::InitObject
using namespace godot;
GDExtensionBinding::InitObject
init_obj(p_interface, p_library, r_initialization);
init_obj.register_initializer(register_types);
init_obj.register_terminator(unregister_types);
@ -39,5 +43,3 @@ extern "C"
}
}
} // godot

View File

@ -1,4 +1,9 @@
#pragma once
void register_types();
void unregister_types();
namespace godot
{
enum ModuleInitializationLevel : int;
}
void register_types(godot::ModuleInitializationLevel p_level);
void unregister_types(godot::ModuleInitializationLevel p_level);