Added Backbuffer to Swapchain + RenderCommand API changes

This commit is contained in:
Simon Lübeß
2021-10-15 22:40:42 +02:00
parent 90e654b750
commit ffafa380ea
14 changed files with 228 additions and 129 deletions
@@ -3,6 +3,7 @@
using DirectX.Common;
using DirectX.D3D11;
using GlitchyEngine.Platform.DX11;
using DirectX.DXGI.DXGI1_2;
using internal GlitchyEngine.Platform.DX11;
@@ -41,6 +42,18 @@ namespace GlitchyEngine.Renderer
PlatformCreateTexture();
if(_description.IsSwapchainTarget)
{
// TODO: if the engine supports multiple windows it has to support multiple swap chains.
// kinda dirty...
var context = GraphicsContext.Get();
context.SwapChain.GetBackbuffer(out _nativeTexture);
CreateViews();
}
if(_description.DepthStencilFormat != .None)
{
_depthStenilTarget = new DepthStencilTarget(_description.Width, _description.Height, _description.DepthStencilFormat);