From 3b214e75effaca1ba67daaf29d0a94e5b0129386 Mon Sep 17 00:00:00 2001 From: Adrian Ulbrich Date: Fri, 8 Nov 2019 23:56:17 +0100 Subject: Started work on actual engine --- Unicity.Engine/GameObject.cs | 27 +++++++++++++ Unicity.Engine/GameWindow.cs | 63 +++++++++++++++++++++++++++++++ Unicity.Engine/Model.cs | 7 ++++ Unicity.Engine/Properties/AssemblyInfo.cs | 36 ++++++++++++++++++ Unicity.Engine/Unicity.Engine.csproj | 61 ++++++++++++++++++++++++++++++ 5 files changed, 194 insertions(+) create mode 100644 Unicity.Engine/GameObject.cs create mode 100644 Unicity.Engine/GameWindow.cs create mode 100644 Unicity.Engine/Model.cs create mode 100644 Unicity.Engine/Properties/AssemblyInfo.cs create mode 100644 Unicity.Engine/Unicity.Engine.csproj (limited to 'Unicity.Engine') diff --git a/Unicity.Engine/GameObject.cs b/Unicity.Engine/GameObject.cs new file mode 100644 index 0000000..b59dd8b --- /dev/null +++ b/Unicity.Engine/GameObject.cs @@ -0,0 +1,27 @@ +namespace Unicity.Engine +{ + public class GameObject + { + public float X = 0; + public float Y = 0; + public float Z = 0; + + public float ScaleX = 0; + public float ScaleY = 0; + public float ScaleZ = 0; + + public Model Model = null; + + public GameObject() + { + + } + + public GameObject(float x, float y, float z) + { + X = x; + Y = y; + Z = z; + } + } +} diff --git a/Unicity.Engine/GameWindow.cs b/Unicity.Engine/GameWindow.cs new file mode 100644 index 0000000..cb44eb8 --- /dev/null +++ b/Unicity.Engine/GameWindow.cs @@ -0,0 +1,63 @@ +using System; +using Unicity.Renderer; + +namespace Unicity.Engine +{ + public class GameWindow : IDisposable + { + RenderWindow window = null; + GraphicsRenderer renderer = null; + + public int Width { get => window.Width; set => window.Width = value; } + public int Height { get => window.Height; set => window.Height = value; } + + public string Title { get => window.Title; set => window.Title = value; } + + bool disposed = false; + + public GameWindow(int width = 800, int height = 800, string title = "Unicity Renderer written by Adrian Ulbrich") + { + window = new RenderWindow(width, height, title); + renderer = new GraphicsRenderer(window); + + window.Render += Window_Render; + + renderer.TestInit(); + } + + private void Window_Render(object sender, EventArgs e) + { + renderer.TestLoop(); + } + + public void Open(double ups = 60.0, double fps = 60.0) + { + window.Open(ups, fps); + renderer.TestInit(); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose of managed resources + } + + // Dispose of unmanaged resources + window?.Dispose(); + + disposed = true; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/Unicity.Engine/Model.cs b/Unicity.Engine/Model.cs new file mode 100644 index 0000000..ab5a2e7 --- /dev/null +++ b/Unicity.Engine/Model.cs @@ -0,0 +1,7 @@ +namespace Unicity.Engine +{ + public class Model + { + + } +} diff --git a/Unicity.Engine/Properties/AssemblyInfo.cs b/Unicity.Engine/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b6ce7aa --- /dev/null +++ b/Unicity.Engine/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("Unicity.Engine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Unicity.Engine")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("cbf47abd-0454-496a-b3e3-848d27317c59")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Unicity.Engine/Unicity.Engine.csproj b/Unicity.Engine/Unicity.Engine.csproj new file mode 100644 index 0000000..e077857 --- /dev/null +++ b/Unicity.Engine/Unicity.Engine.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {CBF47ABD-0454-496A-B3E3-848D27317C59} + Library + Unicity.Engine + Unicity.Engine + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {7c0c6e9f-6bc9-4825-b657-8dace26cf4fd} + Unicity.Renderer + + + + \ No newline at end of file -- cgit v1.2.3