diff options
Diffstat (limited to 'Unicity.Engine')
| -rw-r--r-- | Unicity.Engine/GameObject.cs | 27 | ||||
| -rw-r--r-- | Unicity.Engine/GameWindow.cs | 63 | ||||
| -rw-r--r-- | Unicity.Engine/Model.cs | 7 | ||||
| -rw-r--r-- | Unicity.Engine/Properties/AssemblyInfo.cs | 36 | ||||
| -rw-r--r-- | Unicity.Engine/Unicity.Engine.csproj | 61 |
5 files changed, 194 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{CBF47ABD-0454-496A-B3E3-848D27317C59}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>Unicity.Engine</RootNamespace> + <AssemblyName>Unicity.Engine</AssemblyName> + <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <StartupObject /> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="GameWindow.cs" /> + <Compile Include="Model.cs" /> + <Compile Include="GameObject.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Unicity.Renderer\Unicity.Renderer.csproj"> + <Project>{7c0c6e9f-6bc9-4825-b657-8dace26cf4fd}</Project> + <Name>Unicity.Renderer</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file |
