Separate GraphicsContext from Window, prepare for windows and swap chain for multi window

This commit is contained in:
Simon Lübeß
2024-09-10 19:07:58 +02:00
parent 65992126c0
commit 352073869f
16 changed files with 99 additions and 130 deletions
+4 -4
View File
@@ -118,7 +118,7 @@ namespace GlitchyEditor
[AllowAppend]
public this(String[] args, EditorContentManager contentManager) : base("Editor")
{
Application.Get().Window.IsVSync = true;
Application.Get().MainWindow.IsVSync = true;
ScriptEngine.ApplicationInfo.IsEditor = true;
@@ -306,7 +306,7 @@ namespace GlitchyEditor
private void InitGraphics()
{
_context = Application.Get().Window.Context..AddRef();
_context = Application.Instance.ImmediateContext..AddRef();
RasterizerStateDescription rsDesc = .(.Solid, .Back, true);
_rasterizerState = new RasterizerState(rsDesc);
@@ -471,7 +471,7 @@ namespace GlitchyEditor
RenderCommand.SetRenderTarget(null, 0, true);
RenderCommand.BindRenderTargets();
RenderCommand.SetViewport(_context.SwapChain.BackbufferViewport);
RenderCommand.SetViewport(Application.Instance.MainWindow.SwapChain.BackbufferViewport);
}
private void DebugDraw3D()
@@ -583,7 +583,7 @@ namespace GlitchyEditor
title.AppendF($" | {_editorScene.Name}");
}
Application.Instance.Window.Title = title;
Application.Instance.MainWindow.Title = title;
}
#region Project Management