Compare commits
2 commits
63d2c6994f
...
3066bdacc9
| Author | SHA1 | Date | |
|---|---|---|---|
| 3066bdacc9 | |||
| 2ab1ee403e |
13 changed files with 323698 additions and 4 deletions
17
.gitignore
vendored
17
.gitignore
vendored
|
|
@ -1,5 +1,8 @@
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot
|
# Compiled Object files from SCons
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot
|
*.os
|
||||||
|
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot,scons
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,scons
|
||||||
|
|
||||||
### C++ ###
|
### C++ ###
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
|
|
@ -52,4 +55,12 @@ export_presets.cfg
|
||||||
data_*/
|
data_*/
|
||||||
mono_crash.*.json
|
mono_crash.*.json
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/c++,godot
|
### SCons ###
|
||||||
|
# for projects that use SCons for building: http://http://www.scons.org/
|
||||||
|
.sconsign.dblite
|
||||||
|
|
||||||
|
# When configure fails, SCons outputs these
|
||||||
|
config.log
|
||||||
|
.sconf_temp
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/c++,godot,scons
|
||||||
|
|
|
||||||
11
README.md
11
README.md
|
|
@ -2,4 +2,13 @@
|
||||||
|
|
||||||
Named in this order so not everything starts with the same word
|
Named in this order so not everything starts with the same word
|
||||||
|
|
||||||
Using Godot v4.4.beta1.official [d33da79d3]
|
## Development
|
||||||
|
|
||||||
|
Using Godot v4.4.beta1.official [d33da79d3].
|
||||||
|
Install SCons with `pipx install scons`.
|
||||||
|
|
||||||
|
To build the extension run SCons in the repository root, the default arguments have been added to the file.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
scons
|
||||||
|
```
|
||||||
|
|
|
||||||
46
SConstruct
Normal file
46
SConstruct
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
env = SConscript("godot-cpp/SConstruct")
|
||||||
|
|
||||||
|
# For reference:
|
||||||
|
# - CCFLAGS are compilation flags shared between C and C++
|
||||||
|
# - CFLAGS are for C-specific compilation flags
|
||||||
|
# - CXXFLAGS are for C++-specific compilation flags
|
||||||
|
# - CPPFLAGS are for pre-processor flags
|
||||||
|
# - CPPDEFINES are for pre-processor defines
|
||||||
|
# - LINKFLAGS are for linking flags
|
||||||
|
|
||||||
|
# tweak this if you want to use different folders, or more folders, to store your source code in.
|
||||||
|
env.Append(CPPPATH=["src/"])
|
||||||
|
sources = Glob("src/*.cpp")
|
||||||
|
|
||||||
|
# Generated with local Godot installation
|
||||||
|
env["custom_api_file"] = "extension_api.json"
|
||||||
|
|
||||||
|
if env["platform"] == "macos":
|
||||||
|
library = env.SharedLibrary(
|
||||||
|
"project/bin/libmarshconnector.{}.{}.framework/libmarshconnector.{}.{}".format(
|
||||||
|
env["platform"], env["target"], env["platform"], env["target"]
|
||||||
|
),
|
||||||
|
source=sources,
|
||||||
|
)
|
||||||
|
elif env["platform"] == "ios":
|
||||||
|
if env["ios_simulator"]:
|
||||||
|
library = env.StaticLibrary(
|
||||||
|
"project/bin/libmarshconnector.{}.{}.simulator.a".format(env["platform"], env["target"]),
|
||||||
|
source=sources,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
library = env.StaticLibrary(
|
||||||
|
"project/bin/libmarshconnector.{}.{}.a".format(env["platform"], env["target"]),
|
||||||
|
source=sources,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
library = env.SharedLibrary(
|
||||||
|
"project/bin/libmarshconnector{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
|
||||||
|
source=sources,
|
||||||
|
)
|
||||||
|
|
||||||
|
Default(library)
|
||||||
323500
extension_api.json
Normal file
323500
extension_api.json
Normal file
File diff suppressed because it is too large
Load diff
34
project/bin/marshconnector.gdextension
Normal file
34
project/bin/marshconnector.gdextension
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[configuration]
|
||||||
|
|
||||||
|
entry_symbol = "marsh_library_init"
|
||||||
|
compatibility_minimum = "4.3"
|
||||||
|
reloadable = true
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
|
||||||
|
macos.debug = "res://bin/libmarshconnector.macos.template_debug.framework"
|
||||||
|
macos.release = "res://bin/libmarshconnector.macos.template_release.framework"
|
||||||
|
ios.debug = "res://bin/libmarshconnector.ios.template_debug.xcframework"
|
||||||
|
ios.release = "res://bin/libmarshconnector.ios.template_release.xcframework"
|
||||||
|
windows.debug.x86_32 = "res://bin/libmarshconnector.windows.template_debug.x86_32.dll"
|
||||||
|
windows.release.x86_32 = "res://bin/libmarshconnector.windows.template_release.x86_32.dll"
|
||||||
|
windows.debug.x86_64 = "res://bin/libmarshconnector.windows.template_debug.x86_64.dll"
|
||||||
|
windows.release.x86_64 = "res://bin/libmarshconnector.windows.template_release.x86_64.dll"
|
||||||
|
linux.debug.x86_64 = "res://bin/libmarshconnector.linux.template_debug.x86_64.so"
|
||||||
|
linux.release.x86_64 = "res://bin/libmarshconnector.linux.template_release.x86_64.so"
|
||||||
|
linux.debug.arm64 = "res://bin/libmarshconnector.linux.template_debug.arm64.so"
|
||||||
|
linux.release.arm64 = "res://bin/libmarshconnector.linux.template_release.arm64.so"
|
||||||
|
linux.debug.rv64 = "res://bin/libmarshconnector.linux.template_debug.rv64.so"
|
||||||
|
linux.release.rv64 = "res://bin/libmarshconnector.linux.template_release.rv64.so"
|
||||||
|
android.debug.x86_64 = "res://bin/libmarshconnector.android.template_debug.x86_64.so"
|
||||||
|
android.release.x86_64 = "res://bin/libmarshconnector.android.template_release.x86_64.so"
|
||||||
|
android.debug.arm64 = "res://bin/libmarshconnector.android.template_debug.arm64.so"
|
||||||
|
android.release.arm64 = "res://bin/libmarshconnector.android.template_release.arm64.so"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ios.debug = {
|
||||||
|
"res://bin/libgodot-cpp.ios.template_debug.xcframework": ""
|
||||||
|
}
|
||||||
|
ios.release = {
|
||||||
|
"res://bin/libgodot-cpp.ios.template_release.xcframework": ""
|
||||||
|
}
|
||||||
1
project/bin/marshconnector.gdextension.uid
Normal file
1
project/bin/marshconnector.gdextension.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://crqmff1sawfxc
|
||||||
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 994 B |
20
src/marshconnector.cpp
Normal file
20
src/marshconnector.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include "marshconnector.h"
|
||||||
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
|
|
||||||
|
using namespace godot;
|
||||||
|
|
||||||
|
void MarshConnector::_bind_methods() {
|
||||||
|
}
|
||||||
|
|
||||||
|
MarshConnector::MarshConnector() {
|
||||||
|
// Initialize any variables here.
|
||||||
|
time_passed = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
MarshConnector::~MarshConnector() {
|
||||||
|
// Add your cleanup here.
|
||||||
|
}
|
||||||
|
|
||||||
|
void MarshConnector::_process(double delta) {
|
||||||
|
time_passed += delta;
|
||||||
|
}
|
||||||
26
src/marshconnector.h
Normal file
26
src/marshconnector.h
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef MARSHCONNECTOR_H
|
||||||
|
#define MARSHCONNECTOR_H
|
||||||
|
|
||||||
|
#include <godot_cpp/classes/node.hpp>
|
||||||
|
|
||||||
|
namespace godot {
|
||||||
|
|
||||||
|
class MarshConnector : public Node{
|
||||||
|
GDCLASS(MarshConnector, Node)
|
||||||
|
|
||||||
|
private:
|
||||||
|
double time_passed;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void _bind_methods();
|
||||||
|
|
||||||
|
public:
|
||||||
|
MarshConnector();
|
||||||
|
~MarshConnector();
|
||||||
|
|
||||||
|
void _process(double delta) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MARSHCONNECTOR_H
|
||||||
36
src/register_types.cpp
Normal file
36
src/register_types.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
#include "register_types.h"
|
||||||
|
|
||||||
|
#include "marshconnector.h"
|
||||||
|
|
||||||
|
#include <gdextension_interface.h>
|
||||||
|
#include <godot_cpp/core/defs.hpp>
|
||||||
|
#include <godot_cpp/godot.hpp>
|
||||||
|
|
||||||
|
using namespace godot;
|
||||||
|
|
||||||
|
void initialize_marsh_module(ModuleInitializationLevel p_level) {
|
||||||
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GDREGISTER_CLASS(MarshConnector);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitialize_marsh_module(ModuleInitializationLevel p_level) {
|
||||||
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// Initialization.
|
||||||
|
GDExtensionBool GDE_EXPORT marsh_library_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_marsh_module);
|
||||||
|
init_obj.register_terminator(uninitialize_marsh_module);
|
||||||
|
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
|
||||||
|
|
||||||
|
return init_obj.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/register_types.h
Normal file
11
src/register_types.h
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef GDEXAMPLE_REGISTER_TYPES_H
|
||||||
|
#define GDEXAMPLE_REGISTER_TYPES_H
|
||||||
|
|
||||||
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
|
|
||||||
|
using namespace godot;
|
||||||
|
|
||||||
|
void initialize_example_module(ModuleInitializationLevel p_level);
|
||||||
|
void uninitialize_example_module(ModuleInitializationLevel p_level);
|
||||||
|
|
||||||
|
#endif // GDEXAMPLE_REGISTER_TYPES_H
|
||||||
Loading…
Add table
Add a link
Reference in a new issue