dik what this was but pushing ancient changes

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

11
.gitignore vendored
View File

@ -24,7 +24,6 @@ mono_crash.*.json
# VSCode
.vscode/*
@ -43,3 +42,13 @@ mono_crash.*.json
# Fork
Source/.sconsign.dblite
.vs
# Compiled Object files
*.slo
*.lo
*.o
*.obj

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "Engine/gdnative_cpp"]
path = Engine/gdnative_cpp
url = https://github.com/godotengine/godot-cpp
[submodule "Engine/gd_nim"]
path = Engine/gd_nim
url = https://github.com/pragmagic/godot-nim

46
Bootstrap.Windows.bat Normal file
View File

@ -0,0 +1,46 @@
where "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" >nul 2>nul
if not ERRORLEVEL 0 (
echo Visual Studio 2019 not found... Remove this error message if you do have it.
pause
exit
)
where python >nul 2>nul
if not ERRORLEVEL 0 (
echo Need python not found... Remove this error message if you have it.
pause
exit
)
where scons >nul 2>nul
if not ERRORLEVEL 0 (
python pip install scons
)
git clone --recurse-submodules https://
cd LangStudies
start build_engine.bat
:tools_wait
timeout 1
if not exist Engine\gd\bin\godot.windows.opt.tools.64.exe (
goto :tools_wait
)
timeout 10
start Engine\gd\bin\godot.windows.opt.tools.64.exe -e App/project.godot
timeout 30
taskkill /f /im godot.windows.opt.tools.64.exe
:opt_wait
timeout 1
if not exist Engine\gd\bin\godot.windows.opt.64.exe (
goto :opt_wait
)
timeout 2
start /w build_project.bat

View File

@ -0,0 +1,12 @@
[configuration]
entry_symbol = "SENative_Init"
[libraries]
linux.64.debug = "bin/SENative.linux.debug.64.so"
linux.64.release = "bin/SENative.linux.release.64.so"
windows.64.debug = "bin/SENative.windows.debug.64.dll"
windows.64.release = "bin/SENative.windows.release.64.dll"
macos.debug = "bin/SENative.debug.framework"
macos.release = "bin/SENative.release.framework"

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +0,0 @@
[configuration]
entry_symbol = "example_library_init"
[libraries]
linux.64.debug = "bin/libgdexample.linux.debug.64.so"
linux.64.release = "bin/libgdexample.linux.release.64.so"
windows.64.debug = "bin/libgdexample.windows.debug.64.dll"
windows.64.release = "bin/libgdexample.windows.release.64.dll"
macos.debug = "bin/libgdexample.debug.framework"
macos.release = "bin/libgdexample.release.framework"

View File

@ -1,14 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://bqqewt05ne1ad"]
[gd_scene format=3 uid="uid://d3u3lj2du4mgd"]
[ext_resource type="Texture2D" uid="uid://cnv7sgufjc3fk" path="res://icon.png" id="1_tqon5"]
[node name="main" type="Node"]
[node name="GDExample" type="GDExample" parent="."]
position = Vector2(7.83596, 18.1283)
texture = ExtResource( "1_tqon5" )
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(1, 0.309804, 0.580392, 1)
position = Vector2(214, 2)
texture = ExtResource( "1_tqon5" )
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1024.0
offset_bottom = -600.0

View File

@ -17,4 +17,4 @@ config/features=PackedStringArray("4.0", "Vulkan Clustered")
[native_extensions]
paths=["res://../Source/gdexample.gdextension"]
paths=["res://SENative.gdextension"]

1
Engine/gd_nim Submodule

@ -0,0 +1 @@
Subproject commit 107f30ac38cf2bfb2557e47b64d3f58bd8ad9169

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);

6
build_engine.bat Normal file
View File

@ -0,0 +1,6 @@
start /w build_engine.debug.bat
start /w build_engine.release_debug.bat
start /w build_engine.release.bat
exit

5
build_engine.debug.bat Normal file
View File

@ -0,0 +1,5 @@
cd Engine\gd\
scons -j%NUMBER_OF_PROCESSORS% platform=windows
exit

5
build_engine.release.bat Normal file
View File

@ -0,0 +1,5 @@
cd Engine\gd\
scons -j%NUMBER_OF_PROCESSORS% platform=windows tools=no target=release bits=64
exit

View File

@ -0,0 +1,5 @@
cd Engine\gd\
scons -j%NUMBER_OF_PROCESSORS% platform=windows tools=yes target=release_debug bits=64
exit

15
build_project.bat Normal file
View File

@ -0,0 +1,15 @@
set YYYY=%date:~10,4%
set MM=%date:~4,2%
set DD=%date:~7,2%
set HH=%time:~0,2%
if %HH% lss 10 (set CUR_HH=0%time:~1,1%)
set NN=%time:~3,2%
set SS=%time:~6,2%
set MS=%time:~9,2%
set SUBFILENAME=%YYYY%%MM%%DD%_%HH%%NN%%SS%
cd Builds
mkdir %SUBFILENAME%
cd ..\Engine\gd\bin
godot.windows.opt.64.exe --export "Windows Desktop" "..\Builds\%SUBFILENAME%\LangStudies.exe" --path "..\..\..\App"

View File

@ -1,5 +1,3 @@
cd Engine\gd\bin\
start Engine\gd\bin\godot.windows.opt.tools.64.exe -e App/project.godot
start godot.windows.opt.tools.64.exe
exit

3
game.debug.bat Normal file
View File

@ -0,0 +1,3 @@
start Engine\gd\bin\godot.windows.tools.64.exe --path App/

3
game.release.bat Normal file
View File

@ -0,0 +1,3 @@
start Engine\gd\bin\godot.windows.opt.64.exe --path App/

3
game.release_debug.bat Normal file
View File

@ -0,0 +1,3 @@
start Engine\gd\bin\godot.windows.opt.tools.64.exe --path App/