Added RenderTarget2D

This commit is contained in:
Simon Lübeß
2021-09-17 12:58:33 +02:00
parent d051b392d0
commit 266d7a4651
9 changed files with 77 additions and 38 deletions
@@ -0,0 +1,25 @@
using System;
namespace GlitchyEngine.Renderer
{
public class RenderTarget2D : Texture2D
{
public this(GraphicsContext context, uint32 width, uint32 height, Format format, uint32 arraySize = 1, uint32 mipLevels = 1, CPUAccessFlags cpuAccess = .None)
: base(context)
{
Texture2DDesc desc;
desc.Width = width;
desc.Height = height;
desc.Format = format;
desc.ArraySize = arraySize;
desc.MipLevels = mipLevels;
// RenderTargets only can do default (I think)
desc.Usage = .Default;
desc.CpuAccess = cpuAccess;
CreateRenderTargetPlatform(desc);
}
protected extern void CreateRenderTargetPlatform(Texture2DDesc desc);
}
}