From ec2241b6b47e6c41f7a06a80292e50a64a93bd75 Mon Sep 17 00:00:00 2001 From: Software Antics Date: Wed, 17 Apr 2024 20:06:45 +1000 Subject: [PATCH] - Updated all nuget packages - Capped NUnit, OpenTK and Moq to their respective versions - Downgraded OpenTK to 4.3.0 for editor integration - see https://github.com/opentk/GLWpfControl/issues/73 - Renamed TagComponent to Tag - Removed FinalEngine.Rendering.Components - Transform now implements IEntityComponent --- .../Core/{TagComponent.cs => Tag.cs} | 4 +- .../FinalEngine.Editor.Common.csproj | 7 +- .../Models/Scenes/Scene.cs | 6 +- .../FinalEngine.Editor.Desktop.csproj | 12 +- .../Views/Scenes/SceneView.xaml | 10 +- .../Views/Scenes/SceneView.xaml.cs | 12 +- .../FinalEngine.Editor.ViewModels.csproj | 4 +- .../Inspectors/EntityComponentViewModel.cs | 2 +- .../Inspectors/EntityInspectorViewModel.cs | 2 +- .../FinalEngine.Examples.Sponza.csproj | 2 +- FinalEngine.Examples.Sponza/Program.cs | 336 +++++++++--------- .../FinalEngine.Platform.Desktop.csproj | 4 +- .../OpenTK/Invocation/INativeWindowInvoker.cs | 4 +- .../OpenTK/Invocation/NativeWindowInvoker.cs | 5 - .../OpenTK/OpenTKWindow.cs | 4 +- .../Core/TransformComponent.cs | 12 - .../FinalEngine.Rendering.Components.csproj | 36 -- .../FinalEngine.Rendering.OpenGL.csproj | 4 +- .../OpenGLRenderDevice.cs | 4 +- FinalEngine.Rendering/Core/Transform.cs | 3 +- .../FinalEngine.Rendering.csproj | 3 +- .../FinalEngine.Runtime.csproj | 2 - .../ECS/Components/TagComponentTests.cs | 4 +- FinalEngine.Tests/FinalEngine.Tests.csproj | 11 +- .../Desktop/OpenTK/OpenTKWindowTests.cs | 2 +- FinalEngine.sln | 7 - 26 files changed, 213 insertions(+), 289 deletions(-) rename FinalEngine.ECS/Components/Core/{TagComponent.cs => Tag.cs} (89%) delete mode 100644 FinalEngine.Rendering.Components/Core/TransformComponent.cs delete mode 100644 FinalEngine.Rendering.Components/FinalEngine.Rendering.Components.csproj diff --git a/FinalEngine.ECS/Components/Core/TagComponent.cs b/FinalEngine.ECS/Components/Core/Tag.cs similarity index 89% rename from FinalEngine.ECS/Components/Core/TagComponent.cs rename to FinalEngine.ECS/Components/Core/Tag.cs index ea2d5ee8..843783ae 100644 --- a/FinalEngine.ECS/Components/Core/TagComponent.cs +++ b/FinalEngine.ECS/Components/Core/Tag.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) Software Antics. All rights reserved. // @@ -17,7 +17,7 @@ namespace FinalEngine.ECS.Components.Core; /// /// [Category("Core")] -public sealed class TagComponent : IEntityComponent, INotifyPropertyChanged +public sealed class Tag : IEntityComponent, INotifyPropertyChanged { private string? name; diff --git a/FinalEngine.Editor.Common/FinalEngine.Editor.Common.csproj b/FinalEngine.Editor.Common/FinalEngine.Editor.Common.csproj index caad47c4..761ab6ae 100644 --- a/FinalEngine.Editor.Common/FinalEngine.Editor.Common.csproj +++ b/FinalEngine.Editor.Common/FinalEngine.Editor.Common.csproj @@ -23,18 +23,17 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - diff --git a/FinalEngine.Editor.Common/Models/Scenes/Scene.cs b/FinalEngine.Editor.Common/Models/Scenes/Scene.cs index 0d589830..de4c3614 100644 --- a/FinalEngine.Editor.Common/Models/Scenes/Scene.cs +++ b/FinalEngine.Editor.Common/Models/Scenes/Scene.cs @@ -11,7 +11,7 @@ namespace FinalEngine.Editor.Common.Models.Scenes; using FinalEngine.ECS; using FinalEngine.ECS.Components.Core; using FinalEngine.ECS.Exceptions; -using FinalEngine.Rendering.Components.Core; +using FinalEngine.Rendering.Core; using Microsoft.Extensions.Logging; public sealed class Scene : IScene @@ -42,12 +42,12 @@ public void AddEntity(string tag, Guid uniqueID) var entity = new Entity(uniqueID); - entity.AddComponent(new TagComponent() + entity.AddComponent(new Tag() { Name = tag, }); - entity.AddComponent(new TransformComponent()); + entity.AddComponent(new Transform()); this.world.AddEntity(entity); this.entities.Add(entity); diff --git a/FinalEngine.Editor.Desktop/FinalEngine.Editor.Desktop.csproj b/FinalEngine.Editor.Desktop/FinalEngine.Editor.Desktop.csproj index 1ada7915..1ff2a1ed 100644 --- a/FinalEngine.Editor.Desktop/FinalEngine.Editor.Desktop.csproj +++ b/FinalEngine.Editor.Desktop/FinalEngine.Editor.Desktop.csproj @@ -26,17 +26,17 @@ - - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml b/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml index 5ce266ea..eb859fc9 100644 --- a/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml +++ b/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml @@ -12,14 +12,6 @@ - - - - + Render="{eb:EventBinding RenderCommand.Execute, `null`}" /> diff --git a/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml.cs b/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml.cs index 5eae796e..c83e8531 100644 --- a/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml.cs +++ b/FinalEngine.Editor.Desktop/Views/Scenes/SceneView.xaml.cs @@ -5,12 +5,22 @@ namespace FinalEngine.Editor.Desktop.Views.Scenes; using System.Windows.Controls; +using OpenTK.Windowing.Common; +using OpenTK.Wpf; public partial class SceneView : UserControl { public SceneView() { this.InitializeComponent(); - this.glWpfControl.Start(); + + this.glWpfControl.Start(new GLWpfControlSettings() + { + MajorVersion = 4, + MinorVersion = 6, + GraphicsProfile = ContextProfile.Compatability, + GraphicsContextFlags = ContextFlags.ForwardCompatible, + RenderContinuously = true, + }); } } diff --git a/FinalEngine.Editor.ViewModels/FinalEngine.Editor.ViewModels.csproj b/FinalEngine.Editor.ViewModels/FinalEngine.Editor.ViewModels.csproj index 9ea721fa..7f98c102 100644 --- a/FinalEngine.Editor.ViewModels/FinalEngine.Editor.ViewModels.csproj +++ b/FinalEngine.Editor.ViewModels/FinalEngine.Editor.ViewModels.csproj @@ -19,12 +19,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FinalEngine.Editor.ViewModels/Inspectors/EntityComponentViewModel.cs b/FinalEngine.Editor.ViewModels/Inspectors/EntityComponentViewModel.cs index 27ce2a1b..c21c13e4 100644 --- a/FinalEngine.Editor.ViewModels/Inspectors/EntityComponentViewModel.cs +++ b/FinalEngine.Editor.ViewModels/Inspectors/EntityComponentViewModel.cs @@ -134,7 +134,7 @@ public ICommand ToggleCommand private bool CanRemove() { - return this.component.GetType() != typeof(TagComponent); + return this.component.GetType() != typeof(Tag); } private void Remove() diff --git a/FinalEngine.Editor.ViewModels/Inspectors/EntityInspectorViewModel.cs b/FinalEngine.Editor.ViewModels/Inspectors/EntityInspectorViewModel.cs index b46a0a7f..8f96752f 100644 --- a/FinalEngine.Editor.ViewModels/Inspectors/EntityInspectorViewModel.cs +++ b/FinalEngine.Editor.ViewModels/Inspectors/EntityInspectorViewModel.cs @@ -78,7 +78,7 @@ private void IntializeComponentTypes() { this.categorizedComponentTypes.Clear(); - var assembly = Assembly.GetAssembly(typeof(TagComponent)) ?? throw new TypeAccessException("Failed to initialize core engine components."); + var assembly = Assembly.GetAssembly(typeof(Tag)) ?? throw new TypeAccessException("Failed to initialize core engine components."); var categoryToTypeMap = this.typeResolver.GetCategorizedTypes(assembly); diff --git a/FinalEngine.Examples.Sponza/FinalEngine.Examples.Sponza.csproj b/FinalEngine.Examples.Sponza/FinalEngine.Examples.Sponza.csproj index 946321c8..429f62c9 100644 --- a/FinalEngine.Examples.Sponza/FinalEngine.Examples.Sponza.csproj +++ b/FinalEngine.Examples.Sponza/FinalEngine.Examples.Sponza.csproj @@ -11,7 +11,7 @@ - + diff --git a/FinalEngine.Examples.Sponza/Program.cs b/FinalEngine.Examples.Sponza/Program.cs index 6d271962..55077b35 100644 --- a/FinalEngine.Examples.Sponza/Program.cs +++ b/FinalEngine.Examples.Sponza/Program.cs @@ -26,68 +26,64 @@ using OpenTK.Windowing.Desktop; using OpenTK.Windowing.GraphicsLibraryFramework; -internal class Program +var settings = new NativeWindowSettings() { - private static void Main() - { - var settings = new NativeWindowSettings() - { - API = ContextAPI.OpenGL, - APIVersion = new Version(4, 6), + API = ContextAPI.OpenGL, + APIVersion = new Version(4, 6), - Flags = ContextFlags.ForwardCompatible, - Profile = ContextProfile.Core, + Flags = ContextFlags.ForwardCompatible, + Profile = ContextProfile.Core, - AutoLoadBindings = false, + AutoLoadBindings = false, - WindowBorder = WindowBorder.Fixed, - WindowState = WindowState.Normal, + WindowBorder = WindowBorder.Fixed, + WindowState = WindowState.Normal, - Size = new OpenTK.Mathematics.Vector2i(1280, 720), + Size = new OpenTK.Mathematics.Vector2i(1280, 720), - StartVisible = true, + StartVisible = true, - NumberOfSamples = 8, - }; + NumberOfSamples = 8, +}; - var nativeWindow = new NativeWindowInvoker(settings); +var nativeWindow = new NativeWindowInvoker(settings); - var window = new OpenTKWindow(nativeWindow) - { - Title = "Final Engine", - }; +var window = new OpenTKWindow(nativeWindow) +{ + Title = "Final Engine", +}; - var keyboardDevice = new OpenTKKeyboardDevice(nativeWindow); - var keyboard = new Keyboard(keyboardDevice); +var keyboardDevice = new OpenTKKeyboardDevice(nativeWindow); +var keyboard = new Keyboard(keyboardDevice); - var mouseDevice = new OpenTKMouseDevice(nativeWindow); - var mouse = new Mouse(mouseDevice); +var mouseDevice = new OpenTKMouseDevice(nativeWindow); +var mouse = new Mouse(mouseDevice); - var fileSystem = new FileSystem(); +var fileSystem = new FileSystem(); - var opengl = new OpenGLInvoker(); - var bindings = new GLFWBindingsContext(); +var opengl = new OpenGLInvoker(); +var bindings = new GLFWBindingsContext(); - var renderContext = new OpenGLRenderContext(opengl, bindings, nativeWindow.Context); - var renderDevice = new OpenGLRenderDevice(opengl); - var renderPipeline = new OpenGLRenderPipeline(); +var renderContext = new OpenGLRenderContext(opengl, bindings, nativeWindow.Context); +var renderDevice = new OpenGLRenderDevice(opengl); +var renderPipeline = new OpenGLRenderPipeline(); - renderPipeline.Initialize(); +renderPipeline.Initialize(); - ResourceManager.Instance.RegisterLoader(new ShaderResourceLoader(fileSystem, renderDevice)); - ResourceManager.Instance.RegisterLoader(new Texture2DResourceLoader(fileSystem, renderDevice)); - ResourceManager.Instance.RegisterLoader(new ShaderProgramResourceLoader(ResourceManager.Instance, renderDevice, fileSystem)); - ResourceManager.Instance.RegisterLoader(new ModelResourceLoader(fileSystem, renderDevice)); +ResourceManager.Instance.RegisterLoader(new ShaderResourceLoader(fileSystem, renderDevice)); +ResourceManager.Instance.RegisterLoader(new Texture2DResourceLoader(fileSystem, renderDevice)); +ResourceManager.Instance.RegisterLoader(new ShaderProgramResourceLoader(ResourceManager.Instance, renderDevice, fileSystem)); +ResourceManager.Instance.RegisterLoader(new ModelResourceLoader(fileSystem, renderDevice)); - var watch = new Stopwatch(); - var watchInvoker = new StopwatchInvoker(watch); - var gameTime = new GameTime(watchInvoker, 120.0f); +var watch = new Stopwatch(); +var watchInvoker = new StopwatchInvoker(watch); +var gameTime = new GameTime(watchInvoker, 120.0f); - float fieldDepth = 10.0f; - float fieldWidth = 10.0f; +float fieldDepth = 10.0f; +float fieldWidth = 10.0f; - MeshVertex[] vertices = [ - new MeshVertex() +MeshVertex[] vertices = [ + new MeshVertex() { Position = new Vector3(-fieldWidth, 0.0f, -fieldDepth), TextureCoordinate = new Vector2(0.0f), @@ -104,151 +100,147 @@ private static void Main() }, ]; - int[] indices = [ - 0, +int[] indices = [ + 0, 1, 2, 2, 1, 3 - ]; +]; - MeshVertex.CalculateNormals(vertices, indices); - MeshVertex.CalculateTangents(vertices, indices); - - var mesh = new Mesh( - renderDevice.Factory, - vertices, - indices, - MeshVertex.InputElements, - MeshVertex.SizeInBytes); - - var material = new Material() - { - DiffuseTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_diffuse.tga"), - SpecularTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_specular.tga"), - NormalTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_normal.tga"), - Shininess = 16.0f, - }; - - var model = ResourceManager.Instance.LoadResource("Resources\\Models\\Sponza\\sponza.obj"); - - // Currently there is no parent-child relationship with transform, so we have to do this to scale and translate. - if (model.RenderModel != null) - { - model.RenderModel.Transform.Scale = new Vector3(0.2f); - } - - foreach (var child in model.Children) - { - if (child.RenderModel != null) - { - child.RenderModel.Transform.Scale = new Vector3(0.2f); - } - } - - bool isRunning = true; - - var camera = new Camera(window.ClientSize.Width, window.ClientSize.Height); - - var geometryRenderer = new GeometryRenderer(renderDevice); - var lightRenderer = new LightRenderer(renderDevice); - var skyboxRenderer = new SkyboxRenderer(renderDevice); - var sceneRenderer = new SceneRenderer(renderDevice, geometryRenderer); - - var renderCoordinator = new RenderCoordinator(geometryRenderer, lightRenderer); - - var renderingEngine = new RenderingEngine( - fileSystem, - renderDevice, - lightRenderer, - skyboxRenderer, - sceneRenderer, - renderCoordinator); - - var right = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_right.png"); - var left = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_left.png"); - var top = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_top.png"); - var bottom = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_bottom.png"); - var front = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_front.png"); - var back = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_back.png"); - - var cubeTexture = renderDevice.Factory.CreateCubeTexture( - new TextureCubeDescription() - { - Width = right.Description.Width, - Height = right.Description.Height, - WrapR = TextureWrapMode.Clamp, - WrapS = TextureWrapMode.Clamp, - WrapT = TextureWrapMode.Clamp, - }, - right, - left, - top, - bottom, - back, - front); - - //skyboxRenderer.SetSkybox(cubeTexture); - - var controller = new ImGuiController(window.ClientSize.Width, window.ClientSize.Height); - - var dirLight = new Light() - { - Type = LightType.Directional, - Intensity = 0.4f, - Color = new Vector3(0.4f), - Direction = new Vector3(-1), - }; - - var binder = new TextureBinder(renderDevice.Pipeline); - var batcher = new SpriteBatcher(renderDevice.InputAssembler); - var drawer = new SpriteDrawer(renderDevice, batcher, binder, window.ClientSize.Width, window.ClientSize.Height); - - while (isRunning) - { - if (!gameTime.CanProcessNextFrame()) - { - continue; - } +MeshVertex.CalculateNormals(vertices, indices); +MeshVertex.CalculateTangents(vertices, indices); - window.Title = $"{GameTime.FrameRate}"; +var mesh = new Mesh( + renderDevice.Factory, + vertices, + indices, + MeshVertex.InputElements, + MeshVertex.SizeInBytes); - camera.Update(renderDevice.Pipeline, keyboard, mouse); +var material = new Material() +{ + DiffuseTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_diffuse.tga"), + SpecularTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_specular.tga"), + NormalTexture = ResourceManager.Instance.LoadResource("Resources\\Textures\\Bricks\\bricks_normal.tga"), + Shininess = 16.0f, +}; + +var model = ResourceManager.Instance.LoadResource("Resources\\Models\\Sponza\\sponza.obj"); + +// Currently there is no parent-child relationship with transform, so we have to do this to scale and translate. +if (model.RenderModel != null) +{ + model.RenderModel.Transform.Scale = new Vector3(0.2f); +} - controller.Update(keyboard, mouse, GameTime.Delta); +foreach (var child in model.Children) +{ + if (child.RenderModel != null) + { + child.RenderModel.Transform.Scale = new Vector3(0.2f); + } +} - keyboard.Update(); - mouse.Update(); +var camera = new Camera(window.ClientSize.Width, window.ClientSize.Height); - geometryRenderer.Enqueue(model); +var geometryRenderer = new GeometryRenderer(renderDevice); +var lightRenderer = new LightRenderer(renderDevice); +var skyboxRenderer = new SkyboxRenderer(renderDevice); +var sceneRenderer = new SceneRenderer(renderDevice, geometryRenderer); - ////for (var i = 0; i < 5; i++) - ////{ - //// for (var j = 0; j < 5; j++) - //// { - //// lightRenderer.Enqueue(new Light() - //// { - //// Type = LightType.Point, - //// Position = new Vector3((i * 20) - 100, 4, (j * 20) - 50), - //// }); - //// } - ////} +var renderCoordinator = new RenderCoordinator(geometryRenderer, lightRenderer); - renderingEngine.Render(camera); +var renderingEngine = new RenderingEngine( + fileSystem, + renderDevice, + lightRenderer, + skyboxRenderer, + sceneRenderer, + renderCoordinator); - controller.Render(); +var right = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_right.png"); +var left = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_left.png"); +var top = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_top.png"); +var bottom = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_bottom.png"); +var front = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_front.png"); +var back = ResourceManager.Instance.LoadResource("Resources\\Textures\\Skybox\\default_back.png"); - renderContext.SwapBuffers(); - window.ProcessEvents(); - } +var cubeTexture = renderDevice.Factory.CreateCubeTexture( + new TextureCubeDescription() + { + Width = right.Description.Width, + Height = right.Description.Height, + WrapR = TextureWrapMode.Clamp, + WrapS = TextureWrapMode.Clamp, + WrapT = TextureWrapMode.Clamp, + }, + right, + left, + top, + bottom, + back, + front); + +skyboxRenderer.SetSkybox(cubeTexture); + +var controller = new ImGuiController(window.ClientSize.Width, window.ClientSize.Height); + +var dirLight = new Light() +{ + Type = LightType.Directional, + Intensity = 0.4f, + Color = new Vector3(0.4f), + Direction = new Vector3(-1), +}; - ResourceManager.Instance.Dispose(); +var binder = new TextureBinder(renderDevice.Pipeline); +var batcher = new SpriteBatcher(renderDevice.InputAssembler); +var drawer = new SpriteDrawer(renderDevice, batcher, binder, window.ClientSize.Width, window.ClientSize.Height); - renderPipeline.Dispose(); - mouse.Dispose(); - keyboard.Dispose(); - window.Dispose(); - nativeWindow.Dispose(); +while (!window.IsExiting) +{ + if (!gameTime.CanProcessNextFrame()) + { + continue; } + + window.Title = $"{GameTime.FrameRate}"; + + camera.Update(renderDevice.Pipeline, keyboard, mouse); + + controller.Update(keyboard, mouse, GameTime.Delta); + + keyboard.Update(); + mouse.Update(); + + geometryRenderer.Enqueue(model); + + ////for (var i = 0; i < 5; i++) + ////{ + //// for (var j = 0; j < 5; j++) + //// { + //// lightRenderer.Enqueue(new Light() + //// { + //// Type = LightType.Point, + //// Position = new Vector3((i * 20) - 100, 4, (j * 20) - 50), + //// }); + //// } + ////} + + renderingEngine.Render(camera); + + controller.Render(); + + renderContext.SwapBuffers(); + window.ProcessEvents(); } + +ResourceManager.Instance.Dispose(); + +renderPipeline.Dispose(); +mouse.Dispose(); +keyboard.Dispose(); +window.Dispose(); +nativeWindow.Dispose(); diff --git a/FinalEngine.Platform.Desktop/FinalEngine.Platform.Desktop.csproj b/FinalEngine.Platform.Desktop/FinalEngine.Platform.Desktop.csproj index 8b87623e..fd5e5a7c 100644 --- a/FinalEngine.Platform.Desktop/FinalEngine.Platform.Desktop.csproj +++ b/FinalEngine.Platform.Desktop/FinalEngine.Platform.Desktop.csproj @@ -23,9 +23,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FinalEngine.Platform.Desktop/OpenTK/Invocation/INativeWindowInvoker.cs b/FinalEngine.Platform.Desktop/OpenTK/Invocation/INativeWindowInvoker.cs index a94613a5..9a6168f9 100644 --- a/FinalEngine.Platform.Desktop/OpenTK/Invocation/INativeWindowInvoker.cs +++ b/FinalEngine.Platform.Desktop/OpenTK/Invocation/INativeWindowInvoker.cs @@ -42,9 +42,7 @@ public interface INativeWindowInvoker : IDisposable string Title { get; set; } - VSyncMode VSync { get; set; } - void Close(); - void ProcessWindowEvents(bool waitForEvents); + void ProcessEvents(); } diff --git a/FinalEngine.Platform.Desktop/OpenTK/Invocation/NativeWindowInvoker.cs b/FinalEngine.Platform.Desktop/OpenTK/Invocation/NativeWindowInvoker.cs index db16fd91..1ec45c5d 100644 --- a/FinalEngine.Platform.Desktop/OpenTK/Invocation/NativeWindowInvoker.cs +++ b/FinalEngine.Platform.Desktop/OpenTK/Invocation/NativeWindowInvoker.cs @@ -22,11 +22,6 @@ IMouseStateInvoker INativeWindowInvoker.MouseState get { return new MouseStateInvoker(this.MouseState); } } - public new void ProcessWindowEvents(bool waitForEvents) - { - NativeWindow.ProcessWindowEvents(waitForEvents); - } - protected override void Dispose(bool disposing) { base.Dispose(disposing); diff --git a/FinalEngine.Platform.Desktop/OpenTK/OpenTKWindow.cs b/FinalEngine.Platform.Desktop/OpenTK/OpenTKWindow.cs index 6a3cad79..0ad2b1ba 100644 --- a/FinalEngine.Platform.Desktop/OpenTK/OpenTKWindow.cs +++ b/FinalEngine.Platform.Desktop/OpenTK/OpenTKWindow.cs @@ -8,7 +8,6 @@ namespace FinalEngine.Platform.Desktop.OpenTK; using System.Drawing; using FinalEngine.Platform.Desktop.OpenTK.Invocation; using global::OpenTK.Mathematics; -using global::OpenTK.Windowing.Common; public class OpenTKWindow : IWindow, IEventsProcessor { @@ -17,7 +16,6 @@ public class OpenTKWindow : IWindow, IEventsProcessor public OpenTKWindow(INativeWindowInvoker nativeWindow) { this.nativeWindow = nativeWindow ?? throw new ArgumentNullException(nameof(nativeWindow)); - this.nativeWindow.VSync = VSyncMode.Off; } ~OpenTKWindow() @@ -114,7 +112,7 @@ public void Dispose() public void ProcessEvents() { ObjectDisposedException.ThrowIf(this.IsDisposed, this); - this.nativeWindow.ProcessWindowEvents(false); + this.nativeWindow.ProcessEvents(); } protected virtual void Dispose(bool disposing) diff --git a/FinalEngine.Rendering.Components/Core/TransformComponent.cs b/FinalEngine.Rendering.Components/Core/TransformComponent.cs deleted file mode 100644 index b1616790..00000000 --- a/FinalEngine.Rendering.Components/Core/TransformComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -// -// Copyright (c) Software Antics. All rights reserved. -// - -namespace FinalEngine.Rendering.Components.Core; - -using FinalEngine.ECS; -using FinalEngine.Rendering.Core; - -public sealed class TransformComponent : Transform, IEntityComponent -{ -} diff --git a/FinalEngine.Rendering.Components/FinalEngine.Rendering.Components.csproj b/FinalEngine.Rendering.Components/FinalEngine.Rendering.Components.csproj deleted file mode 100644 index c6985cd9..00000000 --- a/FinalEngine.Rendering.Components/FinalEngine.Rendering.Components.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net8.0 - enable - All - SA0001 - false - x64 - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - diff --git a/FinalEngine.Rendering.OpenGL/FinalEngine.Rendering.OpenGL.csproj b/FinalEngine.Rendering.OpenGL/FinalEngine.Rendering.OpenGL.csproj index dafb38e5..682abc3c 100644 --- a/FinalEngine.Rendering.OpenGL/FinalEngine.Rendering.OpenGL.csproj +++ b/FinalEngine.Rendering.OpenGL/FinalEngine.Rendering.OpenGL.csproj @@ -23,9 +23,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FinalEngine.Rendering.OpenGL/OpenGLRenderDevice.cs b/FinalEngine.Rendering.OpenGL/OpenGLRenderDevice.cs index 948916d3..1f24e55a 100644 --- a/FinalEngine.Rendering.OpenGL/OpenGLRenderDevice.cs +++ b/FinalEngine.Rendering.OpenGL/OpenGLRenderDevice.cs @@ -104,8 +104,8 @@ public OpenGLRenderDevice(IOpenGLInvoker invoker) { SizedFormat.Rg8, SizedInternalFormat.Rg8 }, { SizedFormat.Rgb8, All.Rgb8 }, { SizedFormat.Rgba8, SizedInternalFormat.Rgba8 }, - { SizedFormat.Depth, SizedInternalFormat.DepthComponent16 }, - { SizedFormat.Srgba, SizedInternalFormat.Srgb8Alpha8 }, + { SizedFormat.Depth, All.DepthComponent16 }, + { SizedFormat.Srgba, All.Srgb8Alpha8 }, { BufferUsageType.Static, BufferUsageHint.StaticDraw }, { BufferUsageType.Dynamic, BufferUsageHint.DynamicDraw }, }; diff --git a/FinalEngine.Rendering/Core/Transform.cs b/FinalEngine.Rendering/Core/Transform.cs index 0028395c..046d23df 100644 --- a/FinalEngine.Rendering/Core/Transform.cs +++ b/FinalEngine.Rendering/Core/Transform.cs @@ -5,8 +5,9 @@ namespace FinalEngine.Rendering.Core; using System.Numerics; +using FinalEngine.ECS; -public class Transform +public class Transform : IEntityComponent { public Transform() { diff --git a/FinalEngine.Rendering/FinalEngine.Rendering.csproj b/FinalEngine.Rendering/FinalEngine.Rendering.csproj index a7d46d9f..af61209d 100644 --- a/FinalEngine.Rendering/FinalEngine.Rendering.csproj +++ b/FinalEngine.Rendering/FinalEngine.Rendering.csproj @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -39,6 +39,7 @@ + diff --git a/FinalEngine.Runtime/FinalEngine.Runtime.csproj b/FinalEngine.Runtime/FinalEngine.Runtime.csproj index c577f3d6..7bfadcae 100644 --- a/FinalEngine.Runtime/FinalEngine.Runtime.csproj +++ b/FinalEngine.Runtime/FinalEngine.Runtime.csproj @@ -23,8 +23,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FinalEngine.Tests/ECS/Components/TagComponentTests.cs b/FinalEngine.Tests/ECS/Components/TagComponentTests.cs index 48f55d1e..4840c10e 100644 --- a/FinalEngine.Tests/ECS/Components/TagComponentTests.cs +++ b/FinalEngine.Tests/ECS/Components/TagComponentTests.cs @@ -10,12 +10,12 @@ namespace FinalEngine.Tests.ECS.Components; [TestFixture] public sealed class TagComponentTests { - private TagComponent component; + private Tag component; [SetUp] public void Setup() { - this.component = new TagComponent(); + this.component = new Tag(); } [Test] diff --git a/FinalEngine.Tests/FinalEngine.Tests.csproj b/FinalEngine.Tests/FinalEngine.Tests.csproj index 159a6d39..4a1c3e0d 100644 --- a/FinalEngine.Tests/FinalEngine.Tests.csproj +++ b/FinalEngine.Tests/FinalEngine.Tests.csproj @@ -25,17 +25,16 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/FinalEngine.Tests/Platform/Desktop/OpenTK/OpenTKWindowTests.cs b/FinalEngine.Tests/Platform/Desktop/OpenTK/OpenTKWindowTests.cs index f5683c4a..908751ec 100644 --- a/FinalEngine.Tests/Platform/Desktop/OpenTK/OpenTKWindowTests.cs +++ b/FinalEngine.Tests/Platform/Desktop/OpenTK/OpenTKWindowTests.cs @@ -194,7 +194,7 @@ public void ProcessEventsShouldInvokeProcessWindowEventsWhenInvoked() this.window.ProcessEvents(); // Assert - this.nativeWindow.Verify(x => x.ProcessWindowEvents(false), Times.Once); + this.nativeWindow.Verify(x => x.ProcessEvents(), Times.Once); } [Test] diff --git a/FinalEngine.sln b/FinalEngine.sln index 388ea187..38ebbc7e 100644 --- a/FinalEngine.sln +++ b/FinalEngine.sln @@ -59,8 +59,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FinalEngine.Editor.Desktop" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FinalEngine.Editor.ViewModels", "FinalEngine.Editor.ViewModels\FinalEngine.Editor.ViewModels.csproj", "{30AA51B6-3E6D-455D-8635-5A4034896E9F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FinalEngine.Rendering.Components", "FinalEngine.Rendering.Components\FinalEngine.Rendering.Components.csproj", "{B05CD0CD-A686-4516-A0DC-614506F97592}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -135,10 +133,6 @@ Global {30AA51B6-3E6D-455D-8635-5A4034896E9F}.Debug|x64.Build.0 = Debug|x64 {30AA51B6-3E6D-455D-8635-5A4034896E9F}.Release|x64.ActiveCfg = Release|x64 {30AA51B6-3E6D-455D-8635-5A4034896E9F}.Release|x64.Build.0 = Release|x64 - {B05CD0CD-A686-4516-A0DC-614506F97592}.Debug|x64.ActiveCfg = Debug|x64 - {B05CD0CD-A686-4516-A0DC-614506F97592}.Debug|x64.Build.0 = Debug|x64 - {B05CD0CD-A686-4516-A0DC-614506F97592}.Release|x64.ActiveCfg = Release|Any CPU - {B05CD0CD-A686-4516-A0DC-614506F97592}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -161,7 +155,6 @@ Global {8CD32B3A-FE76-432F-9B0E-382A4D91A46D} = {E560C356-F5BC-435B-9CA0-133C421DB04F} {99DC2107-26CF-407B-8D09-6540E16DB20E} = {E560C356-F5BC-435B-9CA0-133C421DB04F} {30AA51B6-3E6D-455D-8635-5A4034896E9F} = {E560C356-F5BC-435B-9CA0-133C421DB04F} - {B05CD0CD-A686-4516-A0DC-614506F97592} = {B2CD257E-E2BC-4259-A9B5-4DA90A7DE0B3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A278B383-0D14-41B3-A71C-4505E1D503DF}