Load effects via content manager + virtual InitContentManager in App

This commit is contained in:
Simon Lübeß
2023-01-08 00:17:04 +01:00
parent 3da60355df
commit 4589030da6
36 changed files with 1092 additions and 743 deletions
+13 -11
View File
@@ -7,13 +7,12 @@ using GlitchyEngine.Content;
namespace GlitchyEngine
{
public class Application
public abstract class Application
{
static Application s_Instance = null;
private Window _window;
private RendererAPI _rendererApi;
private EffectLibrary _effectLibrary;
private bool _running = true;
private bool _isMinimized = false;
@@ -31,8 +30,6 @@ namespace GlitchyEngine
public bool IsRunning => _running;
public Window Window => _window;
public EffectLibrary EffectLibrary => _effectLibrary;
public IContentManager ContentManager => _contentManager;
public bool IsMinimized => _isMinimized;
@@ -56,19 +53,19 @@ namespace GlitchyEngine
_window.EventCallback = new => OnEvent;
Input.Init();
_contentManager = InitContentManager();
// TODO: RenderAPI in RenderCommand initialisieren?
_rendererApi = new RendererAPI();
_rendererApi.Context = _window.Context;
//_contentManager = new ContentManager("./content");
SamplerStateManager.Init();
// TODO: Rendercommmand in Renderer initialisieren?
RenderCommand.RendererAPI = _rendererApi;
_effectLibrary = new EffectLibrary();
Renderer.Init(_effectLibrary);
Renderer.Init();
#if IMGUI
_imGuiLayer = new ImGuiLayer();
@@ -79,6 +76,13 @@ namespace GlitchyEngine
Settings.Apply();
}
/// Initializes the content manager.
protected abstract IContentManager InitContentManager();
//{
// TODO: init default content manager?
//_contentManager = new ContentManager("./content");
//}
public ~this()
{
Profiler.ProfileFunction!();
@@ -86,8 +90,6 @@ namespace GlitchyEngine
SamplerStateManager.Uninit();
Renderer.Deinit();
delete _effectLibrary;
delete _contentManager;
delete _rendererApi;