mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Load effects via content manager + virtual InitContentManager in App
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user