From b959db9e7577a0160c299053bb83b4722e85224e Mon Sep 17 00:00:00 2001
From: Tornado Tech <54727692+Tornado-Technology@users.noreply.github.com>
Date: Tue, 20 Aug 2024 04:22:05 +1000
Subject: [PATCH] Big fucking refactor
---
.../Audio => Hypercube.Audio}/AudioFormat.cs | 5 +-
.../Audio => Hypercube.Audio}/AudioId.cs | 5 +-
.../Audio => Hypercube.Audio}/AudioStream.cs | 5 +-
.../Audio => Hypercube.Audio}/AudioType.cs | 8 +-
.../Events/AudioLibraryInitializedEvent.cs | 4 +-
.../Exceptions/UnregisteredLoaderException.cs | 12 ++
Hypercube.Audio/Hypercube.Audio.csproj | 13 ++
.../Audio => Hypercube.Audio}/IAudioGroup.cs | 5 +-
.../IAudioManager.cs | 9 +-
.../Audio => Hypercube.Audio}/IAudioSource.cs | 5 +-
.../Loading/AudioLoader.cs | 8 +-
.../Loading/IAudioData.cs | 5 +-
.../Loading/IAudioLoader.cs | 8 +-
.../Loading/TypeLoaders/AudioWavLoader.cs | 6 +-
.../Loading/TypeLoaders/IAudioTypeLoader.cs | 9 ++
.../Readers/Wav/AudioWavData.cs | 6 +-
.../Readers/Wav/AudioWavReader.cs | 4 +-
.../Resources/AudioResource.cs | 8 +-
Hypercube.Audio/Settings/AudioSettings.cs | 6 +
Hypercube.Audio/Settings/IAudioSettings.cs | 6 +
.../Utilities/Helpers/AudioTypeHelper.cs | 5 +-
.../Exceptions/UnregisteredLoaderException.cs | 10 --
.../Loading/TypeLoaders/IAudioTypeLoader.cs | 6 -
.../Audio/Settings/AudioSettings.cs | 3 -
.../Audio/Settings/IAudioSettings.cs | 3 -
Hypercube.Client/Dependencies.cs | 15 +-
.../Systems/Sprite/SpriteComponent.cs | 6 +-
.../Entities/Systems/Sprite/SpriteSystem.cs | 4 +-
Hypercube.Client/EntryPoint.cs | 3 +-
Hypercube.Client/Graphics/ImGui/ImGui.cs | 4 +-
.../Graphics/Monitors/IMonitorHandle.cs | 12 --
.../Graphics/Monitors/MonitorHandle.cs | 22 ---
.../Graphics/Monitors/MonitorRegistration.cs | 9 --
.../Realisation/OpenGL/BindingsContext.cs | 8 +-
.../Realisation/OpenGL/ContextVersion.cs | 19 ---
.../OpenGL/Rendering/Renderer.Drawing.cs | 2 +-
.../OpenGL/Rendering/Renderer.Monitors.cs | 10 +-
.../OpenGL/Rendering/Renderer.OpenGL.cs | 2 +-
.../OpenGL/Rendering/Renderer.Render.cs | 9 +-
.../OpenGL/Rendering/Renderer.Window.cs | 18 +--
.../Realisation/OpenGL/Rendering/Renderer.cs | 30 ++--
.../OpenGL/Texturing/TextureHandle.cs | 8 +-
.../OpenGL/Texturing/TextureManager.cs | 9 +-
.../Graphics/Rendering/IRenderer.cs | 7 +-
.../ShaderSourceResource.cs | 6 +-
.../Settings/TextureCreationSettings.cs | 21 +--
.../Texturing/Settings/TextureParameter.cs | 9 --
.../Graphics/Texturing/TextureResource.cs | 3 +-
.../GLFW/GlfwWindowManager.Callbacks.cs | 5 +-
.../GLFW/GlfwWindowManager.Init.cs | 4 +-
.../GLFW/GlfwWindowManager.Monitors.cs | 31 ++--
.../GLFW/GlfwWindowManager.Window.cs | 139 +++++++++---------
...{GlfwWindowManager.cs => GlfwWindowing.cs} | 35 ++---
.../Graphics/Windows/WindowCreateResult.cs | 9 --
Hypercube.Client/Hypercube.Client.csproj | 2 +
.../Input/Handler/IInputHandler.cs | 6 +-
.../Input/Handler/InputHandler.cs | 4 +-
Hypercube.Client/Preloader.cs | 14 +-
Hypercube.Client/Runtimes/Loop/RuntimeLoop.cs | 4 +-
Hypercube.Client/Runtimes/Runtime.cs | 7 +-
.../DependenciesContainer.cs | 2 +-
Hypercube.Dependencies/DependencyAttribute.cs | 6 +-
Hypercube.Dependencies/IPostInject.cs | 5 +-
.../Camera/CameraSystem.cs | 2 +-
.../Controls/ControlsSystem.cs | 2 +-
Hypercube.Example.Client/Example.cs | 10 +-
Hypercube.Example.Client/ExampleSystem.cs | 2 +-
Hypercube.Graphics/Hypercube.Graphics.csproj | 1 +
Hypercube.Graphics/IContextInfo.cs | 3 +
Hypercube.Graphics/Monitors/MonitorHandle.cs | 37 +++++
.../Monitors/MonitorId.cs | 9 +-
.../Monitors/VideoMode.cs | 2 +-
.../Texturing/ITexture.cs | 9 +-
.../Texturing/ITextureHandle.cs | 6 +-
.../Texturing/ITextureManager.cs | 9 +-
.../Texturing/Parameters/PixelFormat.cs | 5 +-
.../Parameters/PixelInternalFormat.cs | 11 +-
.../Texturing/Parameters/PixelType.cs | 5 +-
.../Parameters/TextureParameterName.cs | 5 +-
.../Texturing/Parameters/TextureTarget.cs | 5 +-
.../Settings/ITextureCreationSettings.cs | 6 +-
.../Texturing/Settings/TextureParameter.cs | 17 +++
.../Texturing/Texture.cs | 29 ++--
.../Windowing/IWindowing.cs | 22 ++-
.../Windowing/WindowCreateResult.cs | 23 +++
.../Windowing}/WindowCreateSettings.cs | 16 +-
Hypercube.Graphics/Windowing/WindowHandle.cs | 13 +-
Hypercube.Logging/ILogger.cs | 2 +-
Hypercube.Logging/Logger.cs | 2 +-
Hypercube.Logging/LoggingLevel.cs | 2 +-
Hypercube.Logging/LoggingManager.cs | 2 +-
.../ContextExtension.cs | 2 +-
Hypercube.OpenAL/Hypercube.OpenAL.csproj | 19 +++
.../OpenAlAudioManager.AudioHandler.cs | 4 +-
.../OpenAlAudioManager.AudioLoading.cs | 15 +-
.../OpenAlAudioManager.AudioSource.cs | 20 ++-
.../OpenAlAudioManager.SourceManagement.cs | 2 +-
.../OpenAlAudioManager.cs | 15 +-
Hypercube.OpenGL/ContextVersion.cs | 22 +++
.../Utilities/Helpers/GLSettingsHelper.cs | 5 +-
.../Utilities/Helpers/TextureHelper.cs | 13 +-
.../Container/IResourceContainer.cs | 2 +-
.../Container/ResourceContainer.cs | 4 +-
.../DirContentRoot.cs | 4 +-
.../Hypercube.Resources.csproj | 18 +++
.../IContentRoot.cs | 2 +-
.../Manager/IResourceLoader.cs | 2 +-
.../Manager/ResourceLoader.cs | 32 +---
Hypercube.Resources/Preloader/IPreloader.cs | 3 +
.../Preloader/IResourcePreloader.cs | 3 +
.../Preloader/PreloadingAttribute.cs | 2 +-
.../Preloader/ResourcePreloader.cs | 5 +-
.../Resource.cs | 14 +-
.../ResourcePath.cs | 13 +-
Hypercube.Runtime/Events/InputFrameEvent.cs | 15 ++
Hypercube.Runtime/Events/RenderFrameEvent.cs | 15 ++
.../Events}/RuntimeInitializationEvent.cs | 4 +-
.../Events}/RuntimeShutdownEvent.cs | 4 +-
.../Events}/RuntimeStartupEvent.cs | 4 +-
Hypercube.Runtime/Events/TickFrameEvent.cs | 15 ++
Hypercube.Runtime/Events/UpdateFrameEvent.cs | 15 ++
Hypercube.Runtime/Hypercube.Runtime.csproj | 13 ++
.../IRuntime.cs | 5 +-
.../IRuntimeLoop.cs | 5 +-
Hypercube.Server/Dependencies.cs | 6 +-
Hypercube.Server/EntryPoint.cs | 2 +-
Hypercube.Server/Runtimes/Loop/RuntimeLoop.cs | 4 +-
Hypercube.Server/Runtimes/Runtime.cs | 7 +-
.../Manager/EntitiesComponentManager.cs | 2 +-
.../Manager/EntitiesSystemManager.cs | 3 +-
.../Realisation/Systems/EntitySystem.cs | 5 +-
.../Realisation/Systems/IEntitySystem.cs | 3 +-
.../Entities/Systems/Physics/PhysicsSystem.cs | 2 +-
Hypercube.Shared/Hypercube.Shared.csproj | 2 +
Hypercube.Shared/Physics/PhysicsManager.cs | 2 +-
.../Resources/Preloader/IPreloader.cs | 3 -
.../Resources/Preloader/IResourcePreloader.cs | 3 -
.../Runtimes/Loop/Event/InputFrameEvent.cs | 8 -
.../Runtimes/Loop/Event/RenderFrameEvent.cs | 8 -
.../Runtimes/Loop/Event/TickFrameEvent.cs | 8 -
.../Runtimes/Loop/Event/UpdateFrameEvent.cs | 8 -
Hypercube.Shared/SahredMount.cs | 18 +++
Hypercube.Shared/SharedDependencies.cs | 6 +-
Hypercube.Shared/SharedEntryPoint.cs | 4 +-
.../ArgumentsParser/ArgumentParser.cs | 14 --
Hypercube.UnitTests/Entities/QueriesTests.cs | 2 +-
.../ResourceManager/ResourceManagerTests.cs | 6 +-
.../ResourceManager/ResourcePathTest.cs | 2 +-
Hypercube.Utilities/ArgumentParser.cs | 24 +++
Hypercube.sln | 31 ++++
150 files changed, 855 insertions(+), 574 deletions(-)
rename {Hypercube.Client/Audio => Hypercube.Audio}/AudioFormat.cs (79%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/AudioId.cs (92%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/AudioStream.cs (94%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/AudioType.cs (85%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Events/AudioLibraryInitializedEvent.cs (59%)
create mode 100644 Hypercube.Audio/Exceptions/UnregisteredLoaderException.cs
create mode 100644 Hypercube.Audio/Hypercube.Audio.csproj
rename {Hypercube.Client/Audio => Hypercube.Audio}/IAudioGroup.cs (64%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/IAudioManager.cs (87%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/IAudioSource.cs (86%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Loading/AudioLoader.cs (80%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Loading/IAudioData.cs (78%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Loading/IAudioLoader.cs (82%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Loading/TypeLoaders/AudioWavLoader.cs (62%)
create mode 100644 Hypercube.Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
rename {Hypercube.Client/Audio => Hypercube.Audio}/Readers/Wav/AudioWavData.cs (94%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Readers/Wav/AudioWavReader.cs (97%)
rename {Hypercube.Client/Audio => Hypercube.Audio}/Resources/AudioResource.cs (85%)
create mode 100644 Hypercube.Audio/Settings/AudioSettings.cs
create mode 100644 Hypercube.Audio/Settings/IAudioSettings.cs
rename {Hypercube.Client => Hypercube.Audio}/Utilities/Helpers/AudioTypeHelper.cs (92%)
delete mode 100644 Hypercube.Client/Audio/Loading/Exceptions/UnregisteredLoaderException.cs
delete mode 100644 Hypercube.Client/Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
delete mode 100644 Hypercube.Client/Audio/Settings/AudioSettings.cs
delete mode 100644 Hypercube.Client/Audio/Settings/IAudioSettings.cs
delete mode 100644 Hypercube.Client/Graphics/Monitors/IMonitorHandle.cs
delete mode 100644 Hypercube.Client/Graphics/Monitors/MonitorHandle.cs
delete mode 100644 Hypercube.Client/Graphics/Monitors/MonitorRegistration.cs
delete mode 100644 Hypercube.Client/Graphics/Realisation/OpenGL/ContextVersion.cs
rename Hypercube.Client/{Resources/Caching => Graphics}/ShaderSourceResource.cs (90%)
delete mode 100644 Hypercube.Client/Graphics/Texturing/Settings/TextureParameter.cs
rename Hypercube.Client/Graphics/Windows/Realisation/GLFW/{GlfwWindowManager.cs => GlfwWindowing.cs} (69%)
delete mode 100644 Hypercube.Client/Graphics/Windows/WindowCreateResult.cs
create mode 100644 Hypercube.Graphics/IContextInfo.cs
create mode 100644 Hypercube.Graphics/Monitors/MonitorHandle.cs
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Monitors/MonitorId.cs (82%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Monitors/VideoMode.cs (90%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/ITexture.cs (55%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/ITextureHandle.cs (58%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/ITextureManager.cs (76%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Parameters/PixelFormat.cs (90%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Parameters/PixelInternalFormat.cs (97%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Parameters/PixelType.cs (90%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Parameters/TextureParameterName.cs (96%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Parameters/TextureTarget.cs (94%)
rename {Hypercube.Client/Graphics => Hypercube.Graphics}/Texturing/Settings/ITextureCreationSettings.cs (70%)
create mode 100644 Hypercube.Graphics/Texturing/Settings/TextureParameter.cs
rename {Hypercube.Client/Graphics/Realisation/OpenGL => Hypercube.Graphics}/Texturing/Texture.cs (59%)
rename Hypercube.Client/Graphics/Windows/IWindowManager.cs => Hypercube.Graphics/Windowing/IWindowing.cs (63%)
create mode 100644 Hypercube.Graphics/Windowing/WindowCreateResult.cs
rename {Hypercube.Client/Graphics/Windows => Hypercube.Graphics/Windowing}/WindowCreateSettings.cs (65%)
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/ContextExtension.cs (68%)
create mode 100644 Hypercube.OpenAL/Hypercube.OpenAL.csproj
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/OpenAlAudioManager.AudioHandler.cs (79%)
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/OpenAlAudioManager.AudioLoading.cs (86%)
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/OpenAlAudioManager.AudioSource.cs (78%)
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/OpenAlAudioManager.SourceManagement.cs (93%)
rename {Hypercube.Client/Audio/Realisations/OpenAL => Hypercube.OpenAL}/OpenAlAudioManager.cs (94%)
create mode 100644 Hypercube.OpenGL/ContextVersion.cs
rename {Hypercube.Client => Hypercube.OpenGL}/Utilities/Helpers/TextureHelper.cs (83%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Container/IResourceContainer.cs (92%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Container/ResourceContainer.cs (97%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/DirContentRoot.cs (95%)
create mode 100644 Hypercube.Resources/Hypercube.Resources.csproj
rename {Hypercube.Shared/Resources => Hypercube.Resources}/IContentRoot.cs (85%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Manager/IResourceLoader.cs (93%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Manager/ResourceLoader.cs (80%)
create mode 100644 Hypercube.Resources/Preloader/IPreloader.cs
create mode 100644 Hypercube.Resources/Preloader/IResourcePreloader.cs
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Preloader/PreloadingAttribute.cs (81%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Preloader/ResourcePreloader.cs (96%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/Resource.cs (82%)
rename {Hypercube.Shared/Resources => Hypercube.Resources}/ResourcePath.cs (95%)
create mode 100644 Hypercube.Runtime/Events/InputFrameEvent.cs
create mode 100644 Hypercube.Runtime/Events/RenderFrameEvent.cs
rename {Hypercube.Shared/Runtimes/Event => Hypercube.Runtime/Events}/RuntimeInitializationEvent.cs (58%)
rename {Hypercube.Shared/Runtimes/Event => Hypercube.Runtime/Events}/RuntimeShutdownEvent.cs (60%)
rename {Hypercube.Shared/Runtimes/Event => Hypercube.Runtime/Events}/RuntimeStartupEvent.cs (56%)
create mode 100644 Hypercube.Runtime/Events/TickFrameEvent.cs
create mode 100644 Hypercube.Runtime/Events/UpdateFrameEvent.cs
create mode 100644 Hypercube.Runtime/Hypercube.Runtime.csproj
rename {Hypercube.Shared/Runtimes => Hypercube.Runtime}/IRuntime.cs (59%)
rename {Hypercube.Shared/Runtimes/Loop => Hypercube.Runtime}/IRuntimeLoop.cs (56%)
delete mode 100644 Hypercube.Shared/Resources/Preloader/IPreloader.cs
delete mode 100644 Hypercube.Shared/Resources/Preloader/IResourcePreloader.cs
delete mode 100644 Hypercube.Shared/Runtimes/Loop/Event/InputFrameEvent.cs
delete mode 100644 Hypercube.Shared/Runtimes/Loop/Event/RenderFrameEvent.cs
delete mode 100644 Hypercube.Shared/Runtimes/Loop/Event/TickFrameEvent.cs
delete mode 100644 Hypercube.Shared/Runtimes/Loop/Event/UpdateFrameEvent.cs
create mode 100644 Hypercube.Shared/SahredMount.cs
delete mode 100644 Hypercube.Shared/Utilities/ArgumentsParser/ArgumentParser.cs
create mode 100644 Hypercube.Utilities/ArgumentParser.cs
diff --git a/Hypercube.Client/Audio/AudioFormat.cs b/Hypercube.Audio/AudioFormat.cs
similarity index 79%
rename from Hypercube.Client/Audio/AudioFormat.cs
rename to Hypercube.Audio/AudioFormat.cs
index 5e5df5c..0059c51 100644
--- a/Hypercube.Client/Audio/AudioFormat.cs
+++ b/Hypercube.Audio/AudioFormat.cs
@@ -1,9 +1,12 @@
-namespace Hypercube.Client.Audio;
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio;
///
/// Formats in which the audio library can read .
/// some may require additional support from drivers and devices.
///
+[PublicAPI]
public enum AudioFormat
{
Mono8 = 0x1100,
diff --git a/Hypercube.Client/Audio/AudioId.cs b/Hypercube.Audio/AudioId.cs
similarity index 92%
rename from Hypercube.Client/Audio/AudioId.cs
rename to Hypercube.Audio/AudioId.cs
index 0c9e5d0..563e553 100644
--- a/Hypercube.Client/Audio/AudioId.cs
+++ b/Hypercube.Audio/AudioId.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Audio;
+using JetBrains.Annotations;
+namespace Hypercube.Audio;
+
+[PublicAPI]
public readonly struct AudioId(int value) : IEquatable
{
public static readonly AudioId Invalid = new(-1);
diff --git a/Hypercube.Client/Audio/AudioStream.cs b/Hypercube.Audio/AudioStream.cs
similarity index 94%
rename from Hypercube.Client/Audio/AudioStream.cs
rename to Hypercube.Audio/AudioStream.cs
index 5da877b..031a6ed 100644
--- a/Hypercube.Client/Audio/AudioStream.cs
+++ b/Hypercube.Audio/AudioStream.cs
@@ -1,10 +1,13 @@
-namespace Hypercube.Client.Audio;
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio;
///
/// Provides information about the loaded audio file to the external environment
/// and contains all the information necessary to create a .
///
///
+[PublicAPI]
public sealed class AudioStream : IDisposable
{
public readonly AudioId Id;
diff --git a/Hypercube.Client/Audio/AudioType.cs b/Hypercube.Audio/AudioType.cs
similarity index 85%
rename from Hypercube.Client/Audio/AudioType.cs
rename to Hypercube.Audio/AudioType.cs
index 0f4ba09..2eca32b 100644
--- a/Hypercube.Client/Audio/AudioType.cs
+++ b/Hypercube.Audio/AudioType.cs
@@ -1,7 +1,8 @@
-using Hypercube.Client.Audio.Loading;
-using Hypercube.Client.Audio.Loading.TypeLoaders;
+using Hypercube.Audio.Loading;
+using Hypercube.Audio.Loading.TypeLoaders;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio;
+namespace Hypercube.Audio;
///
/// Displays all sound file types available on the engine side,
@@ -13,6 +14,7 @@ namespace Hypercube.Client.Audio;
///
///
///
+[PublicAPI]
public enum AudioType
{
_3gp,
diff --git a/Hypercube.Client/Audio/Events/AudioLibraryInitializedEvent.cs b/Hypercube.Audio/Events/AudioLibraryInitializedEvent.cs
similarity index 59%
rename from Hypercube.Client/Audio/Events/AudioLibraryInitializedEvent.cs
rename to Hypercube.Audio/Events/AudioLibraryInitializedEvent.cs
index 2da314a..a2f1409 100644
--- a/Hypercube.Client/Audio/Events/AudioLibraryInitializedEvent.cs
+++ b/Hypercube.Audio/Events/AudioLibraryInitializedEvent.cs
@@ -1,5 +1,7 @@
using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Events;
+namespace Hypercube.Audio.Events;
+[PublicAPI]
public readonly record struct AudioLibraryInitializedEvent : IEventArgs;
\ No newline at end of file
diff --git a/Hypercube.Audio/Exceptions/UnregisteredLoaderException.cs b/Hypercube.Audio/Exceptions/UnregisteredLoaderException.cs
new file mode 100644
index 0000000..24ff43e
--- /dev/null
+++ b/Hypercube.Audio/Exceptions/UnregisteredLoaderException.cs
@@ -0,0 +1,12 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio.Exceptions;
+
+[PublicAPI]
+public sealed class UnregisteredLoaderException : Exception
+{
+ public UnregisteredLoaderException(AudioType type) : base($"Loader for type {type} not registered")
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Audio/Hypercube.Audio.csproj b/Hypercube.Audio/Hypercube.Audio.csproj
new file mode 100644
index 0000000..dc4e0e0
--- /dev/null
+++ b/Hypercube.Audio/Hypercube.Audio.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/Hypercube.Client/Audio/IAudioGroup.cs b/Hypercube.Audio/IAudioGroup.cs
similarity index 64%
rename from Hypercube.Client/Audio/IAudioGroup.cs
rename to Hypercube.Audio/IAudioGroup.cs
index d4c3af1..6125288 100644
--- a/Hypercube.Client/Audio/IAudioGroup.cs
+++ b/Hypercube.Audio/IAudioGroup.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Audio;
+using JetBrains.Annotations;
+namespace Hypercube.Audio;
+
+[PublicAPI]
public interface IAudioGroup
{
float Gain { get; }
diff --git a/Hypercube.Client/Audio/IAudioManager.cs b/Hypercube.Audio/IAudioManager.cs
similarity index 87%
rename from Hypercube.Client/Audio/IAudioManager.cs
rename to Hypercube.Audio/IAudioManager.cs
index 3a8d097..99ae085 100644
--- a/Hypercube.Client/Audio/IAudioManager.cs
+++ b/Hypercube.Audio/IAudioManager.cs
@@ -1,13 +1,14 @@
-using Hypercube.Client.Audio.Settings;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Runtimes.Event;
+using Hypercube.Audio.Settings;
+using Hypercube.Resources;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio;
+namespace Hypercube.Audio;
///
/// Realization of audio library for work with audio devices,
/// as well as for work with .
///
+[PublicAPI]
public interface IAudioManager
{
///
diff --git a/Hypercube.Client/Audio/IAudioSource.cs b/Hypercube.Audio/IAudioSource.cs
similarity index 86%
rename from Hypercube.Client/Audio/IAudioSource.cs
rename to Hypercube.Audio/IAudioSource.cs
index 76e64b6..29afef8 100644
--- a/Hypercube.Client/Audio/IAudioSource.cs
+++ b/Hypercube.Audio/IAudioSource.cs
@@ -1,10 +1,13 @@
-namespace Hypercube.Client.Audio;
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio;
///
/// Source created from ,
/// its implementation is the responsibility of the current
/// implementation.
///
+[PublicAPI]
public interface IAudioSource : IDisposable
{
IAudioGroup? Group { get; }
diff --git a/Hypercube.Client/Audio/Loading/AudioLoader.cs b/Hypercube.Audio/Loading/AudioLoader.cs
similarity index 80%
rename from Hypercube.Client/Audio/Loading/AudioLoader.cs
rename to Hypercube.Audio/Loading/AudioLoader.cs
index 9fa5bbf..7d8097a 100644
--- a/Hypercube.Client/Audio/Loading/AudioLoader.cs
+++ b/Hypercube.Audio/Loading/AudioLoader.cs
@@ -1,9 +1,11 @@
using System.Collections.Frozen;
-using Hypercube.Client.Audio.Loading.Exceptions;
-using Hypercube.Client.Audio.Loading.TypeLoaders;
+using Hypercube.Audio.Exceptions;
+using Hypercube.Audio.Loading.TypeLoaders;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Loading;
+namespace Hypercube.Audio.Loading;
+[PublicAPI]
public sealed class AudioLoader : IAudioLoader
{
///
diff --git a/Hypercube.Client/Audio/Loading/IAudioData.cs b/Hypercube.Audio/Loading/IAudioData.cs
similarity index 78%
rename from Hypercube.Client/Audio/Loading/IAudioData.cs
rename to Hypercube.Audio/Loading/IAudioData.cs
index 026aa9c..a8f5b41 100644
--- a/Hypercube.Client/Audio/Loading/IAudioData.cs
+++ b/Hypercube.Audio/Loading/IAudioData.cs
@@ -1,8 +1,11 @@
-namespace Hypercube.Client.Audio.Loading;
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio.Loading;
///
/// Provides information about the read audio file to be loaded by .
///
+[PublicAPI]
public interface IAudioData
{
AudioFormat Format { get; }
diff --git a/Hypercube.Client/Audio/Loading/IAudioLoader.cs b/Hypercube.Audio/Loading/IAudioLoader.cs
similarity index 82%
rename from Hypercube.Client/Audio/Loading/IAudioLoader.cs
rename to Hypercube.Audio/Loading/IAudioLoader.cs
index 0a3ed13..4bb9231 100644
--- a/Hypercube.Client/Audio/Loading/IAudioLoader.cs
+++ b/Hypercube.Audio/Loading/IAudioLoader.cs
@@ -1,12 +1,14 @@
-using Hypercube.Client.Audio.Loading.Exceptions;
-using Hypercube.Client.Audio.Loading.TypeLoaders;
+using Hypercube.Audio.Exceptions;
+using Hypercube.Audio.Loading.TypeLoaders;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Loading;
+namespace Hypercube.Audio.Loading;
///
/// A router for audio files that selects a
/// based on , and invoke it.
///
+[PublicAPI]
public interface IAudioLoader
{
///
diff --git a/Hypercube.Client/Audio/Loading/TypeLoaders/AudioWavLoader.cs b/Hypercube.Audio/Loading/TypeLoaders/AudioWavLoader.cs
similarity index 62%
rename from Hypercube.Client/Audio/Loading/TypeLoaders/AudioWavLoader.cs
rename to Hypercube.Audio/Loading/TypeLoaders/AudioWavLoader.cs
index 6c9db8e..512ad9e 100644
--- a/Hypercube.Client/Audio/Loading/TypeLoaders/AudioWavLoader.cs
+++ b/Hypercube.Audio/Loading/TypeLoaders/AudioWavLoader.cs
@@ -1,7 +1,9 @@
-using Hypercube.Client.Audio.Readers.Wav;
+using Hypercube.Audio.Readers.Wav;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Loading.TypeLoaders;
+namespace Hypercube.Audio.Loading.TypeLoaders;
+[PublicAPI]
public sealed class AudioWavLoader : IAudioTypeLoader
{
public IAudioData LoadAudioData(Stream stream)
diff --git a/Hypercube.Audio/Loading/TypeLoaders/IAudioTypeLoader.cs b/Hypercube.Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
new file mode 100644
index 0000000..5194654
--- /dev/null
+++ b/Hypercube.Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
@@ -0,0 +1,9 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio.Loading.TypeLoaders;
+
+[PublicAPI]
+public interface IAudioTypeLoader
+{
+ IAudioData LoadAudioData(Stream stream);
+}
\ No newline at end of file
diff --git a/Hypercube.Client/Audio/Readers/Wav/AudioWavData.cs b/Hypercube.Audio/Readers/Wav/AudioWavData.cs
similarity index 94%
rename from Hypercube.Client/Audio/Readers/Wav/AudioWavData.cs
rename to Hypercube.Audio/Readers/Wav/AudioWavData.cs
index 4f5b6ef..b487d0f 100644
--- a/Hypercube.Client/Audio/Readers/Wav/AudioWavData.cs
+++ b/Hypercube.Audio/Readers/Wav/AudioWavData.cs
@@ -1,6 +1,7 @@
-using Hypercube.Client.Audio.Loading;
+using Hypercube.Audio.Loading;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Readers.Wav;
+namespace Hypercube.Audio.Readers.Wav;
///
/// Read the specification for more information
@@ -9,6 +10,7 @@ namespace Hypercube.Client.Audio.Readers.Wav;
/// 8-bit samples are stored as unsigned bytes, ranging from 0 to 255.
/// 16-bit samples are stored as 2's-complement signed integers, ranging from -32768 to 32767.
///
+[PublicAPI]
public readonly struct AudioWavData : IAudioData
{
public AudioFormat Format { get; }
diff --git a/Hypercube.Client/Audio/Readers/Wav/AudioWavReader.cs b/Hypercube.Audio/Readers/Wav/AudioWavReader.cs
similarity index 97%
rename from Hypercube.Client/Audio/Readers/Wav/AudioWavReader.cs
rename to Hypercube.Audio/Readers/Wav/AudioWavReader.cs
index b5622a0..0c5aeba 100644
--- a/Hypercube.Client/Audio/Readers/Wav/AudioWavReader.cs
+++ b/Hypercube.Audio/Readers/Wav/AudioWavReader.cs
@@ -1,8 +1,10 @@
using System.Runtime.CompilerServices;
using System.Text;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Readers.Wav;
+namespace Hypercube.Audio.Readers.Wav;
+[PublicAPI]
public sealed class AudioWavReader : IDisposable
{
private const int ChunkSize = 4 * sizeof(byte) + 1 * sizeof(uint);
diff --git a/Hypercube.Client/Audio/Resources/AudioResource.cs b/Hypercube.Audio/Resources/AudioResource.cs
similarity index 85%
rename from Hypercube.Client/Audio/Resources/AudioResource.cs
rename to Hypercube.Audio/Resources/AudioResource.cs
index 3d29659..059f22c 100644
--- a/Hypercube.Client/Audio/Resources/AudioResource.cs
+++ b/Hypercube.Audio/Resources/AudioResource.cs
@@ -1,9 +1,11 @@
-using Hypercube.Client.Audio.Settings;
+using Hypercube.Audio.Settings;
using Hypercube.Dependencies;
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Audio.Resources;
+namespace Hypercube.Audio.Resources;
+[PublicAPI]
public sealed class AudioResource : Resource, IDisposable
{
public ResourcePath Path;
diff --git a/Hypercube.Audio/Settings/AudioSettings.cs b/Hypercube.Audio/Settings/AudioSettings.cs
new file mode 100644
index 0000000..4a49978
--- /dev/null
+++ b/Hypercube.Audio/Settings/AudioSettings.cs
@@ -0,0 +1,6 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio.Settings;
+
+[PublicAPI]
+public readonly struct AudioSettings : IAudioSettings;
\ No newline at end of file
diff --git a/Hypercube.Audio/Settings/IAudioSettings.cs b/Hypercube.Audio/Settings/IAudioSettings.cs
new file mode 100644
index 0000000..a163529
--- /dev/null
+++ b/Hypercube.Audio/Settings/IAudioSettings.cs
@@ -0,0 +1,6 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Audio.Settings;
+
+[PublicAPI]
+public interface IAudioSettings;
\ No newline at end of file
diff --git a/Hypercube.Client/Utilities/Helpers/AudioTypeHelper.cs b/Hypercube.Audio/Utilities/Helpers/AudioTypeHelper.cs
similarity index 92%
rename from Hypercube.Client/Utilities/Helpers/AudioTypeHelper.cs
rename to Hypercube.Audio/Utilities/Helpers/AudioTypeHelper.cs
index 31e36b1..360ca4e 100644
--- a/Hypercube.Client/Utilities/Helpers/AudioTypeHelper.cs
+++ b/Hypercube.Audio/Utilities/Helpers/AudioTypeHelper.cs
@@ -1,9 +1,10 @@
using System.Collections.Frozen;
-using Hypercube.Client.Audio;
using Hypercube.Utilities.Extensions;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Utilities.Helpers;
+namespace Hypercube.Audio.Utilities.Helpers;
+[PublicAPI]
public static class AudioTypeHelper
{
private static readonly FrozenDictionary TypesAssociation;
diff --git a/Hypercube.Client/Audio/Loading/Exceptions/UnregisteredLoaderException.cs b/Hypercube.Client/Audio/Loading/Exceptions/UnregisteredLoaderException.cs
deleted file mode 100644
index ca2936e..0000000
--- a/Hypercube.Client/Audio/Loading/Exceptions/UnregisteredLoaderException.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Hypercube.Client.Audio.Loading.Exceptions;
-
-public sealed class UnregisteredLoaderException : System.Exception
-{
- public UnregisteredLoaderException(AudioType type) : base(
- $"Loader for type {type} not registered")
- {
-
- }
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Audio/Loading/TypeLoaders/IAudioTypeLoader.cs b/Hypercube.Client/Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
deleted file mode 100644
index 60178b4..0000000
--- a/Hypercube.Client/Audio/Loading/TypeLoaders/IAudioTypeLoader.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Hypercube.Client.Audio.Loading.TypeLoaders;
-
-public interface IAudioTypeLoader
-{
- IAudioData LoadAudioData(Stream stream);
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Audio/Settings/AudioSettings.cs b/Hypercube.Client/Audio/Settings/AudioSettings.cs
deleted file mode 100644
index a54cd15..0000000
--- a/Hypercube.Client/Audio/Settings/AudioSettings.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Hypercube.Client.Audio.Settings;
-
-public readonly struct AudioSettings : IAudioSettings;
\ No newline at end of file
diff --git a/Hypercube.Client/Audio/Settings/IAudioSettings.cs b/Hypercube.Client/Audio/Settings/IAudioSettings.cs
deleted file mode 100644
index 640da66..0000000
--- a/Hypercube.Client/Audio/Settings/IAudioSettings.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Hypercube.Client.Audio.Settings;
-
-public interface IAudioSettings;
\ No newline at end of file
diff --git a/Hypercube.Client/Dependencies.cs b/Hypercube.Client/Dependencies.cs
index 75df5d4..1709f75 100644
--- a/Hypercube.Client/Dependencies.cs
+++ b/Hypercube.Client/Dependencies.cs
@@ -1,21 +1,18 @@
-using Hypercube.Client.Audio;
-using Hypercube.Client.Audio.Loading;
-using Hypercube.Client.Audio.Realisations.OpenAL;
-using Hypercube.Client.Graphics.ImGui;
+using Hypercube.Audio;
+using Hypercube.Audio.Loading;
using Hypercube.Client.Graphics.Realisation.OpenGL.Rendering;
using Hypercube.Client.Graphics.Realisation.OpenGL.Texturing;
using Hypercube.Client.Graphics.Rendering;
-using Hypercube.Client.Graphics.Texturing;
using Hypercube.Client.Graphics.Viewports;
using Hypercube.Client.Input.Handler;
using Hypercube.Client.Input.Manager;
-using Hypercube.Client.Runtimes;
using Hypercube.Client.Runtimes.Loop;
using Hypercube.Dependencies;
+using Hypercube.Graphics.Texturing;
using Hypercube.ImGui;
+using Hypercube.OpenAL;
+using Hypercube.Runtime;
using Hypercube.Shared;
-using Hypercube.Shared.Runtimes;
-using Hypercube.Shared.Runtimes.Loop;
namespace Hypercube.Client;
@@ -48,7 +45,7 @@ public static void Register(DependenciesContainer rootContainer)
// Runtime
rootContainer.Register();
- rootContainer.Register();
+ rootContainer.Register();
rootContainer.InstantiateAll();
}
diff --git a/Hypercube.Client/Entities/Systems/Sprite/SpriteComponent.cs b/Hypercube.Client/Entities/Systems/Sprite/SpriteComponent.cs
index 4e8a844..245f718 100644
--- a/Hypercube.Client/Entities/Systems/Sprite/SpriteComponent.cs
+++ b/Hypercube.Client/Entities/Systems/Sprite/SpriteComponent.cs
@@ -1,11 +1,13 @@
-using Hypercube.Client.Graphics.Texturing;
+using Hypercube.Graphics.Texturing;
using Hypercube.Shared.Entities.Realisation.Components;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Transforms;
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
+using JetBrains.Annotations;
namespace Hypercube.Client.Entities.Systems.Sprite;
+[PublicAPI]
public sealed class SpriteComponent : Component
{
public ITextureHandle TextureHandle = default!;
diff --git a/Hypercube.Client/Entities/Systems/Sprite/SpriteSystem.cs b/Hypercube.Client/Entities/Systems/Sprite/SpriteSystem.cs
index 302ec15..1d8e071 100644
--- a/Hypercube.Client/Entities/Systems/Sprite/SpriteSystem.cs
+++ b/Hypercube.Client/Entities/Systems/Sprite/SpriteSystem.cs
@@ -4,11 +4,11 @@
using Hypercube.Dependencies;
using Hypercube.Mathematics.Shapes;
using Hypercube.Mathematics.Transforms;
+using Hypercube.Resources.Container;
using Hypercube.Shared.Entities.Realisation;
using Hypercube.Shared.Entities.Realisation.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
using Hypercube.Shared.Entities.Systems.Transform;
-using Hypercube.Shared.Resources.Container;
namespace Hypercube.Client.Entities.Systems.Sprite;
@@ -43,6 +43,6 @@ private void OnRenderDrawing(ref RenderDrawingEvent args)
public void Render(Entity entity, Transform2 transform)
{
- _renderer.DrawTexture(entity.Component.TextureHandle, entity.Component.TextureHandle.Texture.QuadCrateTranslated(), Box2.UV, entity.Component.Color, transform.Matrix * entity.Component.Transform.Matrix);
+ _renderer.DrawTexture(entity.Component.TextureHandle, entity.Component.TextureHandle.Texture.Quad, Box2.UV, entity.Component.Color, transform.Matrix * entity.Component.Transform.Matrix);
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/EntryPoint.cs b/Hypercube.Client/EntryPoint.cs
index 320ab73..c52e8fc 100644
--- a/Hypercube.Client/EntryPoint.cs
+++ b/Hypercube.Client/EntryPoint.cs
@@ -1,6 +1,6 @@
using Hypercube.Dependencies;
using Hypercube.Shared;
-using Hypercube.Shared.Utilities.ArgumentsParser;
+using Hypercube.Utilities;
namespace Hypercube.Client;
@@ -9,5 +9,6 @@ public sealed class EntryPoint : SharedEntryPoint
protected override void Enter(ArgumentParser parser, DependenciesContainer rootContainer)
{
Dependencies.Register(rootContainer);
+ MountFolders.Mount(rootContainer);
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/ImGui/ImGui.cs b/Hypercube.Client/Graphics/ImGui/ImGui.cs
index 36e24b5..c8dffbd 100644
--- a/Hypercube.Client/Graphics/ImGui/ImGui.cs
+++ b/Hypercube.Client/Graphics/ImGui/ImGui.cs
@@ -6,8 +6,8 @@
using Hypercube.EventBus;
using Hypercube.ImGui;
using Hypercube.Input;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Logging;
+using Hypercube.Runtime.Events;
using JetBrains.Annotations;
namespace Hypercube.Client.Graphics.ImGui;
diff --git a/Hypercube.Client/Graphics/Monitors/IMonitorHandle.cs b/Hypercube.Client/Graphics/Monitors/IMonitorHandle.cs
deleted file mode 100644
index 906b49e..0000000
--- a/Hypercube.Client/Graphics/Monitors/IMonitorHandle.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using Hypercube.Mathematics.Vectors;
-
-namespace Hypercube.Client.Graphics.Monitors;
-
-public interface IMonitorHandle
-{
- MonitorId Id { get; }
- string Name { get; }
- Vector2Int Size { get; }
- int RefreshRate { get; }
- VideoMode[] VideoModes { get; }
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Monitors/MonitorHandle.cs b/Hypercube.Client/Graphics/Monitors/MonitorHandle.cs
deleted file mode 100644
index 0a1d43b..0000000
--- a/Hypercube.Client/Graphics/Monitors/MonitorHandle.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Hypercube.Mathematics.Vectors;
-
-namespace Hypercube.Client.Graphics.Monitors;
-
-public class MonitorHandle(MonitorId id, string name, Vector2Int size, int refreshRate, VideoMode[] videoModes) : IMonitorHandle
-{
- public MonitorId Id { get; } = id;
- public string Name { get; } = name;
- public Vector2Int Size { get; } = size;
- public int RefreshRate { get; } = refreshRate;
- public VideoMode[] VideoModes { get; } = videoModes;
-
- public MonitorHandle(int id, string name, int width, int height, int refreshRate, VideoMode[] videoModes) : this(new MonitorId(id), name, (width, height), refreshRate, videoModes)
- {
-
- }
-
- public override string ToString()
- {
- return $"MonitorHandle {Id.Value}, name: {Name}, size: {Size}, rate: {RefreshRate}, mode: ({VideoModes.Length})";
- }
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Monitors/MonitorRegistration.cs b/Hypercube.Client/Graphics/Monitors/MonitorRegistration.cs
deleted file mode 100644
index b69401a..0000000
--- a/Hypercube.Client/Graphics/Monitors/MonitorRegistration.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Hypercube.Client.Graphics.Monitors;
-
-///
-/// Base class to implement the monitor registration for the required graphics API.
-///
-public abstract class MonitorRegistration(IMonitorHandle handle)
-{
- public IMonitorHandle Handle = handle;
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/BindingsContext.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/BindingsContext.cs
index ed9fe03..b129e8f 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/BindingsContext.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/BindingsContext.cs
@@ -1,12 +1,12 @@
-using Hypercube.Client.Graphics.Windows;
+using Hypercube.Graphics.Windowing;
using OpenToolkit;
namespace Hypercube.Client.Graphics.Realisation.OpenGL;
-public sealed class BindingsContext(IWindowManager windowManager) : IBindingsContext
+public sealed class BindingsContext(IWindowing windowing) : IBindingsContext
{
- public IntPtr GetProcAddress(string procName)
+ public nint GetProcAddress(string procName)
{
- return windowManager.GetProcAddress(procName);
+ return windowing.GetProcAddress(procName);
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/ContextVersion.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/ContextVersion.cs
deleted file mode 100644
index 0ce43b8..0000000
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/ContextVersion.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using OpenTK.Windowing.Common;
-using OpenTK.Windowing.GraphicsLibraryFramework;
-
-namespace Hypercube.Client.Graphics.Realisation.OpenGL;
-
-public struct ContextInfo
-{
- public bool Compatibility => Profile == ContextProfile.Compatability;
-
- public Version Version;
- public ContextApi Api;
- public ContextProfile Profile;
- public ContextFlags Flags;
-
- public override string ToString()
- {
- return $"Context {Version}, api: {Api}, profile: {Profile}, flags: {Flags}";
- }
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Drawing.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Drawing.cs
index 022ea76..14d4975 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Drawing.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Drawing.cs
@@ -1,5 +1,5 @@
using Hypercube.Client.Graphics.Drawing;
-using Hypercube.Client.Graphics.Texturing;
+using Hypercube.Graphics.Texturing;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Matrices;
using Hypercube.Mathematics.Shapes;
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Monitors.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Monitors.cs
index 31ed281..26c0e1c 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Monitors.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Monitors.cs
@@ -1,14 +1,14 @@
-using Hypercube.Client.Graphics.Monitors;
+using Hypercube.Graphics.Monitors;
namespace Hypercube.Client.Graphics.Realisation.OpenGL.Rendering;
public sealed partial class Renderer
{
- private readonly Dictionary _monitors = new();
+ private readonly Dictionary _monitors = new();
- public void AddMonitor(MonitorRegistration monitor)
+ public void AddMonitor(MonitorHandle monitor)
{
- _monitors.Add(monitor.Handle.Id, monitor);
- _logger.EngineInfo($"Register {monitor.Handle}");
+ _monitors.Add(monitor.Id, monitor);
+ _logger.EngineInfo($"Register {monitor}");
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.OpenGL.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.OpenGL.cs
index fa306e1..2b10b50 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.OpenGL.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.OpenGL.cs
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;
using Hypercube.Client.Graphics.Events;
-using Hypercube.Shared.Logging;
+using Hypercube.Logging;
using OpenTK.Windowing.GraphicsLibraryFramework;
using OpenToolkit.Graphics.OpenGL4;
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Render.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Render.cs
index 1c73a69..668c591 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Render.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Render.cs
@@ -1,13 +1,12 @@
using Hypercube.Client.Graphics.Drawing;
using Hypercube.Client.Graphics.Events;
-using Hypercube.Client.Resources.Caching;
using Hypercube.Graphics.Shaders;
using Hypercube.Graphics.Windowing;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Matrices;
using Hypercube.OpenGL.Objects;
using Hypercube.OpenGL.Utilities.Helpers;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime.Events;
using OpenToolkit.Graphics.OpenGL4;
namespace Hypercube.Client.Graphics.Realisation.OpenGL.Rendering;
@@ -79,10 +78,10 @@ private void OnFrameUpdate(ref UpdateFrameEvent args)
$"| cPos: {_cameraManager.MainCamera.Position}| cRot: {_cameraManager.MainCamera.Rotation * HyperMathF.RadiansToDegrees} | cScale: {_cameraManager.MainCamera.Scale}";
}
- _windowManager.WindowSetTitle(MainWindow,
+ _windowing.WindowSetTitle(MainWindow,
$"FPS: {_timing.Fps} | RealTime: {_timing.RealTime} {cameraTitle} | Batches: {_batches.Count}");
#endif
- _windowManager.PollEvents();
+ _windowing.PollEvents();
}
private void OnFrameRender(ref RenderFrameEvent args)
@@ -134,7 +133,7 @@ public void Render(WindowHandle window)
var evUI = new RenderAfterDrawingEvent();
_eventBus.Raise(ref evUI);
- _windowManager.WindowSwapBuffers(window);
+ _windowing.WindowSwapBuffers(window);
}
public void Clear()
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Window.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Window.cs
index 4927c7a..b0a34be 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Window.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.Window.cs
@@ -1,5 +1,5 @@
using Hypercube.Client.Graphics.Events;
-using Hypercube.Client.Graphics.Windows;
+using Hypercube.Graphics;
using Hypercube.Graphics.Windowing;
namespace Hypercube.Client.Graphics.Realisation.OpenGL.Rendering;
@@ -14,12 +14,12 @@ public sealed partial class Renderer
public void EnterWindowLoop()
{
- _windowManager.EnterWindowLoop();
+ _windowing.EnterWindowLoop();
}
public void TerminateWindowLoop()
{
- _windowManager.Terminate();
+ _windowing.Terminate();
}
public WindowHandle CreateWindow(WindowCreateSettings settings)
@@ -33,7 +33,7 @@ public WindowHandle CreateWindow(WindowCreateSettings settings)
public void DestroyWindow(WindowHandle handle)
{
- _windowManager.WindowDestroy(handle);
+ _windowing.WindowDestroy(handle);
_windows.Remove(handle.Id);
}
@@ -53,7 +53,7 @@ public void CloseWindow(WindowHandle handle)
DestroyWindow(handle);
}
- private bool InitMainWindow(ContextInfo? context, WindowCreateSettings settings)
+ private bool InitMainWindow(IContextInfo? context, WindowCreateSettings settings)
{
var (registration, error) = CreateWindow(context, settings, null);
if (registration is null)
@@ -66,17 +66,17 @@ private bool InitMainWindow(ContextInfo? context, WindowCreateSettings settings)
return true;
}
- private (WindowHandle? registration, string? error) CreateWindow(ContextInfo? context, WindowCreateSettings settings, WindowHandle? share)
+ private (WindowHandle? registration, string? error) CreateWindow(IContextInfo? context, WindowCreateSettings settings, WindowHandle? share)
{
- var result = _windowManager.WindowCreate(context, settings, share);
+ var result = _windowing.WindowCreate(context, settings, share);
if (result.Failed)
return (null, result.Error);
- var handle = result.Registration?.Handle;
+ var handle = result.Registration;
if (handle is null)
return (null, "registration is null");
- _windowManager.MakeContextCurrent(handle);
+ _windowing.MakeContextCurrent(handle);
_windows.Add(handle.Id, handle);
_logger.EngineInfo($"Created new {handle}");
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.cs
index 8072e73..6308a3f 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Rendering/Renderer.cs
@@ -1,16 +1,16 @@
using System.Collections.Frozen;
using Hypercube.Client.Graphics.Rendering;
-using Hypercube.Client.Graphics.Texturing;
using Hypercube.Client.Graphics.Viewports;
-using Hypercube.Client.Graphics.Windows;
-using Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+using Hypercube.Client.Graphics.Windows.Realisation.GLFW;
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Resources.Container;
-using Hypercube.Shared.Resources.Manager;
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Graphics.Texturing;
+using Hypercube.Graphics.Windowing;
+using Hypercube.Logging;
+using Hypercube.OpenGL;
+using Hypercube.Resources.Container;
+using Hypercube.Resources.Manager;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Timing;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.GraphicsLibraryFramework;
@@ -30,7 +30,7 @@ public sealed partial class Renderer : IRenderer, IPostInject, IEventSubscriber
private readonly ILogger _logger = LoggingManager.GetLogger("renderer");
private readonly ILogger _loggerOpenGL = LoggingManager.GetLogger("open_gl")!;
- private IWindowManager _windowManager = default!;
+ private IWindowing _windowing = default!;
private IBindingsContext _bindingsContext = default!;
private Thread _currentThread = default!;
@@ -78,8 +78,8 @@ public void PostInject()
private void OnInitialization(ref RuntimeInitializationEvent args)
{
- _windowManager = CreateWindowManager();
- _bindingsContext = new BindingsContext(_windowManager);
+ _windowing = CreateWindowManager();
+ _bindingsContext = new BindingsContext(_windowing);
}
private void OnStartup(ref RuntimeStartupEvent args)
@@ -98,16 +98,16 @@ private void OnStartup(ref RuntimeStartupEvent args)
break;
}
- var windowIcons = _windowManager.LoadWindowIcons(_textureManager, _resourceLoader, "/Icons").ToList();
- _windowManager.WindowSetIcons(MainWindow, windowIcons);
+ //var windowIcons = _windowing.LoadWindowIcons(_textureManager, _resourceLoader, "/Icons").ToList();
+ //_windowing.WindowSetIcons(MainWindow, windowIcons);
InitOpenGL();
OnLoad();
}
- private IWindowManager CreateWindowManager()
+ private IWindowing CreateWindowManager()
{
- var windowManager = new GlfwWindowManager();
+ var windowManager = new GlfwWindowing();
if (!windowManager.Init())
throw new Exception();
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureHandle.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureHandle.cs
index e8a0853..a95e070 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureHandle.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureHandle.cs
@@ -1,8 +1,8 @@
-using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Client.Graphics.Texturing.Settings;
-using Hypercube.Client.Utilities.Helpers;
+using Hypercube.Graphics.Texturing;
+using Hypercube.Graphics.Texturing.Settings;
+using Hypercube.OpenGL.Utilities.Helpers;
using OpenToolkit.Graphics.OpenGL4;
-using TextureTarget = Hypercube.Client.Graphics.Texturing.Parameters.TextureTarget;
+using TextureTarget = Hypercube.Graphics.Texturing.Parameters.TextureTarget;
namespace Hypercube.Client.Graphics.Realisation.OpenGL.Texturing;
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureManager.cs b/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureManager.cs
index 78d88a8..6aef9ac 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureManager.cs
+++ b/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/TextureManager.cs
@@ -1,10 +1,11 @@
-using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Client.Graphics.Texturing.Settings;
+using Hypercube.Client.Graphics.Texturing.Settings;
using Hypercube.Dependencies;
+using Hypercube.Graphics.Texturing;
+using Hypercube.Graphics.Texturing.Settings;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Resources.Manager;
+using Hypercube.Resources;
+using Hypercube.Resources.Manager;
using StbImageSharp;
namespace Hypercube.Client.Graphics.Realisation.OpenGL.Texturing;
diff --git a/Hypercube.Client/Graphics/Rendering/IRenderer.cs b/Hypercube.Client/Graphics/Rendering/IRenderer.cs
index 81ad638..e9b4365 100644
--- a/Hypercube.Client/Graphics/Rendering/IRenderer.cs
+++ b/Hypercube.Client/Graphics/Rendering/IRenderer.cs
@@ -1,6 +1,5 @@
-using Hypercube.Client.Graphics.Monitors;
-using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Client.Graphics.Windows;
+using Hypercube.Graphics.Monitors;
+using Hypercube.Graphics.Texturing;
using Hypercube.Graphics.Windowing;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Matrices;
@@ -21,7 +20,7 @@ public interface IRenderer
void DestroyWindow(WindowHandle handle);
void CloseWindow(WindowHandle handle);
- void AddMonitor(MonitorRegistration monitor);
+ void AddMonitor(MonitorHandle monitor);
void OnFocusChanged(WindowHandle window, bool focused);
diff --git a/Hypercube.Client/Resources/Caching/ShaderSourceResource.cs b/Hypercube.Client/Graphics/ShaderSourceResource.cs
similarity index 90%
rename from Hypercube.Client/Resources/Caching/ShaderSourceResource.cs
rename to Hypercube.Client/Graphics/ShaderSourceResource.cs
index 9484178..adae744 100644
--- a/Hypercube.Client/Resources/Caching/ShaderSourceResource.cs
+++ b/Hypercube.Client/Graphics/ShaderSourceResource.cs
@@ -1,10 +1,10 @@
using Hypercube.Dependencies;
using Hypercube.Graphics.Shaders;
using Hypercube.OpenGL.Shaders;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Resources.Manager;
+using Hypercube.Resources;
+using Hypercube.Resources.Manager;
-namespace Hypercube.Client.Resources.Caching;
+namespace Hypercube.Client.Graphics;
public sealed class ShaderSourceResource : Resource, IDisposable
{
diff --git a/Hypercube.Client/Graphics/Texturing/Settings/TextureCreationSettings.cs b/Hypercube.Client/Graphics/Texturing/Settings/TextureCreationSettings.cs
index 8190dec..b52239b 100644
--- a/Hypercube.Client/Graphics/Texturing/Settings/TextureCreationSettings.cs
+++ b/Hypercube.Client/Graphics/Texturing/Settings/TextureCreationSettings.cs
@@ -1,9 +1,10 @@
-using OpenToolkit.Graphics.OpenGL4;
-using PixelFormat = Hypercube.Client.Graphics.Texturing.Parameters.PixelFormat;
-using PixelInternalFormat = Hypercube.Client.Graphics.Texturing.Parameters.PixelInternalFormat;
-using PixelType = Hypercube.Client.Graphics.Texturing.Parameters.PixelType;
-using TextureParameterName = Hypercube.Client.Graphics.Texturing.Parameters.TextureParameterName;
-using TextureTarget = Hypercube.Client.Graphics.Texturing.Parameters.TextureTarget;
+using Hypercube.Graphics.Texturing.Settings;
+using OpenToolkit.Graphics.OpenGL4;
+using PixelFormat = Hypercube.Graphics.Texturing.Parameters.PixelFormat;
+using PixelInternalFormat = Hypercube.Graphics.Texturing.Parameters.PixelInternalFormat;
+using PixelType = Hypercube.Graphics.Texturing.Parameters.PixelType;
+using TextureParameterName = Hypercube.Graphics.Texturing.Parameters.TextureParameterName;
+using TextureTarget = Hypercube.Graphics.Texturing.Parameters.TextureTarget;
namespace Hypercube.Client.Graphics.Texturing.Settings;
@@ -32,13 +33,13 @@ public TextureCreationSettings(
public TextureCreationSettings()
{
TextureTarget = TextureTarget.Texture2D;
- Parameters = new()
- {
+ Parameters =
+ [
new TextureParameter(TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat),
new TextureParameter(TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat),
new TextureParameter(TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest),
- new TextureParameter(TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest),
- };
+ new TextureParameter(TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest)
+ ];
PixelInternalFormat = PixelInternalFormat.Rgba;
Level = 0;
Border = 0;
diff --git a/Hypercube.Client/Graphics/Texturing/Settings/TextureParameter.cs b/Hypercube.Client/Graphics/Texturing/Settings/TextureParameter.cs
deleted file mode 100644
index 3bf98dd..0000000
--- a/Hypercube.Client/Graphics/Texturing/Settings/TextureParameter.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Hypercube.Client.Graphics.Texturing.Parameters;
-
-namespace Hypercube.Client.Graphics.Texturing.Settings;
-
-public readonly struct TextureParameter(TextureParameterName name, int value)
-{
- public readonly TextureParameterName Name = name;
- public readonly int Value = value;
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Texturing/TextureResource.cs b/Hypercube.Client/Graphics/Texturing/TextureResource.cs
index 15083c5..55cfe1f 100644
--- a/Hypercube.Client/Graphics/Texturing/TextureResource.cs
+++ b/Hypercube.Client/Graphics/Texturing/TextureResource.cs
@@ -1,6 +1,7 @@
using Hypercube.Client.Graphics.Texturing.Settings;
using Hypercube.Dependencies;
-using Hypercube.Shared.Resources;
+using Hypercube.Graphics.Texturing;
+using Hypercube.Resources;
namespace Hypercube.Client.Graphics.Texturing;
diff --git a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Callbacks.cs b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Callbacks.cs
index 728f6df..e366aee 100644
--- a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Callbacks.cs
+++ b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Callbacks.cs
@@ -4,7 +4,6 @@
using Hypercube.Mathematics.Vectors;
using Hypercube.OpenGL.Utilities.Helpers;
using OpenTK.Windowing.GraphicsLibraryFramework;
-
using GlfwKeyModifiers = OpenTK.Windowing.GraphicsLibraryFramework.KeyModifiers;
using GlfwMouseButton = OpenTK.Windowing.GraphicsLibraryFramework.MouseButton;
@@ -13,9 +12,9 @@
using static OpenTK.Windowing.GraphicsLibraryFramework.GLFWCallbacks;
-namespace Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+namespace Hypercube.Client.Graphics.Windows.Realisation.GLFW;
-public sealed unsafe partial class GlfwWindowManager
+public sealed unsafe partial class GlfwWindowing
{
private ErrorCallback? _errorCallback;
diff --git a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Init.cs b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Init.cs
index 0159f51..b38fbb9 100644
--- a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Init.cs
+++ b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Init.cs
@@ -1,8 +1,8 @@
using Hypercube.OpenGL.Utilities.Helpers;
-namespace Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+namespace Hypercube.Client.Graphics.Windows.Realisation.GLFW;
-public sealed partial class GlfwWindowManager
+public sealed partial class GlfwWindowing
{
private bool GlfwInit()
{
diff --git a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Monitors.cs b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Monitors.cs
index 9663992..91ea592 100644
--- a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Monitors.cs
+++ b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Monitors.cs
@@ -1,12 +1,13 @@
using System.Runtime.CompilerServices;
-using Hypercube.Client.Graphics.Monitors;
+using Hypercube.Graphics.Monitors;
+using Hypercube.Mathematics.Vectors;
using GlfwVideoMode = OpenTK.Windowing.GraphicsLibraryFramework.VideoMode;
using Monitor = OpenTK.Windowing.GraphicsLibraryFramework.Monitor;
-using VideoMode = Hypercube.Client.Graphics.Monitors.VideoMode;
+using VideoMode = Hypercube.Graphics.Monitors.VideoMode;
-namespace Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+namespace Hypercube.Client.Graphics.Windows.Realisation.GLFW;
-public sealed unsafe partial class GlfwWindowManager
+public sealed unsafe partial class GlfwWindowing
{
private readonly Dictionary _monitors = new();
@@ -49,18 +50,17 @@ private void ThreadSetupMonitor(Monitor* monitor)
var currentVideoMode = ConvertVideoMode(*videoMode);
- var handle = new MonitorHandle(
+ var registration = new GlfwMonitorRegistration(
id,
name,
currentVideoMode.Width,
currentVideoMode.Height,
currentVideoMode.RefreshRate,
- modes
+ modes,
+ monitor
);
- var registration = new GlfwMonitorRegistration(monitor, handle);;
_monitors[id] = registration;
-
_renderer.AddMonitor(registration);
}
@@ -77,8 +77,19 @@ private static VideoMode ConvertVideoMode(in GlfwVideoMode mode)
};
}
- public sealed class GlfwMonitorRegistration(Monitor* monitor, IMonitorHandle handle) : MonitorRegistration(handle)
+ public sealed class GlfwMonitorRegistration : MonitorHandle
{
- public Monitor* Pointer;
+ public readonly Monitor* Pointer;
+
+
+ public GlfwMonitorRegistration(MonitorId id, string name, Vector2Int size, int refreshRate, VideoMode[] videoModes, Monitor* pointer) : base(id, name, size, refreshRate, videoModes)
+ {
+ Pointer = pointer;
+ }
+
+ public GlfwMonitorRegistration(MonitorId id, string name, int width, int height, int refreshRate, VideoMode[] videoModes, Monitor* pointer) : base(id, name, width, height, refreshRate, videoModes)
+ {
+ Pointer = pointer;
+ }
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Window.cs b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Window.cs
index 3ce3b88..8ab8b0c 100644
--- a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Window.cs
+++ b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.Window.cs
@@ -1,62 +1,67 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
-using Hypercube.Client.Graphics.Monitors;
-using Hypercube.Client.Graphics.Realisation.OpenGL;
-using Hypercube.Client.Graphics.Texturing;
+using Hypercube.Graphics;
+using Hypercube.Graphics.Texturing;
using Hypercube.Graphics.Windowing;
using Hypercube.Mathematics.Vectors;
+using Hypercube.OpenGL;
using Hypercube.OpenGL.Utilities.Helpers;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Resources.Manager;
+using Hypercube.Resources;
+using Hypercube.Resources.Manager;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.GraphicsLibraryFramework;
using GlfwImage = OpenTK.Windowing.GraphicsLibraryFramework.Image;
using Monitor = OpenTK.Windowing.GraphicsLibraryFramework.Monitor;
+using MonitorHandle = Hypercube.Graphics.Monitors.MonitorHandle;
-namespace Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+namespace Hypercube.Client.Graphics.Windows.Realisation.GLFW;
-public sealed unsafe partial class GlfwWindowManager
+public sealed unsafe partial class GlfwWindowing
{
- public WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSettings settings,
+ public WindowCreateResult WindowCreate(IContextInfo? context, WindowCreateSettings settings,
WindowHandle? contextShare)
{
- GLFW.WindowHint(WindowHintString.X11ClassName, "Hypercube");
- GLFW.WindowHint(WindowHintString.X11InstanceName, "Hypercube");
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintString.X11ClassName, "Hypercube");
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintString.X11InstanceName, "Hypercube");
- if (context is null)
+ if (context is not ContextInfo info)
{
- GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.NoApi);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.NoApi);
}
else
{
#if DEBUG
- GLFW.WindowHint(WindowHintBool.OpenGLDebugContext, true);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.OpenGLDebugContext, true);
#endif
- GLFW.WindowHint(WindowHintInt.ContextVersionMajor, context.Value.Version.Major);
- GLFW.WindowHint(WindowHintInt.ContextVersionMinor, context.Value.Version.Minor);
- GLFW.WindowHint(WindowHintBool.OpenGLForwardCompat, context.Value.Compatibility);
- GLFW.WindowHint(WindowHintBool.SrgbCapable, true);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.ContextVersionMajor, info.Version.Major);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.ContextVersionMinor, info.Version.Minor);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.OpenGLForwardCompat, info.Compatibility);
+
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.SrgbCapable, true);
- switch (context.Value.Profile)
+ switch (info.Profile)
{
case ContextProfile.Compatability:
- GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Any);
- GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlApi);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Any);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlApi);
break;
case ContextProfile.Core:
- GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Core);
- GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlApi);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Core);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlApi);
break;
case ContextProfile.Any:
- GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Any);
- GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlEsApi);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintOpenGlProfile.OpenGlProfile, OpenGlProfile.Any);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintClientApi.ClientApi, ClientApi.OpenGlEsApi);
break;
+
+ default:
+ throw new ArgumentOutOfRangeException();
}
- GLFW.WindowHint(WindowHintContextApi.ContextCreationApi,
- context.Value.Api == ContextApi.EglContextApi
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintContextApi.ContextCreationApi,
+ info.Api == ContextApi.EglContextApi
? ContextApi.EglContextApi
: ContextApi.NativeContextApi);
}
@@ -69,37 +74,37 @@ public WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSetting
if (settings.Monitor is null || !_monitors.TryGetValue(settings.Monitor.Id, out var threadMonitorRegistration))
{
- GLFW.WindowHint(WindowHintInt.RedBits, settings.RedBits ?? 8);
- GLFW.WindowHint(WindowHintInt.GreenBits, settings.GreenBits ?? 8);
- GLFW.WindowHint(WindowHintInt.BlueBits, settings.BlueBits ?? 8);
- GLFW.WindowHint(WindowHintInt.RefreshRate, -1);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.RedBits, settings.RedBits ?? 8);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.GreenBits, settings.GreenBits ?? 8);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.BlueBits, settings.BlueBits ?? 8);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.RefreshRate, -1);
}
else
{
monitor = threadMonitorRegistration.Pointer;
- var modePointer = GLFW.GetVideoMode(monitor);
+ var modePointer = OpenTK.Windowing.GraphicsLibraryFramework.GLFW.GetVideoMode(monitor);
- GLFW.WindowHint(WindowHintInt.RedBits, settings.RedBits ?? modePointer->RedBits);
- GLFW.WindowHint(WindowHintInt.GreenBits, settings.GreenBits ?? modePointer->GreenBits);
- GLFW.WindowHint(WindowHintInt.BlueBits, settings.BlueBits ?? modePointer->BlueBits);
- GLFW.WindowHint(WindowHintInt.BlueBits, modePointer->RefreshRate);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.RedBits, settings.RedBits ?? modePointer->RedBits);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.GreenBits, settings.GreenBits ?? modePointer->GreenBits);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.BlueBits, settings.BlueBits ?? modePointer->BlueBits);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.BlueBits, modePointer->RefreshRate);
}
if (settings.AlphaBits is not null)
- GLFW.WindowHint(WindowHintInt.AlphaBits, settings.AlphaBits.Value);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.AlphaBits, settings.AlphaBits.Value);
if (settings.DepthBits is not null)
- GLFW.WindowHint(WindowHintInt.DepthBits, settings.DepthBits.Value);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.DepthBits, settings.DepthBits.Value);
if (settings.StencilBits is not null)
- GLFW.WindowHint(WindowHintInt.StencilBits, settings.StencilBits.Value);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintInt.StencilBits, settings.StencilBits.Value);
- GLFW.WindowHint(WindowHintBool.Resizable, settings.Resizable);
- GLFW.WindowHint(WindowHintBool.TransparentFramebuffer, settings.TransparentFramebuffer);
- GLFW.WindowHint(WindowHintBool.Decorated, settings.Decorated);
- GLFW.WindowHint(WindowHintBool.Visible, settings.Visible);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.Resizable, settings.Resizable);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.TransparentFramebuffer, settings.TransparentFramebuffer);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.Decorated, settings.Decorated);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WindowHint(WindowHintBool.Visible, settings.Visible);
- var window = GLFW.CreateWindow(
+ var window = OpenTK.Windowing.GraphicsLibraryFramework.GLFW.CreateWindow(
settings.Width,
settings.Height,
settings.Title,
@@ -109,13 +114,13 @@ public WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSetting
if (window is null)
{
Terminate();
- return new WindowCreateResult(null, GLFWHelper.GetError());
+ return new WindowCreateResult(GLFWHelper.GetError());
}
- return new WindowCreateResult(WindowSetup(window, settings), null);
+ return new WindowCreateResult(WindowSetup(window, settings));
}
- private WindowRegistration WindowSetup(Window* window, WindowCreateSettings settings)
+ private WindowHandle WindowSetup(Window* window, WindowCreateSettings settings)
{
GLFWHelper.GetFramebufferSize(window, out var framebufferSize);
GLFWHelper.GetWindowSize(window, out var size);
@@ -127,24 +132,22 @@ private WindowRegistration WindowSetup(Window* window, WindowCreateSettings sett
FramebufferSize = framebufferSize
};
- var registration = new WindowRegistration(_renderer, handle);
-
// Setting icons
if (settings.WindowImages != null)
WindowSetIcons(handle, settings.WindowImages.ToList());
// Setting callbacks
- GLFW.SetWindowCloseCallback(window, _windowCloseCallback);
- GLFW.SetWindowSizeCallback(window, _windowSizeCallback);
- GLFW.SetWindowFocusCallback(window, _windowFocusCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowCloseCallback(window, _windowCloseCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowSizeCallback(window, _windowSizeCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowFocusCallback(window, _windowFocusCallback);
- GLFW.SetCharCallback(window, _charCallback);
- GLFW.SetScrollCallback(window, _scrollCallback);
- GLFW.SetKeyCallback(window, _keyCallback);
- GLFW.SetMouseButtonCallback(window, _mouseButtonCallback);
- GLFW.SetCursorPosCallback(window, _cursorPosCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetCharCallback(window, _charCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetScrollCallback(window, _scrollCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetKeyCallback(window, _keyCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetMouseButtonCallback(window, _mouseButtonCallback);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetCursorPosCallback(window, _cursorPosCallback);
- return registration;
+ return handle;
}
public void WindowDestroy(WindowHandle handle)
@@ -168,7 +171,7 @@ public void WindowDestroy(WindowHandle handle)
*/
}
- GLFW.DestroyWindow(glfwRegistration);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.DestroyWindow(glfwRegistration);
}
private bool TryGetWindow(Window* window, [NotNullWhen(true)] out GlfwWindowHandle? registration)
@@ -198,10 +201,10 @@ public void WindowSetTitle(WindowHandle window, string title)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SetWindowTitle(glfwWindow, title);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowTitle(glfwWindow, title);
}
- public void WindowSetMonitor(WindowHandle window, MonitorRegistration registration)
+ public void WindowSetMonitor(WindowHandle window, MonitorHandle registration)
{
WindowSetMonitor(window, registration, Vector2Int.Zero);
}
@@ -211,7 +214,7 @@ public void WindowRequestAttention(WindowHandle window)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.RequestWindowAttention(glfwWindow);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.RequestWindowAttention(glfwWindow);
}
public void WindowSetSize(WindowHandle window, Vector2Int size)
@@ -219,7 +222,7 @@ public void WindowSetSize(WindowHandle window, Vector2Int size)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SetWindowSize(glfwWindow, size.X, size.Y);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowSize(glfwWindow, size.X, size.Y);
}
public void WindowSetVisible(WindowHandle window, bool visible)
@@ -229,11 +232,11 @@ public void WindowSetVisible(WindowHandle window, bool visible)
if (visible)
{
- GLFW.ShowWindow(glfwWindow);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.ShowWindow(glfwWindow);
return;
}
- GLFW.HideWindow(glfwWindow);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.HideWindow(glfwWindow);
}
public void WindowSetOpacity(WindowHandle window, float opacity)
@@ -241,7 +244,7 @@ public void WindowSetOpacity(WindowHandle window, float opacity)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SetWindowOpacity(glfwWindow, opacity);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowOpacity(glfwWindow, opacity);
}
public void WindowSetPosition(WindowHandle window, Vector2Int position)
@@ -249,7 +252,7 @@ public void WindowSetPosition(WindowHandle window, Vector2Int position)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SetWindowPos(glfwWindow, position.X, position.Y);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowPos(glfwWindow, position.X, position.Y);
}
public void WindowSwapBuffers(WindowHandle window)
@@ -257,7 +260,7 @@ public void WindowSwapBuffers(WindowHandle window)
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SwapBuffers(glfwWindow);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SwapBuffers(glfwWindow);
}
public void WindowSetIcons(WindowHandle window, List images)
@@ -279,7 +282,7 @@ public void WindowSetIcons(WindowHandle window, List images)
glfwImages[i] = new GlfwImage(image.Width, image.Height, addrOfPinnedObject);
}
- GLFW.SetWindowIcon(glfwWindow, glfwImages);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowIcon(glfwWindow, glfwImages);
}
public IEnumerable LoadWindowIcons(ITextureManager textureMan, IResourceLoader resourceLoader, ResourcePath path)
diff --git a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.cs b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowing.cs
similarity index 69%
rename from Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.cs
rename to Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowing.cs
index 01a6c24..a3cc258 100644
--- a/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowManager.cs
+++ b/Hypercube.Client/Graphics/Windows/Realisation/GLFW/GlfwWindowing.cs
@@ -1,16 +1,15 @@
-using Hypercube.Client.Graphics.Monitors;
-using Hypercube.Client.Graphics.Rendering;
+using Hypercube.Client.Graphics.Rendering;
using Hypercube.Client.Input.Handler;
using Hypercube.Dependencies;
using Hypercube.EventBus;
+using Hypercube.Graphics.Monitors;
using Hypercube.Graphics.Windowing;
+using Hypercube.Logging;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Logging;
-using OpenTK.Windowing.GraphicsLibraryFramework;
-namespace Hypercube.Client.Graphics.Windows.Realisation.Glfw;
+namespace Hypercube.Client.Graphics.Windows.Realisation.GLFW;
-public sealed unsafe partial class GlfwWindowManager : IWindowManager
+public sealed unsafe partial class GlfwWindowing : IWindowing
{
[Dependency] private readonly IEventBus _eventBus = default!;
[Dependency] private readonly IInputHandler _inputHandler = default!;
@@ -42,7 +41,7 @@ public void Shutdown()
if (!_initialized)
return;
- GLFW.Terminate();
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.Terminate();
}
public void EnterWindowLoop()
@@ -54,13 +53,13 @@ public void EnterWindowLoop()
_running = true;
while (_running)
{
- GLFW.WaitEvents();
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.WaitEvents();
}
}
public void PollEvents()
{
- GLFW.PollEvents();
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.PollEvents();
}
public void Terminate()
@@ -84,19 +83,19 @@ public void MakeContextCurrent(WindowHandle? window)
var reg = (GlfwWindowHandle)window;
- GLFW.MakeContextCurrent(reg);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.MakeContextCurrent(reg);
return;
}
- GLFW.MakeContextCurrent(null);
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.MakeContextCurrent(null);
}
public nint GetProcAddress(string procName)
{
- return GLFW.GetProcAddress(procName);
+ return OpenTK.Windowing.GraphicsLibraryFramework.GLFW.GetProcAddress(procName);
}
- public void WindowSetMonitor(WindowHandle window, MonitorRegistration monitor, Vector2Int vector)
+ public void WindowSetMonitor(WindowHandle window, MonitorHandle monitor, Vector2Int vector)
{
if (monitor is not GlfwMonitorRegistration glfwMonitor)
return;
@@ -104,12 +103,14 @@ public void WindowSetMonitor(WindowHandle window, MonitorRegistration monitor, V
if (window is not GlfwWindowHandle glfwWindow)
return;
- GLFW.SetWindowMonitor(
+ OpenTK.Windowing.GraphicsLibraryFramework.GLFW.SetWindowMonitor(
glfwWindow,
glfwMonitor.Pointer,
- vector.X, vector.Y,
- monitor.Handle.Size.X, monitor.Handle.Size.Y,
- monitor.Handle.RefreshRate);
+ vector.X,
+ vector.Y,
+ monitor.Size.X,
+ monitor.Size.Y,
+ monitor.RefreshRate);
}
public void Dispose()
diff --git a/Hypercube.Client/Graphics/Windows/WindowCreateResult.cs b/Hypercube.Client/Graphics/Windows/WindowCreateResult.cs
deleted file mode 100644
index 65e2d5a..0000000
--- a/Hypercube.Client/Graphics/Windows/WindowCreateResult.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Hypercube.Client.Graphics.Windows;
-
-public readonly struct WindowCreateResult(WindowRegistration? registration, string? error)
-{
- public bool Failed => Registration is null;
-
- public readonly WindowRegistration? Registration = registration;
- public readonly string? Error = error;
-}
\ No newline at end of file
diff --git a/Hypercube.Client/Hypercube.Client.csproj b/Hypercube.Client/Hypercube.Client.csproj
index 8af94cc..7e513eb 100644
--- a/Hypercube.Client/Hypercube.Client.csproj
+++ b/Hypercube.Client/Hypercube.Client.csproj
@@ -15,8 +15,10 @@
+
+
diff --git a/Hypercube.Client/Input/Handler/IInputHandler.cs b/Hypercube.Client/Input/Handler/IInputHandler.cs
index 7956320..8cffc0d 100644
--- a/Hypercube.Client/Input/Handler/IInputHandler.cs
+++ b/Hypercube.Client/Input/Handler/IInputHandler.cs
@@ -1,6 +1,6 @@
-using Hypercube.Client.Graphics.Windows;
-using Hypercube.Client.Input.Events;
+using Hypercube.Client.Input.Events;
using Hypercube.EventBus;
+using Hypercube.Graphics.Windowing;
using Hypercube.Input;
using Hypercube.Mathematics.Vectors;
using JetBrains.Annotations;
@@ -8,7 +8,7 @@
namespace Hypercube.Client.Input.Handler;
///
-/// Receives requests from user input, via ,
+/// Receives requests from user input, via ,
/// and submits them for further work via events.
///
[PublicAPI]
diff --git a/Hypercube.Client/Input/Handler/InputHandler.cs b/Hypercube.Client/Input/Handler/InputHandler.cs
index aa0b648..8984e50 100644
--- a/Hypercube.Client/Input/Handler/InputHandler.cs
+++ b/Hypercube.Client/Input/Handler/InputHandler.cs
@@ -4,9 +4,9 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
using Hypercube.Input;
+using Hypercube.Logging;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime.Events;
using JetBrains.Annotations;
namespace Hypercube.Client.Input.Handler;
diff --git a/Hypercube.Client/Preloader.cs b/Hypercube.Client/Preloader.cs
index 55763e8..b99c4a0 100644
--- a/Hypercube.Client/Preloader.cs
+++ b/Hypercube.Client/Preloader.cs
@@ -1,14 +1,14 @@
using System.Diagnostics;
-using Hypercube.Client.Audio.Events;
-using Hypercube.Client.Audio.Resources;
+using Hypercube.Audio.Events;
+using Hypercube.Audio.Resources;
+using Hypercube.Client.Graphics;
using Hypercube.Client.Graphics.Events;
using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Client.Resources.Caching;
using Hypercube.Dependencies;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Resources.Container;
-using Hypercube.Shared.Resources.Manager;
-using Hypercube.Shared.Resources.Preloader;
+using Hypercube.Logging;
+using Hypercube.Resources.Container;
+using Hypercube.Resources.Manager;
+using Hypercube.Resources.Preloader;
using JetBrains.Annotations;
namespace Hypercube.Client;
diff --git a/Hypercube.Client/Runtimes/Loop/RuntimeLoop.cs b/Hypercube.Client/Runtimes/Loop/RuntimeLoop.cs
index 17f402f..e5cf18a 100644
--- a/Hypercube.Client/Runtimes/Loop/RuntimeLoop.cs
+++ b/Hypercube.Client/Runtimes/Loop/RuntimeLoop.cs
@@ -1,7 +1,7 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Runtimes.Loop;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Timing;
namespace Hypercube.Client.Runtimes.Loop;
diff --git a/Hypercube.Client/Runtimes/Runtime.cs b/Hypercube.Client/Runtimes/Runtime.cs
index 15e5c50..8f5192f 100644
--- a/Hypercube.Client/Runtimes/Runtime.cs
+++ b/Hypercube.Client/Runtimes/Runtime.cs
@@ -1,10 +1,9 @@
using Hypercube.Client.Graphics.Events;
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes;
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop;
+using Hypercube.Logging;
+using Hypercube.Runtime;
+using Hypercube.Runtime.Events;
namespace Hypercube.Client.Runtimes;
diff --git a/Hypercube.Dependencies/DependenciesContainer.cs b/Hypercube.Dependencies/DependenciesContainer.cs
index bf9f03e..b4d8724 100644
--- a/Hypercube.Dependencies/DependenciesContainer.cs
+++ b/Hypercube.Dependencies/DependenciesContainer.cs
@@ -1,5 +1,5 @@
using System.Reflection;
-using Hypercube.Shared.Logging;
+using Hypercube.Logging;
using Hypercube.Utilities.Extensions;
using JetBrains.Annotations;
diff --git a/Hypercube.Dependencies/DependencyAttribute.cs b/Hypercube.Dependencies/DependencyAttribute.cs
index 3fa3b80..5d36856 100644
--- a/Hypercube.Dependencies/DependencyAttribute.cs
+++ b/Hypercube.Dependencies/DependencyAttribute.cs
@@ -1,4 +1,6 @@
-namespace Hypercube.Dependencies;
+using JetBrains.Annotations;
-[AttributeUsage(AttributeTargets.Field)]
+namespace Hypercube.Dependencies;
+
+[PublicAPI, AttributeUsage(AttributeTargets.Field)]
public class DependencyAttribute : Attribute;
\ No newline at end of file
diff --git a/Hypercube.Dependencies/IPostInject.cs b/Hypercube.Dependencies/IPostInject.cs
index 9f24d35..ecd96d1 100644
--- a/Hypercube.Dependencies/IPostInject.cs
+++ b/Hypercube.Dependencies/IPostInject.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Dependencies;
+using JetBrains.Annotations;
+namespace Hypercube.Dependencies;
+
+[PublicAPI]
public interface IPostInject
{
void PostInject();
diff --git a/Hypercube.Example.Client/Camera/CameraSystem.cs b/Hypercube.Example.Client/Camera/CameraSystem.cs
index 0badc2c..204b4bb 100644
--- a/Hypercube.Example.Client/Camera/CameraSystem.cs
+++ b/Hypercube.Example.Client/Camera/CameraSystem.cs
@@ -1,11 +1,11 @@
using Hypercube.Client.Graphics.Rendering;
using Hypercube.Client.Graphics.Viewports;
using Hypercube.Dependencies;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation;
using Hypercube.Shared.Entities.Realisation.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
using Hypercube.Shared.Entities.Systems.Transform;
-using Hypercube.Shared.Runtimes.Loop.Event;
namespace Hypercube.Example.Client.Camera;
diff --git a/Hypercube.Example.Client/Controls/ControlsSystem.cs b/Hypercube.Example.Client/Controls/ControlsSystem.cs
index 2205e6e..71623cc 100644
--- a/Hypercube.Example.Client/Controls/ControlsSystem.cs
+++ b/Hypercube.Example.Client/Controls/ControlsSystem.cs
@@ -2,9 +2,9 @@
using Hypercube.Dependencies;
using Hypercube.Input;
using Hypercube.Mathematics.Vectors;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
using Hypercube.Shared.Entities.Systems.Physics;
-using Hypercube.Shared.Runtimes.Loop.Event;
namespace Hypercube.Example.Client.Controls;
diff --git a/Hypercube.Example.Client/Example.cs b/Hypercube.Example.Client/Example.cs
index da60cdb..3013811 100644
--- a/Hypercube.Example.Client/Example.cs
+++ b/Hypercube.Example.Client/Example.cs
@@ -1,5 +1,5 @@
-using Hypercube.Client.Audio;
-using Hypercube.Client.Audio.Resources;
+using Hypercube.Audio;
+using Hypercube.Audio.Resources;
using Hypercube.Client.Entities.Systems.Sprite;
using Hypercube.Client.Graphics.ImGui.Events;
using Hypercube.Client.Graphics.Rendering;
@@ -10,14 +10,14 @@
using Hypercube.Example.Client.Controls;
using Hypercube.Input;
using Hypercube.Mathematics.Vectors;
+using Hypercube.Resources;
+using Hypercube.Resources.Container;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Manager;
using Hypercube.Shared.Entities.Systems.Physics;
using Hypercube.Shared.Entities.Systems.Transform.Coordinates;
using Hypercube.Shared.Physics;
using Hypercube.Shared.Physics.Shapes;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Resources.Container;
-using Hypercube.Shared.Runtimes.Event;
using Hypercube.Shared.Scenes;
namespace Hypercube.Example.Client;
diff --git a/Hypercube.Example.Client/ExampleSystem.cs b/Hypercube.Example.Client/ExampleSystem.cs
index 18b801f..515541f 100644
--- a/Hypercube.Example.Client/ExampleSystem.cs
+++ b/Hypercube.Example.Client/ExampleSystem.cs
@@ -1,8 +1,8 @@
using Hypercube.Client.Entities.Systems.Sprite;
using Hypercube.Dependencies;
using Hypercube.Mathematics;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
-using Hypercube.Shared.Runtimes.Loop.Event;
using Hypercube.Shared.Timing;
namespace Hypercube.Example.Client;
diff --git a/Hypercube.Graphics/Hypercube.Graphics.csproj b/Hypercube.Graphics/Hypercube.Graphics.csproj
index 58dac58..71c329b 100644
--- a/Hypercube.Graphics/Hypercube.Graphics.csproj
+++ b/Hypercube.Graphics/Hypercube.Graphics.csproj
@@ -8,6 +8,7 @@
+
diff --git a/Hypercube.Graphics/IContextInfo.cs b/Hypercube.Graphics/IContextInfo.cs
new file mode 100644
index 0000000..b781ef3
--- /dev/null
+++ b/Hypercube.Graphics/IContextInfo.cs
@@ -0,0 +1,3 @@
+namespace Hypercube.Graphics;
+
+public interface IContextInfo;
\ No newline at end of file
diff --git a/Hypercube.Graphics/Monitors/MonitorHandle.cs b/Hypercube.Graphics/Monitors/MonitorHandle.cs
new file mode 100644
index 0000000..e815926
--- /dev/null
+++ b/Hypercube.Graphics/Monitors/MonitorHandle.cs
@@ -0,0 +1,37 @@
+using Hypercube.Mathematics.Vectors;
+using JetBrains.Annotations;
+
+namespace Hypercube.Graphics.Monitors;
+
+[PublicAPI]
+public class MonitorHandle
+{
+ public MonitorId Id { get; }
+ public string Name { get; }
+ public Vector2Int Size { get; }
+ public int RefreshRate { get; }
+ public VideoMode[] VideoModes { get; }
+
+ public MonitorHandle(MonitorId id, string name, Vector2Int size, int refreshRate, VideoMode[] videoModes)
+ {
+ Id = id;
+ Name = name;
+ Size = size;
+ RefreshRate = refreshRate;
+ VideoModes = videoModes;
+ }
+
+ public MonitorHandle(MonitorId id, string name, int width, int height, int refreshRate, VideoMode[] videoModes)
+ {
+ Id = id;
+ Name = name;
+ Size = new Vector2Int(width, height);
+ RefreshRate = refreshRate;
+ VideoModes = videoModes;
+ }
+
+ public override string ToString()
+ {
+ return $"MonitorHandle {Id.Value}, name: {Name}, size: {Size}, rate: {RefreshRate}, mode: ({VideoModes.Length})";
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Monitors/MonitorId.cs b/Hypercube.Graphics/Monitors/MonitorId.cs
similarity index 82%
rename from Hypercube.Client/Graphics/Monitors/MonitorId.cs
rename to Hypercube.Graphics/Monitors/MonitorId.cs
index 40fcdea..ec56695 100644
--- a/Hypercube.Client/Graphics/Monitors/MonitorId.cs
+++ b/Hypercube.Graphics/Monitors/MonitorId.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Client.Graphics.Monitors;
+namespace Hypercube.Graphics.Monitors;
[Serializable]
public readonly struct MonitorId(int value) : IEquatable
@@ -6,7 +6,7 @@ public readonly struct MonitorId(int value) : IEquatable
public static readonly MonitorId Invalid = default;
public static readonly MonitorId Zero = new(0);
- internal readonly int Value = value;
+ public readonly int Value = value;
public bool Equals(MonitorId other)
{
@@ -33,6 +33,11 @@ public static implicit operator int(MonitorId id)
return id.Value;
}
+ public static implicit operator MonitorId(int id)
+ {
+ return new MonitorId(id);
+ }
+
public override int GetHashCode()
{
return Value;
diff --git a/Hypercube.Client/Graphics/Monitors/VideoMode.cs b/Hypercube.Graphics/Monitors/VideoMode.cs
similarity index 90%
rename from Hypercube.Client/Graphics/Monitors/VideoMode.cs
rename to Hypercube.Graphics/Monitors/VideoMode.cs
index 23de5eb..ae13793 100644
--- a/Hypercube.Client/Graphics/Monitors/VideoMode.cs
+++ b/Hypercube.Graphics/Monitors/VideoMode.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Client.Graphics.Monitors;
+namespace Hypercube.Graphics.Monitors;
public readonly struct VideoMode
{
diff --git a/Hypercube.Client/Graphics/Texturing/ITexture.cs b/Hypercube.Graphics/Texturing/ITexture.cs
similarity index 55%
rename from Hypercube.Client/Graphics/Texturing/ITexture.cs
rename to Hypercube.Graphics/Texturing/ITexture.cs
index 9c72af6..f37df18 100644
--- a/Hypercube.Client/Graphics/Texturing/ITexture.cs
+++ b/Hypercube.Graphics/Texturing/ITexture.cs
@@ -1,13 +1,16 @@
using Hypercube.Mathematics.Shapes;
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Texturing;
+namespace Hypercube.Graphics.Texturing;
+[PublicAPI]
public interface ITexture
{
ResourcePath Path { get; }
int Width { get; }
int Height { get; }
byte[] Data { get; }
- Box2 QuadCrateTranslated();
+
+ Box2 Quad { get; }
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Texturing/ITextureHandle.cs b/Hypercube.Graphics/Texturing/ITextureHandle.cs
similarity index 58%
rename from Hypercube.Client/Graphics/Texturing/ITextureHandle.cs
rename to Hypercube.Graphics/Texturing/ITextureHandle.cs
index 068548f..6c4a146 100644
--- a/Hypercube.Client/Graphics/Texturing/ITextureHandle.cs
+++ b/Hypercube.Graphics/Texturing/ITextureHandle.cs
@@ -1,7 +1,9 @@
-using Hypercube.Client.Graphics.Texturing.Parameters;
+using Hypercube.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Texturing;
+namespace Hypercube.Graphics.Texturing;
+[PublicAPI]
public interface ITextureHandle : IDisposable
{
int Handle { get; }
diff --git a/Hypercube.Client/Graphics/Texturing/ITextureManager.cs b/Hypercube.Graphics/Texturing/ITextureManager.cs
similarity index 76%
rename from Hypercube.Client/Graphics/Texturing/ITextureManager.cs
rename to Hypercube.Graphics/Texturing/ITextureManager.cs
index 4b8e191..35f5b3a 100644
--- a/Hypercube.Client/Graphics/Texturing/ITextureManager.cs
+++ b/Hypercube.Graphics/Texturing/ITextureManager.cs
@@ -1,14 +1,17 @@
-using Hypercube.Client.Graphics.Texturing.Settings;
+using Hypercube.Graphics.Texturing.Settings;
using Hypercube.Mathematics;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Texturing;
+namespace Hypercube.Graphics.Texturing;
+[PublicAPI]
public interface ITextureManager
{
ITexture CreateBlank(Vector2Int size, Color color);
ITexture CreateTexture(ResourcePath path);
+
ITextureHandle CreateTextureHandle(ITexture texture);
ITextureHandle CreateTextureHandle(ITexture texture, ITextureCreationSettings settings);
ITextureHandle CreateTextureHandle(ResourcePath path);
diff --git a/Hypercube.Client/Graphics/Texturing/Parameters/PixelFormat.cs b/Hypercube.Graphics/Texturing/Parameters/PixelFormat.cs
similarity index 90%
rename from Hypercube.Client/Graphics/Texturing/Parameters/PixelFormat.cs
rename to Hypercube.Graphics/Texturing/Parameters/PixelFormat.cs
index c2879a1..b984d58 100644
--- a/Hypercube.Client/Graphics/Texturing/Parameters/PixelFormat.cs
+++ b/Hypercube.Graphics/Texturing/Parameters/PixelFormat.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+namespace Hypercube.Graphics.Texturing.Parameters;
+
+[PublicAPI]
public enum PixelFormat
{
UnsignedShort = 5123,
diff --git a/Hypercube.Client/Graphics/Texturing/Parameters/PixelInternalFormat.cs b/Hypercube.Graphics/Texturing/Parameters/PixelInternalFormat.cs
similarity index 97%
rename from Hypercube.Client/Graphics/Texturing/Parameters/PixelInternalFormat.cs
rename to Hypercube.Graphics/Texturing/Parameters/PixelInternalFormat.cs
index 5af56a9..db8c48f 100644
--- a/Hypercube.Client/Graphics/Texturing/Parameters/PixelInternalFormat.cs
+++ b/Hypercube.Graphics/Texturing/Parameters/PixelInternalFormat.cs
@@ -1,7 +1,10 @@
-namespace Hypercube.Client.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+namespace Hypercube.Graphics.Texturing.Parameters;
+
+[PublicAPI]
public enum PixelInternalFormat
- {
+{
One = 1,
Two = 2,
Three = 3,
@@ -152,5 +155,5 @@ public enum PixelInternalFormat
Rg16Snorm = 36761,
Rgb16Snorm = 36762,
Rgba16Snorm = 36763,
- Rgb10A2ui = 36975,
- }
\ No newline at end of file
+ Rgb10A2ui = 36975
+}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Texturing/Parameters/PixelType.cs b/Hypercube.Graphics/Texturing/Parameters/PixelType.cs
similarity index 90%
rename from Hypercube.Client/Graphics/Texturing/Parameters/PixelType.cs
rename to Hypercube.Graphics/Texturing/Parameters/PixelType.cs
index 87bccb9..65abfe0 100644
--- a/Hypercube.Client/Graphics/Texturing/Parameters/PixelType.cs
+++ b/Hypercube.Graphics/Texturing/Parameters/PixelType.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+namespace Hypercube.Graphics.Texturing.Parameters;
+
+[PublicAPI]
public enum PixelType
{
Byte = 5120,
diff --git a/Hypercube.Client/Graphics/Texturing/Parameters/TextureParameterName.cs b/Hypercube.Graphics/Texturing/Parameters/TextureParameterName.cs
similarity index 96%
rename from Hypercube.Client/Graphics/Texturing/Parameters/TextureParameterName.cs
rename to Hypercube.Graphics/Texturing/Parameters/TextureParameterName.cs
index 787b461..a0c02ca 100644
--- a/Hypercube.Client/Graphics/Texturing/Parameters/TextureParameterName.cs
+++ b/Hypercube.Graphics/Texturing/Parameters/TextureParameterName.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+namespace Hypercube.Graphics.Texturing.Parameters;
+
+[PublicAPI]
public enum TextureParameterName
{
TextureWidth = 4096,
diff --git a/Hypercube.Client/Graphics/Texturing/Parameters/TextureTarget.cs b/Hypercube.Graphics/Texturing/Parameters/TextureTarget.cs
similarity index 94%
rename from Hypercube.Client/Graphics/Texturing/Parameters/TextureTarget.cs
rename to Hypercube.Graphics/Texturing/Parameters/TextureTarget.cs
index c5d6c87..c33a1b4 100644
--- a/Hypercube.Client/Graphics/Texturing/Parameters/TextureTarget.cs
+++ b/Hypercube.Graphics/Texturing/Parameters/TextureTarget.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Client.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+namespace Hypercube.Graphics.Texturing.Parameters;
+
+[PublicAPI]
public enum TextureTarget
{
Texture1D = 3552,
diff --git a/Hypercube.Client/Graphics/Texturing/Settings/ITextureCreationSettings.cs b/Hypercube.Graphics/Texturing/Settings/ITextureCreationSettings.cs
similarity index 70%
rename from Hypercube.Client/Graphics/Texturing/Settings/ITextureCreationSettings.cs
rename to Hypercube.Graphics/Texturing/Settings/ITextureCreationSettings.cs
index 96f702d..78dbe5d 100644
--- a/Hypercube.Client/Graphics/Texturing/Settings/ITextureCreationSettings.cs
+++ b/Hypercube.Graphics/Texturing/Settings/ITextureCreationSettings.cs
@@ -1,7 +1,9 @@
-using Hypercube.Client.Graphics.Texturing.Parameters;
+using Hypercube.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Texturing.Settings;
+namespace Hypercube.Graphics.Texturing.Settings;
+[PublicAPI]
public interface ITextureCreationSettings
{
TextureTarget TextureTarget { get; }
diff --git a/Hypercube.Graphics/Texturing/Settings/TextureParameter.cs b/Hypercube.Graphics/Texturing/Settings/TextureParameter.cs
new file mode 100644
index 0000000..5e19aa8
--- /dev/null
+++ b/Hypercube.Graphics/Texturing/Settings/TextureParameter.cs
@@ -0,0 +1,17 @@
+using Hypercube.Graphics.Texturing.Parameters;
+using JetBrains.Annotations;
+
+namespace Hypercube.Graphics.Texturing.Settings;
+
+[PublicAPI]
+public readonly struct TextureParameter
+{
+ public readonly TextureParameterName Name;
+ public readonly int Value;
+
+ public TextureParameter(TextureParameterName name, int value)
+ {
+ Name = name;
+ Value = value;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/Texture.cs b/Hypercube.Graphics/Texturing/Texture.cs
similarity index 59%
rename from Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/Texture.cs
rename to Hypercube.Graphics/Texturing/Texture.cs
index 6765c41..c23e58a 100644
--- a/Hypercube.Client/Graphics/Realisation/OpenGL/Texturing/Texture.cs
+++ b/Hypercube.Graphics/Texturing/Texture.cs
@@ -1,31 +1,36 @@
-using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Mathematics.Shapes;
+using Hypercube.Mathematics.Shapes;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Realisation.OpenGL.Texturing;
+namespace Hypercube.Graphics.Texturing;
+[PublicAPI]
public readonly struct Texture : ITexture
{
public const int PixelPerUnit = 32;
-
+
public ResourcePath Path { get; }
public Vector2Int Size { get; }
- public byte[] Data { get; }
+ public byte[] Data { get; }
+
public int Width => Size.X;
public int Height => Size.Y;
+ public Box2 Quad
+ {
+ get
+ {
+ var size = (Vector2)Size / PixelPerUnit;
+ return new Box2(-size / 2, size / 2);
+ }
+ }
+
public Texture(ResourcePath path, Vector2Int size, byte[] data)
{
Path = path;
Size = size;
Data = data;
}
-
- public Box2 QuadCrateTranslated()
- {
- var size = (Vector2)Size / PixelPerUnit;
- return new Box2(-size / 2, size / 2);
- }
}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Windows/IWindowManager.cs b/Hypercube.Graphics/Windowing/IWindowing.cs
similarity index 63%
rename from Hypercube.Client/Graphics/Windows/IWindowManager.cs
rename to Hypercube.Graphics/Windowing/IWindowing.cs
index 46d1491..fdb8312 100644
--- a/Hypercube.Client/Graphics/Windows/IWindowManager.cs
+++ b/Hypercube.Graphics/Windowing/IWindowing.cs
@@ -1,17 +1,15 @@
-using Hypercube.Client.Graphics.Monitors;
-using Hypercube.Client.Graphics.Realisation.OpenGL;
-using Hypercube.Client.Graphics.Texturing;
-using Hypercube.Graphics.Windowing;
+using Hypercube.Graphics.Monitors;
+using Hypercube.Graphics.Texturing;
using Hypercube.Mathematics.Vectors;
-using Hypercube.Shared.Resources;
-using Hypercube.Shared.Resources.Manager;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Windows;
+namespace Hypercube.Graphics.Windowing;
///
/// A layer between the API for handling windows, events, input and context and the engine.
///
-public interface IWindowManager : IDisposable
+[PublicAPI]
+public interface IWindowing : IDisposable
{
///
/// Initializes the implementation in the current thread,
@@ -31,11 +29,11 @@ public interface IWindowManager : IDisposable
void Terminate();
// Window
- WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSettings settings, WindowHandle? contextShare);
+ WindowCreateResult WindowCreate(IContextInfo? context, WindowCreateSettings settings, WindowHandle? contextShare);
void WindowDestroy(WindowHandle window);
void WindowSetTitle(WindowHandle window, string title);
- void WindowSetMonitor(WindowHandle window, MonitorRegistration monitor);
- void WindowSetMonitor(WindowHandle window, MonitorRegistration monitor, Vector2Int vector2Int);
+ void WindowSetMonitor(WindowHandle window, MonitorHandle monitor);
+ void WindowSetMonitor(WindowHandle window, MonitorHandle monitor, Vector2Int vector2Int);
void WindowRequestAttention(WindowHandle window);
void WindowSetOpacity(WindowHandle window, float opacity);
void WindowSetVisible(WindowHandle window, bool visible);
@@ -45,7 +43,7 @@ public interface IWindowManager : IDisposable
void WindowSetIcons(WindowHandle window, List images);
void MakeContextCurrent(WindowHandle? window);
- IEnumerable LoadWindowIcons(ITextureManager textureManager, IResourceLoader resourceLoader, ResourcePath resPath);
+ //IEnumerable LoadWindowIcons(ITextureManager textureManager, IResourceLoader resourceLoader, ResourcePath resPath);
nint GetProcAddress(string procName);
}
\ No newline at end of file
diff --git a/Hypercube.Graphics/Windowing/WindowCreateResult.cs b/Hypercube.Graphics/Windowing/WindowCreateResult.cs
new file mode 100644
index 0000000..9ec4bad
--- /dev/null
+++ b/Hypercube.Graphics/Windowing/WindowCreateResult.cs
@@ -0,0 +1,23 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Graphics.Windowing;
+
+[PublicAPI]
+public readonly struct WindowCreateResult
+{
+ public bool Failed => Registration is null;
+ public readonly WindowHandle? Registration;
+ public readonly string? Error;
+
+ public WindowCreateResult(WindowHandle registration)
+ {
+ Registration = registration;
+ Error = null;
+ }
+
+ public WindowCreateResult(string error)
+ {
+ Registration = null;
+ Error = error;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Client/Graphics/Windows/WindowCreateSettings.cs b/Hypercube.Graphics/Windowing/WindowCreateSettings.cs
similarity index 65%
rename from Hypercube.Client/Graphics/Windows/WindowCreateSettings.cs
rename to Hypercube.Graphics/Windowing/WindowCreateSettings.cs
index de62216..22861e2 100644
--- a/Hypercube.Client/Graphics/Windows/WindowCreateSettings.cs
+++ b/Hypercube.Graphics/Windowing/WindowCreateSettings.cs
@@ -1,10 +1,12 @@
-using Hypercube.Client.Graphics.Monitors;
-using Hypercube.Client.Graphics.Texturing;
+using Hypercube.Graphics.Monitors;
+using Hypercube.Graphics.Texturing;
using Hypercube.Mathematics.Vectors;
+using JetBrains.Annotations;
-namespace Hypercube.Client.Graphics.Windows;
+namespace Hypercube.Graphics.Windowing;
-public class WindowCreateSettings
+[PublicAPI]
+public sealed class WindowCreateSettings
{
public int Width => Size.X;
public int Height => Size.Y;
@@ -12,11 +14,11 @@ public class WindowCreateSettings
public string Title { get; init; } = "Hypercube Window";
public Vector2Int Size { get; init; } = new(1280, 720);
- public ITexture[]? WindowImages { get; init; } = null;
- public IMonitorHandle? Monitor { get; init; } = null;
+ public ITexture[]? WindowImages { get; init; }
+ public MonitorHandle? Monitor { get; init; }
public bool Resizable { get; init; } = true;
- public bool TransparentFramebuffer { get; init; } = false;
+ public bool TransparentFramebuffer { get; init; }
public bool Decorated { get; init; } = true;
public bool Visible { get; init; } = true;
diff --git a/Hypercube.Graphics/Windowing/WindowHandle.cs b/Hypercube.Graphics/Windowing/WindowHandle.cs
index 94de5e6..9a230fc 100644
--- a/Hypercube.Graphics/Windowing/WindowHandle.cs
+++ b/Hypercube.Graphics/Windowing/WindowHandle.cs
@@ -7,14 +7,11 @@ namespace Hypercube.Graphics.Windowing;
[PublicAPI]
public abstract class WindowHandle
{
- public readonly WindowId Id;
- public readonly nint Pointer;
-
- public WindowHandle? Owner;
-
- public bool DisposeOnClose;
- public bool IsDisposed;
-
+ public WindowId Id { get; }
+ public nint Pointer { get; }
+ public WindowHandle? Owner { get; }
+ public bool DisposeOnClose { get; }
+ public bool IsDisposed { get; }
public float Ratio { get; init; }
public Vector2Int Size { get; set; }
public Vector2Int FramebufferSize { get; init; }
diff --git a/Hypercube.Logging/ILogger.cs b/Hypercube.Logging/ILogger.cs
index 64021b8..ba39aac 100644
--- a/Hypercube.Logging/ILogger.cs
+++ b/Hypercube.Logging/ILogger.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Shared.Logging;
+namespace Hypercube.Logging;
public interface ILogger
{
diff --git a/Hypercube.Logging/Logger.cs b/Hypercube.Logging/Logger.cs
index 0b795d7..f1e5c63 100644
--- a/Hypercube.Logging/Logger.cs
+++ b/Hypercube.Logging/Logger.cs
@@ -1,6 +1,6 @@
using System.Collections.Frozen;
-namespace Hypercube.Shared.Logging;
+namespace Hypercube.Logging;
public class Logger(string name) : ILogger
{
diff --git a/Hypercube.Logging/LoggingLevel.cs b/Hypercube.Logging/LoggingLevel.cs
index 9bc4f85..77dd776 100644
--- a/Hypercube.Logging/LoggingLevel.cs
+++ b/Hypercube.Logging/LoggingLevel.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Shared.Logging;
+namespace Hypercube.Logging;
[Flags]
public enum LoggingLevel
diff --git a/Hypercube.Logging/LoggingManager.cs b/Hypercube.Logging/LoggingManager.cs
index 0036e6f..9e7f086 100644
--- a/Hypercube.Logging/LoggingManager.cs
+++ b/Hypercube.Logging/LoggingManager.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Shared.Logging;
+namespace Hypercube.Logging;
public static class LoggingManager
{
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/ContextExtension.cs b/Hypercube.OpenAL/ContextExtension.cs
similarity index 68%
rename from Hypercube.Client/Audio/Realisations/OpenAL/ContextExtension.cs
rename to Hypercube.OpenAL/ContextExtension.cs
index 5648e79..a2f99ed 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/ContextExtension.cs
+++ b/Hypercube.OpenAL/ContextExtension.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
public static class ContextExtension
{
diff --git a/Hypercube.OpenAL/Hypercube.OpenAL.csproj b/Hypercube.OpenAL/Hypercube.OpenAL.csproj
new file mode 100644
index 0000000..f6a9242
--- /dev/null
+++ b/Hypercube.OpenAL/Hypercube.OpenAL.csproj
@@ -0,0 +1,19 @@
+
+
+
+ net8.0
+ enable
+ enable
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioHandler.cs b/Hypercube.OpenAL/OpenAlAudioManager.AudioHandler.cs
similarity index 79%
rename from Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioHandler.cs
rename to Hypercube.OpenAL/OpenAlAudioManager.AudioHandler.cs
index cce1d8c..8e6c6fd 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioHandler.cs
+++ b/Hypercube.OpenAL/OpenAlAudioManager.AudioHandler.cs
@@ -1,6 +1,6 @@
-using OpenTK.Audio.OpenAL;
+using OpenToolkit.Audio.OpenAL;
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
public sealed partial class OpenAlAudioManager
{
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioLoading.cs b/Hypercube.OpenAL/OpenAlAudioManager.AudioLoading.cs
similarity index 86%
rename from Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioLoading.cs
rename to Hypercube.OpenAL/OpenAlAudioManager.AudioLoading.cs
index 6e2ec41..4566aec 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioLoading.cs
+++ b/Hypercube.OpenAL/OpenAlAudioManager.AudioLoading.cs
@@ -1,9 +1,10 @@
-using Hypercube.Client.Audio.Settings;
-using Hypercube.Client.Utilities.Helpers;
-using Hypercube.Shared.Resources;
-using OpenTK.Audio.OpenAL;
+using Hypercube.Audio;
+using Hypercube.Audio.Settings;
+using Hypercube.Audio.Utilities.Helpers;
+using Hypercube.Resources;
+using OpenToolkit.Audio.OpenAL;
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
public sealed partial class OpenAlAudioManager
{
@@ -15,7 +16,7 @@ public IAudioSource CreateSource(AudioStream stream)
AL.Source(source, ALSourcei.Buffer, handler.Buffer);
CatchAlError("Source creation error");
- var audioSource = new AudioSource(source);
+ var audioSource = new OpenAlAudioManager.AudioSource(source);
_loadedSources.Add(new WeakReference(audioSource));
return audioSource;
@@ -49,7 +50,7 @@ private AudioStream CreateAudio(Stream stream, AudioType audioType, IAudioSettin
}
var id = NextAudioId;
- var handler = new AudioHandler(buffer);
+ var handler = new OpenAlAudioManager.AudioHandler(buffer);
_loadedAudio.Add(id, handler);
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioSource.cs b/Hypercube.OpenAL/OpenAlAudioManager.AudioSource.cs
similarity index 78%
rename from Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioSource.cs
rename to Hypercube.OpenAL/OpenAlAudioManager.AudioSource.cs
index 19738b2..39b969a 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.AudioSource.cs
+++ b/Hypercube.OpenAL/OpenAlAudioManager.AudioSource.cs
@@ -1,6 +1,7 @@
-using OpenTK.Audio.OpenAL;
+using Hypercube.Audio;
+using OpenToolkit.Audio.OpenAL;
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
public sealed partial class OpenAlAudioManager
{
@@ -30,7 +31,14 @@ public float Gain
set => SetSource(ALSourcef.Gain, value);
}
- private ALSourceState State => (ALSourceState) AL.GetSource(_source, ALGetSourcei.SourceState);
+ private ALSourceState State
+ {
+ get
+ {
+ AL.GetSource(_source, ALGetSourcei.SourceState, out var id);
+ return (ALSourceState) id;
+ }
+ }
public AudioSource(int source)
{
@@ -75,12 +83,14 @@ private void SetSource(ALSourcef target, float value)
private bool GetSource(ALSourceb target)
{
- return AL.GetSource(_source, target);
+ AL.GetSource(_source, target, out var value);
+ return value;
}
private float GetSource(ALSourcef target)
{
- return AL.GetSource(_source, target);
+ AL.GetSource(_source, target, out var value);
+ return value;
}
}
}
\ No newline at end of file
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.SourceManagement.cs b/Hypercube.OpenAL/OpenAlAudioManager.SourceManagement.cs
similarity index 93%
rename from Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.SourceManagement.cs
rename to Hypercube.OpenAL/OpenAlAudioManager.SourceManagement.cs
index b790a19..ed8b03a 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.SourceManagement.cs
+++ b/Hypercube.OpenAL/OpenAlAudioManager.SourceManagement.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
public sealed partial class OpenAlAudioManager
{
diff --git a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.cs b/Hypercube.OpenAL/OpenAlAudioManager.cs
similarity index 94%
rename from Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.cs
rename to Hypercube.OpenAL/OpenAlAudioManager.cs
index 08d4386..a5e4a02 100644
--- a/Hypercube.Client/Audio/Realisations/OpenAL/OpenAlAudioManager.cs
+++ b/Hypercube.OpenAL/OpenAlAudioManager.cs
@@ -1,14 +1,15 @@
using System.Collections.Frozen;
-using Hypercube.Client.Audio.Events;
-using Hypercube.Client.Audio.Loading;
+using Hypercube.Audio;
+using Hypercube.Audio.Events;
+using Hypercube.Audio.Loading;
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Resources.Manager;
-using Hypercube.Shared.Runtimes.Event;
-using OpenTK.Audio.OpenAL;
+using Hypercube.Logging;
+using Hypercube.Resources.Manager;
+using Hypercube.Runtime.Events;
+using OpenToolkit.Audio.OpenAL;
-namespace Hypercube.Client.Audio.Realisations.OpenAL;
+namespace Hypercube.OpenAL;
///
/// For some reason, on my Windows 11 machine there is no openal32.dll
diff --git a/Hypercube.OpenGL/ContextVersion.cs b/Hypercube.OpenGL/ContextVersion.cs
new file mode 100644
index 0000000..173dae9
--- /dev/null
+++ b/Hypercube.OpenGL/ContextVersion.cs
@@ -0,0 +1,22 @@
+using Hypercube.Graphics;
+using JetBrains.Annotations;
+using OpenTK.Windowing.Common;
+using OpenTK.Windowing.GraphicsLibraryFramework;
+
+namespace Hypercube.OpenGL;
+
+[PublicAPI]
+public struct ContextInfo : IContextInfo
+{
+ public Version Version { get; init; }
+ public ContextApi Api { get; init; }
+ public ContextProfile Profile { get; init; }
+ public ContextFlags Flags { get; init; }
+
+ public bool Compatibility => Profile == ContextProfile.Compatability;
+
+ public override string ToString()
+ {
+ return $"Context {Version}, api: {Api}, profile: {Profile}, flags: {Flags}";
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.OpenGL/Utilities/Helpers/GLSettingsHelper.cs b/Hypercube.OpenGL/Utilities/Helpers/GLSettingsHelper.cs
index 867fc3b..23810b9 100644
--- a/Hypercube.OpenGL/Utilities/Helpers/GLSettingsHelper.cs
+++ b/Hypercube.OpenGL/Utilities/Helpers/GLSettingsHelper.cs
@@ -1,8 +1,7 @@
-using Hypercube.OpenGL.Utilities.Helpers;
-using JetBrains.Annotations;
+using JetBrains.Annotations;
using OpenToolkit.Graphics.OpenGL4;
-namespace Hypercube.OpenGL;
+namespace Hypercube.OpenGL.Utilities.Helpers;
[PublicAPI]
public static class GLSettingsHelper
diff --git a/Hypercube.Client/Utilities/Helpers/TextureHelper.cs b/Hypercube.OpenGL/Utilities/Helpers/TextureHelper.cs
similarity index 83%
rename from Hypercube.Client/Utilities/Helpers/TextureHelper.cs
rename to Hypercube.OpenGL/Utilities/Helpers/TextureHelper.cs
index 935a5c4..cf88bc1 100644
--- a/Hypercube.Client/Utilities/Helpers/TextureHelper.cs
+++ b/Hypercube.OpenGL/Utilities/Helpers/TextureHelper.cs
@@ -1,12 +1,13 @@
using System.Runtime.CompilerServices;
using OpenToolkit.Graphics.OpenGL4;
-using HPixFormat = Hypercube.Client.Graphics.Texturing.Parameters.PixelFormat;
-using HPixelType = Hypercube.Client.Graphics.Texturing.Parameters.PixelType;
-using HPixelInternalFormat = Hypercube.Client.Graphics.Texturing.Parameters.PixelInternalFormat;
-using HTextureParameterName = Hypercube.Client.Graphics.Texturing.Parameters.TextureParameterName;
-using HTextureTarget = Hypercube.Client.Graphics.Texturing.Parameters.TextureTarget;
-namespace Hypercube.Client.Utilities.Helpers;
+using HPixFormat = Hypercube.Graphics.Texturing.Parameters.PixelFormat;
+using HPixelType = Hypercube.Graphics.Texturing.Parameters.PixelType;
+using HPixelInternalFormat = Hypercube.Graphics.Texturing.Parameters.PixelInternalFormat;
+using HTextureParameterName = Hypercube.Graphics.Texturing.Parameters.TextureParameterName;
+using HTextureTarget = Hypercube.Graphics.Texturing.Parameters.TextureTarget;
+
+namespace Hypercube.OpenGL.Utilities.Helpers;
public static class TextureHelper
{
diff --git a/Hypercube.Shared/Resources/Container/IResourceContainer.cs b/Hypercube.Resources/Container/IResourceContainer.cs
similarity index 92%
rename from Hypercube.Shared/Resources/Container/IResourceContainer.cs
rename to Hypercube.Resources/Container/IResourceContainer.cs
index 32db556..6d709fc 100644
--- a/Hypercube.Shared/Resources/Container/IResourceContainer.cs
+++ b/Hypercube.Resources/Container/IResourceContainer.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
-namespace Hypercube.Shared.Resources.Container;
+namespace Hypercube.Resources.Container;
public interface IResourceContainer
{
diff --git a/Hypercube.Shared/Resources/Container/ResourceContainer.cs b/Hypercube.Resources/Container/ResourceContainer.cs
similarity index 97%
rename from Hypercube.Shared/Resources/Container/ResourceContainer.cs
rename to Hypercube.Resources/Container/ResourceContainer.cs
index dda51af..78e7e9c 100644
--- a/Hypercube.Shared/Resources/Container/ResourceContainer.cs
+++ b/Hypercube.Resources/Container/ResourceContainer.cs
@@ -1,10 +1,10 @@
using System.Collections.Frozen;
using System.Diagnostics.CodeAnalysis;
using Hypercube.Dependencies;
-using Hypercube.Shared.Logging;
+using Hypercube.Logging;
using Hypercube.Utilities.Helpers;
-namespace Hypercube.Shared.Resources.Container;
+namespace Hypercube.Resources.Container;
public sealed class ResourceContainer : IResourceContainer
{
diff --git a/Hypercube.Shared/Resources/DirContentRoot.cs b/Hypercube.Resources/DirContentRoot.cs
similarity index 95%
rename from Hypercube.Shared/Resources/DirContentRoot.cs
rename to Hypercube.Resources/DirContentRoot.cs
index 4223770..535ba04 100644
--- a/Hypercube.Shared/Resources/DirContentRoot.cs
+++ b/Hypercube.Resources/DirContentRoot.cs
@@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis;
-using Hypercube.Shared.Logging;
+using Hypercube.Logging;
using Hypercube.Utilities.Helpers;
-namespace Hypercube.Shared.Resources;
+namespace Hypercube.Resources;
public class DirContentRoot : IContentRoot
{
diff --git a/Hypercube.Resources/Hypercube.Resources.csproj b/Hypercube.Resources/Hypercube.Resources.csproj
new file mode 100644
index 0000000..806d6fa
--- /dev/null
+++ b/Hypercube.Resources/Hypercube.Resources.csproj
@@ -0,0 +1,18 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Hypercube.Shared/Resources/IContentRoot.cs b/Hypercube.Resources/IContentRoot.cs
similarity index 85%
rename from Hypercube.Shared/Resources/IContentRoot.cs
rename to Hypercube.Resources/IContentRoot.cs
index 16f01e8..0925591 100644
--- a/Hypercube.Shared/Resources/IContentRoot.cs
+++ b/Hypercube.Resources/IContentRoot.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
-namespace Hypercube.Shared.Resources;
+namespace Hypercube.Resources;
public interface IContentRoot
{
diff --git a/Hypercube.Shared/Resources/Manager/IResourceLoader.cs b/Hypercube.Resources/Manager/IResourceLoader.cs
similarity index 93%
rename from Hypercube.Shared/Resources/Manager/IResourceLoader.cs
rename to Hypercube.Resources/Manager/IResourceLoader.cs
index 95ce7ef..5dd3e2b 100644
--- a/Hypercube.Shared/Resources/Manager/IResourceLoader.cs
+++ b/Hypercube.Resources/Manager/IResourceLoader.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
-namespace Hypercube.Shared.Resources.Manager;
+namespace Hypercube.Resources.Manager;
///
/// The main mechanism serving for work and management with game resource loading streams.
diff --git a/Hypercube.Shared/Resources/Manager/ResourceLoader.cs b/Hypercube.Resources/Manager/ResourceLoader.cs
similarity index 80%
rename from Hypercube.Shared/Resources/Manager/ResourceLoader.cs
rename to Hypercube.Resources/Manager/ResourceLoader.cs
index f37f539..7156150 100644
--- a/Hypercube.Shared/Resources/Manager/ResourceLoader.cs
+++ b/Hypercube.Resources/Manager/ResourceLoader.cs
@@ -1,40 +1,20 @@
using System.Diagnostics.CodeAnalysis;
-using Hypercube.Dependencies;
-using Hypercube.EventBus;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes.Event;
+using Hypercube.Logging;
using Hypercube.Utilities.Helpers;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Resources.Manager;
+namespace Hypercube.Resources.Manager;
-public sealed class ResourceLoader : IResourceLoader, IPostInject, IEventSubscriber
+[PublicAPI]
+public class ResourceLoader : IResourceLoader
{
- [Dependency] private readonly IEventBus _eventBus = default!;
-
private readonly Logger _logger = LoggingManager.GetLogger("resources");
private readonly Dictionary _cachedContent = new();
private readonly object _rootLock = new();
- private (ResourcePath prefix, IContentRoot root)[] _roots = Array.Empty<(ResourcePath, IContentRoot)>();
+ private (ResourcePath prefix, IContentRoot root)[] _roots = [];
- public void PostInject()
- {
- _eventBus.Subscribe(this, OnInitialization);
- }
-
- private void OnInitialization(ref RuntimeInitializationEvent args)
- {
- // TODO: Move it in config
- MountContentFolder(".", "/");
- MountContentFolder("Resources", "/");
- MountContentFolder("Resources/Audio", "/");
- MountContentFolder("Resources/Textures", "/");
- MountContentFolder("Resources/Shaders", "/");
-
- _logger.EngineInfo("Mounted resource directories");
- }
-
public void AddRoot(ResourcePath prefix, IContentRoot root)
{
lock (_rootLock)
diff --git a/Hypercube.Resources/Preloader/IPreloader.cs b/Hypercube.Resources/Preloader/IPreloader.cs
new file mode 100644
index 0000000..33c73bf
--- /dev/null
+++ b/Hypercube.Resources/Preloader/IPreloader.cs
@@ -0,0 +1,3 @@
+namespace Hypercube.Resources.Preloader;
+
+public interface IPreloader;
\ No newline at end of file
diff --git a/Hypercube.Resources/Preloader/IResourcePreloader.cs b/Hypercube.Resources/Preloader/IResourcePreloader.cs
new file mode 100644
index 0000000..6a1c4e8
--- /dev/null
+++ b/Hypercube.Resources/Preloader/IResourcePreloader.cs
@@ -0,0 +1,3 @@
+namespace Hypercube.Resources.Preloader;
+
+public interface IResourcePreloader;
\ No newline at end of file
diff --git a/Hypercube.Shared/Resources/Preloader/PreloadingAttribute.cs b/Hypercube.Resources/Preloader/PreloadingAttribute.cs
similarity index 81%
rename from Hypercube.Shared/Resources/Preloader/PreloadingAttribute.cs
rename to Hypercube.Resources/Preloader/PreloadingAttribute.cs
index e299e51..1a8b600 100644
--- a/Hypercube.Shared/Resources/Preloader/PreloadingAttribute.cs
+++ b/Hypercube.Resources/Preloader/PreloadingAttribute.cs
@@ -1,4 +1,4 @@
-namespace Hypercube.Shared.Resources.Preloader;
+namespace Hypercube.Resources.Preloader;
[AttributeUsage(AttributeTargets.Method)]
public sealed class PreloadingAttribute : Attribute
diff --git a/Hypercube.Shared/Resources/Preloader/ResourcePreloader.cs b/Hypercube.Resources/Preloader/ResourcePreloader.cs
similarity index 96%
rename from Hypercube.Shared/Resources/Preloader/ResourcePreloader.cs
rename to Hypercube.Resources/Preloader/ResourcePreloader.cs
index ef0e71e..e2ca9f0 100644
--- a/Hypercube.Shared/Resources/Preloader/ResourcePreloader.cs
+++ b/Hypercube.Resources/Preloader/ResourcePreloader.cs
@@ -4,7 +4,7 @@
using Hypercube.EventBus.Events;
using Hypercube.Utilities.Helpers;
-namespace Hypercube.Shared.Resources.Preloader;
+namespace Hypercube.Resources.Preloader;
public sealed class ResourcePreloader : IResourcePreloader, IEventSubscriber, IPostInject
{
@@ -42,8 +42,7 @@ public void PostInject()
}
}
- private void Subscribe(PreloadInfo info)
- where T : IEventArgs
+ private void Subscribe(PreloadInfo info) where T : IEventArgs
{
_eventBus.Subscribe(this, (ref T _) =>
{
diff --git a/Hypercube.Shared/Resources/Resource.cs b/Hypercube.Resources/Resource.cs
similarity index 82%
rename from Hypercube.Shared/Resources/Resource.cs
rename to Hypercube.Resources/Resource.cs
index 708b1bd..b72bebe 100644
--- a/Hypercube.Shared/Resources/Resource.cs
+++ b/Hypercube.Resources/Resource.cs
@@ -1,13 +1,17 @@
using Hypercube.Dependencies;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Resources;
+namespace Hypercube.Resources;
+[PublicAPI]
public abstract class Resource
{
- public virtual ResourcePath? FallbackPath => null;
+ public bool Loaded { get; private set; }
+
public bool HasFallback => FallbackPath is not null;
- public bool Loaded { get; private set; } = false;
-
+
+ public virtual ResourcePath? FallbackPath => null;
+
public void Load(ResourcePath path, DependenciesContainer container)
{
if (Loaded)
@@ -16,7 +20,7 @@ public void Load(ResourcePath path, DependenciesContainer container)
OnLoad(path, container);
Loaded = true;
}
-
+
protected abstract void OnLoad(ResourcePath path, DependenciesContainer container);
public virtual void Reload(ResourcePath path, DependenciesContainer container)
diff --git a/Hypercube.Shared/Resources/ResourcePath.cs b/Hypercube.Resources/ResourcePath.cs
similarity index 95%
rename from Hypercube.Shared/Resources/ResourcePath.cs
rename to Hypercube.Resources/ResourcePath.cs
index 1d2c740..0495bba 100644
--- a/Hypercube.Shared/Resources/ResourcePath.cs
+++ b/Hypercube.Resources/ResourcePath.cs
@@ -1,13 +1,17 @@
using System.Diagnostics.CodeAnalysis;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Resources;
+namespace Hypercube.Resources;
+[PublicAPI]
public readonly struct ResourcePath
{
public const char Separator = '/';
public const string SeparatorStr = "/";
+
public const char WinSeparator = '\\';
public const string WinSeparatorStr = @"\";
+
public static readonly char SystemSeparator;
public static readonly string SystemSeparatorStr;
@@ -109,11 +113,10 @@ public static implicit operator string(ResourcePath path)
return r;
if (l.Path == string.Empty)
- return new ResourcePath("/" + r.Path);
+ return new ResourcePath($"/{r.Path}");
- if (l.Path.EndsWith("/"))
- return new ResourcePath(l.Path + r.Path);
-
+ if (l.Path.EndsWith('/'))
+ return new ResourcePath($"{l.Path}{r.Path}");
return new ResourcePath($"{l.Path}/{r.Path}");
}
diff --git a/Hypercube.Runtime/Events/InputFrameEvent.cs b/Hypercube.Runtime/Events/InputFrameEvent.cs
new file mode 100644
index 0000000..432382b
--- /dev/null
+++ b/Hypercube.Runtime/Events/InputFrameEvent.cs
@@ -0,0 +1,15 @@
+using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
+
+namespace Hypercube.Runtime.Events;
+
+[PublicAPI]
+public readonly struct InputFrameEvent : IEventArgs
+{
+ public readonly float DeltaSeconds;
+
+ public InputFrameEvent(float deltaSeconds)
+ {
+ DeltaSeconds = deltaSeconds;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Runtime/Events/RenderFrameEvent.cs b/Hypercube.Runtime/Events/RenderFrameEvent.cs
new file mode 100644
index 0000000..c3363dd
--- /dev/null
+++ b/Hypercube.Runtime/Events/RenderFrameEvent.cs
@@ -0,0 +1,15 @@
+using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
+
+namespace Hypercube.Runtime.Events;
+
+[PublicAPI]
+public readonly struct RenderFrameEvent : IEventArgs
+{
+ public readonly float DeltaSeconds;
+
+ public RenderFrameEvent(float deltaSeconds)
+ {
+ DeltaSeconds = deltaSeconds;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Event/RuntimeInitializationEvent.cs b/Hypercube.Runtime/Events/RuntimeInitializationEvent.cs
similarity index 58%
rename from Hypercube.Shared/Runtimes/Event/RuntimeInitializationEvent.cs
rename to Hypercube.Runtime/Events/RuntimeInitializationEvent.cs
index 6750dc8..b2ab9c7 100644
--- a/Hypercube.Shared/Runtimes/Event/RuntimeInitializationEvent.cs
+++ b/Hypercube.Runtime/Events/RuntimeInitializationEvent.cs
@@ -1,5 +1,7 @@
using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Runtimes.Event;
+namespace Hypercube.Runtime.Events;
+[PublicAPI]
public readonly record struct RuntimeInitializationEvent : IEventArgs;
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Event/RuntimeShutdownEvent.cs b/Hypercube.Runtime/Events/RuntimeShutdownEvent.cs
similarity index 60%
rename from Hypercube.Shared/Runtimes/Event/RuntimeShutdownEvent.cs
rename to Hypercube.Runtime/Events/RuntimeShutdownEvent.cs
index fca2435..b10a2d4 100644
--- a/Hypercube.Shared/Runtimes/Event/RuntimeShutdownEvent.cs
+++ b/Hypercube.Runtime/Events/RuntimeShutdownEvent.cs
@@ -1,5 +1,7 @@
using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Runtimes.Event;
+namespace Hypercube.Runtime.Events;
+[PublicAPI]
public readonly record struct RuntimeShutdownEvent(string Reason) : IEventArgs;
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Event/RuntimeStartupEvent.cs b/Hypercube.Runtime/Events/RuntimeStartupEvent.cs
similarity index 56%
rename from Hypercube.Shared/Runtimes/Event/RuntimeStartupEvent.cs
rename to Hypercube.Runtime/Events/RuntimeStartupEvent.cs
index aac8159..bb2266f 100644
--- a/Hypercube.Shared/Runtimes/Event/RuntimeStartupEvent.cs
+++ b/Hypercube.Runtime/Events/RuntimeStartupEvent.cs
@@ -1,5 +1,7 @@
using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
-namespace Hypercube.Shared.Runtimes.Event;
+namespace Hypercube.Runtime.Events;
+[PublicAPI]
public readonly record struct RuntimeStartupEvent : IEventArgs;
\ No newline at end of file
diff --git a/Hypercube.Runtime/Events/TickFrameEvent.cs b/Hypercube.Runtime/Events/TickFrameEvent.cs
new file mode 100644
index 0000000..043de73
--- /dev/null
+++ b/Hypercube.Runtime/Events/TickFrameEvent.cs
@@ -0,0 +1,15 @@
+using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
+
+namespace Hypercube.Runtime.Events;
+
+[PublicAPI]
+public readonly struct TickFrameEvent : IEventArgs
+{
+ public readonly float DeltaSeconds;
+
+ public TickFrameEvent(float deltaSeconds)
+ {
+ DeltaSeconds = deltaSeconds;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Runtime/Events/UpdateFrameEvent.cs b/Hypercube.Runtime/Events/UpdateFrameEvent.cs
new file mode 100644
index 0000000..8df016a
--- /dev/null
+++ b/Hypercube.Runtime/Events/UpdateFrameEvent.cs
@@ -0,0 +1,15 @@
+using Hypercube.EventBus.Events;
+using JetBrains.Annotations;
+
+namespace Hypercube.Runtime.Events;
+
+[PublicAPI]
+public readonly struct UpdateFrameEvent : IEventArgs
+{
+ public readonly float DeltaSeconds;
+
+ public UpdateFrameEvent(float deltaSeconds)
+ {
+ DeltaSeconds = deltaSeconds;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Runtime/Hypercube.Runtime.csproj b/Hypercube.Runtime/Hypercube.Runtime.csproj
new file mode 100644
index 0000000..4f0df89
--- /dev/null
+++ b/Hypercube.Runtime/Hypercube.Runtime.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/Hypercube.Shared/Runtimes/IRuntime.cs b/Hypercube.Runtime/IRuntime.cs
similarity index 59%
rename from Hypercube.Shared/Runtimes/IRuntime.cs
rename to Hypercube.Runtime/IRuntime.cs
index 819de8b..411a928 100644
--- a/Hypercube.Shared/Runtimes/IRuntime.cs
+++ b/Hypercube.Runtime/IRuntime.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Shared.Runtimes;
+using JetBrains.Annotations;
+namespace Hypercube.Runtime;
+
+[PublicAPI]
public interface IRuntime
{
///
diff --git a/Hypercube.Shared/Runtimes/Loop/IRuntimeLoop.cs b/Hypercube.Runtime/IRuntimeLoop.cs
similarity index 56%
rename from Hypercube.Shared/Runtimes/Loop/IRuntimeLoop.cs
rename to Hypercube.Runtime/IRuntimeLoop.cs
index caaf785..f0562a1 100644
--- a/Hypercube.Shared/Runtimes/Loop/IRuntimeLoop.cs
+++ b/Hypercube.Runtime/IRuntimeLoop.cs
@@ -1,5 +1,8 @@
-namespace Hypercube.Shared.Runtimes.Loop;
+using JetBrains.Annotations;
+namespace Hypercube.Runtime;
+
+[PublicAPI]
public interface IRuntimeLoop
{
bool Running { get; }
diff --git a/Hypercube.Server/Dependencies.cs b/Hypercube.Server/Dependencies.cs
index 65bec68..8d51f2f 100644
--- a/Hypercube.Server/Dependencies.cs
+++ b/Hypercube.Server/Dependencies.cs
@@ -1,9 +1,7 @@
using Hypercube.Dependencies;
-using Hypercube.Server.Runtimes;
+using Hypercube.Runtime;
using Hypercube.Server.Runtimes.Loop;
using Hypercube.Shared;
-using Hypercube.Shared.Runtimes;
-using Hypercube.Shared.Runtimes.Loop;
namespace Hypercube.Server;
@@ -18,7 +16,7 @@ public static void Register(DependenciesContainer rootContainer)
// Runtime
rootContainer.Register();
- rootContainer.Register();
+ rootContainer.Register();
rootContainer.InstantiateAll();
}
diff --git a/Hypercube.Server/EntryPoint.cs b/Hypercube.Server/EntryPoint.cs
index a64a13d..610da0b 100644
--- a/Hypercube.Server/EntryPoint.cs
+++ b/Hypercube.Server/EntryPoint.cs
@@ -1,6 +1,6 @@
using Hypercube.Dependencies;
using Hypercube.Shared;
-using Hypercube.Shared.Utilities.ArgumentsParser;
+using Hypercube.Utilities;
namespace Hypercube.Server;
diff --git a/Hypercube.Server/Runtimes/Loop/RuntimeLoop.cs b/Hypercube.Server/Runtimes/Loop/RuntimeLoop.cs
index 2da7f63..8f9e728 100644
--- a/Hypercube.Server/Runtimes/Loop/RuntimeLoop.cs
+++ b/Hypercube.Server/Runtimes/Loop/RuntimeLoop.cs
@@ -1,7 +1,7 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Runtimes.Loop;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Timing;
namespace Hypercube.Server.Runtimes.Loop;
diff --git a/Hypercube.Server/Runtimes/Runtime.cs b/Hypercube.Server/Runtimes/Runtime.cs
index dc1782c..a7b13e8 100644
--- a/Hypercube.Server/Runtimes/Runtime.cs
+++ b/Hypercube.Server/Runtimes/Runtime.cs
@@ -1,9 +1,8 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes;
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop;
+using Hypercube.Logging;
+using Hypercube.Runtime;
+using Hypercube.Runtime.Events;
namespace Hypercube.Server.Runtimes;
diff --git a/Hypercube.Shared/Entities/Realisation/Manager/EntitiesComponentManager.cs b/Hypercube.Shared/Entities/Realisation/Manager/EntitiesComponentManager.cs
index e14f03e..3306767 100644
--- a/Hypercube.Shared/Entities/Realisation/Manager/EntitiesComponentManager.cs
+++ b/Hypercube.Shared/Entities/Realisation/Manager/EntitiesComponentManager.cs
@@ -2,12 +2,12 @@
using System.Reflection;
using Hypercube.Dependencies;
using Hypercube.EventBus;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Components;
using Hypercube.Shared.Entities.Realisation.EventBus;
using Hypercube.Shared.Entities.Realisation.Events;
using Hypercube.Shared.Entities.Systems.MetaData;
using Hypercube.Shared.Entities.Systems.Transform;
-using Hypercube.Shared.Runtimes.Event;
using Hypercube.Utilities.Helpers;
namespace Hypercube.Shared.Entities.Realisation.Manager;
diff --git a/Hypercube.Shared/Entities/Realisation/Manager/EntitiesSystemManager.cs b/Hypercube.Shared/Entities/Realisation/Manager/EntitiesSystemManager.cs
index d15935b..063075d 100644
--- a/Hypercube.Shared/Entities/Realisation/Manager/EntitiesSystemManager.cs
+++ b/Hypercube.Shared/Entities/Realisation/Manager/EntitiesSystemManager.cs
@@ -1,9 +1,8 @@
using System.Collections.Frozen;
using Hypercube.Dependencies;
using Hypercube.EventBus;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop.Event;
using Hypercube.Utilities.Helpers;
namespace Hypercube.Shared.Entities.Realisation.Manager;
diff --git a/Hypercube.Shared/Entities/Realisation/Systems/EntitySystem.cs b/Hypercube.Shared/Entities/Realisation/Systems/EntitySystem.cs
index edafd5b..48cce0d 100644
--- a/Hypercube.Shared/Entities/Realisation/Systems/EntitySystem.cs
+++ b/Hypercube.Shared/Entities/Realisation/Systems/EntitySystem.cs
@@ -2,13 +2,12 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
using Hypercube.EventBus.Events;
+using Hypercube.Logging;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation.Components;
using Hypercube.Shared.Entities.Realisation.EventBus;
using Hypercube.Shared.Entities.Realisation.EventBus.EventArgs;
using Hypercube.Shared.Entities.Realisation.Manager;
-using Hypercube.Shared.Logging;
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop.Event;
namespace Hypercube.Shared.Entities.Realisation.Systems;
diff --git a/Hypercube.Shared/Entities/Realisation/Systems/IEntitySystem.cs b/Hypercube.Shared/Entities/Realisation/Systems/IEntitySystem.cs
index 5e58ea2..7f16448 100644
--- a/Hypercube.Shared/Entities/Realisation/Systems/IEntitySystem.cs
+++ b/Hypercube.Shared/Entities/Realisation/Systems/IEntitySystem.cs
@@ -1,5 +1,4 @@
-using Hypercube.Shared.Runtimes.Event;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime.Events;
namespace Hypercube.Shared.Entities.Realisation.Systems;
diff --git a/Hypercube.Shared/Entities/Systems/Physics/PhysicsSystem.cs b/Hypercube.Shared/Entities/Systems/Physics/PhysicsSystem.cs
index f93ecd8..bdb8e9c 100644
--- a/Hypercube.Shared/Entities/Systems/Physics/PhysicsSystem.cs
+++ b/Hypercube.Shared/Entities/Systems/Physics/PhysicsSystem.cs
@@ -1,4 +1,5 @@
using Hypercube.Dependencies;
+using Hypercube.Runtime.Events;
using Hypercube.Shared.Entities.Realisation;
using Hypercube.Shared.Entities.Realisation.Events;
using Hypercube.Shared.Entities.Realisation.Systems;
@@ -6,7 +7,6 @@
using Hypercube.Shared.Entities.Systems.Transform;
using Hypercube.Shared.Physics;
using Hypercube.Shared.Physics.Events;
-using Hypercube.Shared.Runtimes.Loop.Event;
namespace Hypercube.Shared.Entities.Systems.Physics;
diff --git a/Hypercube.Shared/Hypercube.Shared.csproj b/Hypercube.Shared/Hypercube.Shared.csproj
index 15ea561..b9abff3 100644
--- a/Hypercube.Shared/Hypercube.Shared.csproj
+++ b/Hypercube.Shared/Hypercube.Shared.csproj
@@ -18,6 +18,8 @@
+
+
diff --git a/Hypercube.Shared/Physics/PhysicsManager.cs b/Hypercube.Shared/Physics/PhysicsManager.cs
index 953a36d..d7e4886 100644
--- a/Hypercube.Shared/Physics/PhysicsManager.cs
+++ b/Hypercube.Shared/Physics/PhysicsManager.cs
@@ -1,6 +1,6 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
-using Hypercube.Shared.Runtimes.Loop.Event;
+using Hypercube.Runtime.Events;
namespace Hypercube.Shared.Physics;
diff --git a/Hypercube.Shared/Resources/Preloader/IPreloader.cs b/Hypercube.Shared/Resources/Preloader/IPreloader.cs
deleted file mode 100644
index 3913eda..0000000
--- a/Hypercube.Shared/Resources/Preloader/IPreloader.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Hypercube.Shared.Resources.Preloader;
-
-public interface IPreloader;
\ No newline at end of file
diff --git a/Hypercube.Shared/Resources/Preloader/IResourcePreloader.cs b/Hypercube.Shared/Resources/Preloader/IResourcePreloader.cs
deleted file mode 100644
index 632ca6d..0000000
--- a/Hypercube.Shared/Resources/Preloader/IResourcePreloader.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Hypercube.Shared.Resources.Preloader;
-
-public interface IResourcePreloader;
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Loop/Event/InputFrameEvent.cs b/Hypercube.Shared/Runtimes/Loop/Event/InputFrameEvent.cs
deleted file mode 100644
index 92ef5b8..0000000
--- a/Hypercube.Shared/Runtimes/Loop/Event/InputFrameEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Hypercube.EventBus.Events;
-
-namespace Hypercube.Shared.Runtimes.Loop.Event;
-
-public readonly struct InputFrameEvent(float deltaSeconds) : IEventArgs
-{
- public readonly float DeltaSeconds = deltaSeconds;
-}
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Loop/Event/RenderFrameEvent.cs b/Hypercube.Shared/Runtimes/Loop/Event/RenderFrameEvent.cs
deleted file mode 100644
index 1a0f303..0000000
--- a/Hypercube.Shared/Runtimes/Loop/Event/RenderFrameEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Hypercube.EventBus.Events;
-
-namespace Hypercube.Shared.Runtimes.Loop.Event;
-
-public readonly struct RenderFrameEvent(float deltaSeconds) : IEventArgs
-{
- public readonly float DeltaSeconds = deltaSeconds;
-}
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Loop/Event/TickFrameEvent.cs b/Hypercube.Shared/Runtimes/Loop/Event/TickFrameEvent.cs
deleted file mode 100644
index ca873d4..0000000
--- a/Hypercube.Shared/Runtimes/Loop/Event/TickFrameEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Hypercube.EventBus.Events;
-
-namespace Hypercube.Shared.Runtimes.Loop.Event;
-
-public readonly struct TickFrameEvent(float deltaSeconds) : IEventArgs
-{
- public readonly float DeltaSeconds = deltaSeconds;
-}
\ No newline at end of file
diff --git a/Hypercube.Shared/Runtimes/Loop/Event/UpdateFrameEvent.cs b/Hypercube.Shared/Runtimes/Loop/Event/UpdateFrameEvent.cs
deleted file mode 100644
index 3caaacc..0000000
--- a/Hypercube.Shared/Runtimes/Loop/Event/UpdateFrameEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Hypercube.EventBus.Events;
-
-namespace Hypercube.Shared.Runtimes.Loop.Event;
-
-public readonly struct UpdateFrameEvent(float deltaSeconds) : IEventArgs
-{
- public readonly float DeltaSeconds = deltaSeconds;
-}
\ No newline at end of file
diff --git a/Hypercube.Shared/SahredMount.cs b/Hypercube.Shared/SahredMount.cs
new file mode 100644
index 0000000..c4e05da
--- /dev/null
+++ b/Hypercube.Shared/SahredMount.cs
@@ -0,0 +1,18 @@
+using Hypercube.Dependencies;
+using Hypercube.Resources.Manager;
+
+namespace Hypercube.Shared;
+
+public static class MountFolders
+{
+ public static void Mount(DependenciesContainer rootContainer)
+ {
+ var resourceLoader = rootContainer.Resolve();
+
+ resourceLoader.MountContentFolder(".", "/");
+ resourceLoader.MountContentFolder("Resources", "/");
+ resourceLoader.MountContentFolder("Resources/Audio", "/");
+ resourceLoader.MountContentFolder("Resources/Textures", "/");
+ resourceLoader.MountContentFolder("Resources/Shaders", "/");
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.Shared/SharedDependencies.cs b/Hypercube.Shared/SharedDependencies.cs
index cff88c8..776cc6c 100644
--- a/Hypercube.Shared/SharedDependencies.cs
+++ b/Hypercube.Shared/SharedDependencies.cs
@@ -1,11 +1,11 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
+using Hypercube.Resources.Container;
+using Hypercube.Resources.Manager;
+using Hypercube.Resources.Preloader;
using Hypercube.Shared.Entities.Realisation.EventBus;
using Hypercube.Shared.Entities.Realisation.Manager;
using Hypercube.Shared.Physics;
-using Hypercube.Shared.Resources.Container;
-using Hypercube.Shared.Resources.Manager;
-using Hypercube.Shared.Resources.Preloader;
using Hypercube.Shared.Timing;
namespace Hypercube.Shared;
diff --git a/Hypercube.Shared/SharedEntryPoint.cs b/Hypercube.Shared/SharedEntryPoint.cs
index 2f3b7ba..c2b4fb5 100644
--- a/Hypercube.Shared/SharedEntryPoint.cs
+++ b/Hypercube.Shared/SharedEntryPoint.cs
@@ -1,7 +1,7 @@
using Hypercube.Dependencies;
+using Hypercube.Runtime;
using Hypercube.Shared.Entities.Realisation.Systems;
-using Hypercube.Shared.Runtimes;
-using Hypercube.Shared.Utilities.ArgumentsParser;
+using Hypercube.Utilities;
namespace Hypercube.Shared;
diff --git a/Hypercube.Shared/Utilities/ArgumentsParser/ArgumentParser.cs b/Hypercube.Shared/Utilities/ArgumentsParser/ArgumentParser.cs
deleted file mode 100644
index bb505fc..0000000
--- a/Hypercube.Shared/Utilities/ArgumentsParser/ArgumentParser.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace Hypercube.Shared.Utilities.ArgumentsParser;
-
-public class ArgumentParser(string[] args)
-{
- public bool TryParse()
- {
- foreach (var arg in args)
- {
- Console.WriteLine(arg);
- }
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/Hypercube.UnitTests/Entities/QueriesTests.cs b/Hypercube.UnitTests/Entities/QueriesTests.cs
index a57e63b..09fd28e 100644
--- a/Hypercube.UnitTests/Entities/QueriesTests.cs
+++ b/Hypercube.UnitTests/Entities/QueriesTests.cs
@@ -1,12 +1,12 @@
using Hypercube.Dependencies;
using Hypercube.EventBus;
+using Hypercube.Runtime.Events;
using Hypercube.Shared;
using Hypercube.Shared.Entities.Realisation.Components;
using Hypercube.Shared.Entities.Realisation.Manager;
using Hypercube.Shared.Entities.Systems.MetaData;
using Hypercube.Shared.Entities.Systems.Transform;
using Hypercube.Shared.Entities.Systems.Transform.Coordinates;
-using Hypercube.Shared.Runtimes.Event;
namespace Hypercube.UnitTests.Entities;
diff --git a/Hypercube.UnitTests/ResourceManager/ResourceManagerTests.cs b/Hypercube.UnitTests/ResourceManager/ResourceManagerTests.cs
index ac5cc67..29e916b 100644
--- a/Hypercube.UnitTests/ResourceManager/ResourceManagerTests.cs
+++ b/Hypercube.UnitTests/ResourceManager/ResourceManagerTests.cs
@@ -1,11 +1,13 @@
-namespace Hypercube.UnitTests.ResourceManager;
+using Hypercube.Resources.Manager;
+
+namespace Hypercube.UnitTests.ResourceManager;
public class ResourceManagerTests
{
[Test]
public void ReadFileTest()
{
- var resourceMan = new Shared.Resources.Manager.ResourceLoader();
+ var resourceMan = new ResourceLoader();
resourceMan.MountContentFolder("Resources", "/");
if (!resourceMan.TryReadFileContent("/Tests/testFile.txt", out var stream))
diff --git a/Hypercube.UnitTests/ResourceManager/ResourcePathTest.cs b/Hypercube.UnitTests/ResourceManager/ResourcePathTest.cs
index 4fc9299..f548af6 100644
--- a/Hypercube.UnitTests/ResourceManager/ResourcePathTest.cs
+++ b/Hypercube.UnitTests/ResourceManager/ResourcePathTest.cs
@@ -1,4 +1,4 @@
-using Hypercube.Shared.Resources;
+using Hypercube.Resources;
namespace Hypercube.UnitTests.ResourceManager;
diff --git a/Hypercube.Utilities/ArgumentParser.cs b/Hypercube.Utilities/ArgumentParser.cs
new file mode 100644
index 0000000..16e79bb
--- /dev/null
+++ b/Hypercube.Utilities/ArgumentParser.cs
@@ -0,0 +1,24 @@
+using JetBrains.Annotations;
+
+namespace Hypercube.Utilities;
+
+[PublicAPI]
+public class ArgumentParser
+{
+ private readonly string[] _args;
+
+ public ArgumentParser(string[] args)
+ {
+ _args = args;
+ }
+
+ public bool TryParse()
+ {
+ foreach (var arg in _args)
+ {
+ Console.WriteLine(arg);
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/Hypercube.sln b/Hypercube.sln
index 804acde..6972080 100644
--- a/Hypercube.sln
+++ b/Hypercube.sln
@@ -36,6 +36,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.Utilities", "Hype
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.EventBus", "Hypercube.EventBus\Hypercube.EventBus.csproj", "{CE22139C-ABE3-484B-B41F-CB8E5435D2E7}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.Resources", "Hypercube.Resources\Hypercube.Resources.csproj", "{E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Audio", "Audio", "{9C7CC246-C3A9-4AD3-80D7-8633FDA854B9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.Audio", "Hypercube.Audio\Hypercube.Audio.csproj", "{79B6A53A-775E-4615-8A07-5606035657C3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.OpenAL", "Hypercube.OpenAL\Hypercube.OpenAL.csproj", "{A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hypercube.Runtime", "Hypercube.Runtime\Hypercube.Runtime.csproj", "{CF72EBCB-C2D3-40B5-B25E-E394999E73F5}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -102,6 +112,22 @@ Global
{CE22139C-ABE3-484B-B41F-CB8E5435D2E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE22139C-ABE3-484B-B41F-CB8E5435D2E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE22139C-ABE3-484B-B41F-CB8E5435D2E7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {79B6A53A-775E-4615-8A07-5606035657C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {79B6A53A-775E-4615-8A07-5606035657C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {79B6A53A-775E-4615-8A07-5606035657C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {79B6A53A-775E-4615-8A07-5606035657C3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CF72EBCB-C2D3-40B5-B25E-E394999E73F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CF72EBCB-C2D3-40B5-B25E-E394999E73F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CF72EBCB-C2D3-40B5-B25E-E394999E73F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CF72EBCB-C2D3-40B5-B25E-E394999E73F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8BD12846-C602-40A3-B2C2-13855C3AF641} = {F6F91A08-154D-4314-9290-2A9BDE33EB22}
@@ -116,5 +142,10 @@ Global
{11F4347A-239F-466A-8799-6CF022777FBB} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
{7D6AE485-4153-476C-AB6A-0B82BA2393A0} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
{CE22139C-ABE3-484B-B41F-CB8E5435D2E7} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
+ {E44BA1CD-1CF5-4D3C-A373-63AF15FABEB6} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
+ {9C7CC246-C3A9-4AD3-80D7-8633FDA854B9} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
+ {79B6A53A-775E-4615-8A07-5606035657C3} = {9C7CC246-C3A9-4AD3-80D7-8633FDA854B9}
+ {A8F1E4F6-8621-4DEE-9A82-2655ABEB16D3} = {9C7CC246-C3A9-4AD3-80D7-8633FDA854B9}
+ {CF72EBCB-C2D3-40B5-B25E-E394999E73F5} = {A0C34E5F-82B1-4307-89F9-96858D98761E}
EndGlobalSection
EndGlobal