From bf796a2a2581cfe7fdbf08bf3f642414254404b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 1 Nov 2020 15:41:12 +0100 Subject: [PATCH] Created basic entry point and application --- GlitchyEngine/BeefProj.toml | 2 -- GlitchyEngine/src/Application.bf | 10 ++++++++++ GlitchyEngine/src/Program.bf | 21 +++++++++++++++++++++ GlitchyEngine/src/Test.bf | 12 ------------ Sandbox/BeefProj.toml | 3 +-- Sandbox/src/Program.bf | 16 ---------------- Sandbox/src/SandboxApp.bf | 14 ++++++++++++++ 7 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 GlitchyEngine/src/Application.bf create mode 100644 GlitchyEngine/src/Program.bf delete mode 100644 GlitchyEngine/src/Test.bf delete mode 100644 Sandbox/src/Program.bf create mode 100644 Sandbox/src/SandboxApp.bf diff --git a/GlitchyEngine/BeefProj.toml b/GlitchyEngine/BeefProj.toml index e4cd134..7d832a2 100644 --- a/GlitchyEngine/BeefProj.toml +++ b/GlitchyEngine/BeefProj.toml @@ -2,5 +2,3 @@ FileVersion = 1 [Project] Name = "GlitchyEngine" -TargetType = "BeefLib" -StartupObject = "GlitchyEngine.Program" diff --git a/GlitchyEngine/src/Application.bf b/GlitchyEngine/src/Application.bf new file mode 100644 index 0000000..a3d8b34 --- /dev/null +++ b/GlitchyEngine/src/Application.bf @@ -0,0 +1,10 @@ +namespace GlitchyEngine +{ + public class Application + { + public void Run() + { + while(true) {} + } + } +} diff --git a/GlitchyEngine/src/Program.bf b/GlitchyEngine/src/Program.bf new file mode 100644 index 0000000..5577034 --- /dev/null +++ b/GlitchyEngine/src/Program.bf @@ -0,0 +1,21 @@ +using System; + +namespace GlitchyEngine +{ + class Program + { + [LinkName("CreateApplication")] + static extern Application CreateApplication(); + + public static int Main(String[] args) + { + var app = CreateApplication(); + + app.Run(); + + delete app; + + return 0; + } + } +} diff --git a/GlitchyEngine/src/Test.bf b/GlitchyEngine/src/Test.bf deleted file mode 100644 index bd99d66..0000000 --- a/GlitchyEngine/src/Test.bf +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace GlitchyEngine -{ - public static class Test - { - public static void Print() - { - Console.WriteLine("Hello from the Glitchy Engine!"); - } - } -} diff --git a/Sandbox/BeefProj.toml b/Sandbox/BeefProj.toml index 872f95c..42602b4 100644 --- a/Sandbox/BeefProj.toml +++ b/Sandbox/BeefProj.toml @@ -3,5 +3,4 @@ Dependencies = {corlib = "*", GlitchyEngine = "*"} [Project] Name = "Sandbox" -TargetType = "BeefGUIApplication" -StartupObject = "Sandbox.Program" +StartupObject = "GlitchyEngine.Program" diff --git a/Sandbox/src/Program.bf b/Sandbox/src/Program.bf deleted file mode 100644 index 09200b7..0000000 --- a/Sandbox/src/Program.bf +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Sandbox -{ - class Program - { - public static int Main(String[] args) - { - GlitchyEngine.Test.Print(); - - Console.Read(); - - return 0; - } - } -} diff --git a/Sandbox/src/SandboxApp.bf b/Sandbox/src/SandboxApp.bf new file mode 100644 index 0000000..c00287f --- /dev/null +++ b/Sandbox/src/SandboxApp.bf @@ -0,0 +1,14 @@ +using System; +using GlitchyEngine; + +namespace Sandbox +{ + class SandboxApp : Application + { + [Export, LinkName("CreateApplication")] + public static Application CreateApplication() + { + return new SandboxApp(); + } + } +}