Render basic geometry

Added GraphicsContext, SwapChain, Buffer, VertexBuffer, IndexBuffer and a basic DX11 implementation.
This commit is contained in:
Simon Lübeß
2020-11-25 13:03:40 +01:00
parent 0237e0b38d
commit 5954fbc411
20 changed files with 1219 additions and 180 deletions
+32
View File
@@ -0,0 +1,32 @@
namespace GlitchyEngine.Renderer
{
public enum IndexFormat
{
Index16Bit,
Index32Bit,
}
public class IndexBuffer : Buffer
{
private uint32 _indexCount;
private IndexFormat _format;
public uint32 IndexCount => _indexCount;
public IndexFormat Format => _format;
public this(GraphicsContext context, uint32 indexCount, Usage usage = .Default, CPUAccessFlags cpuAccess = .None, IndexFormat indexFormat = .Index16Bit) : base(context)
{
_indexCount = indexCount;
_format = indexFormat;
_description = .()
{
Size = (_format == .Index32Bit ? 4 : 2) * _indexCount,
Usage = usage,
CPUAccess = cpuAccess,
BindFlags = .Index,
MiscFlags = .None
};
}
}
}