VertexLayout cleanup

This commit is contained in:
Simon Lübeß
2021-02-09 17:24:21 +01:00
parent abe4f66724
commit 1ce94b6a6c
3 changed files with 14 additions and 18 deletions
@@ -13,12 +13,12 @@ namespace GlitchyEngine.Renderer
public ID3DBlob* nativeShaderCode ~ _?.Release();
public this(GraphicsContext context, VertexElement[] ownElements, VertexShader vertexShader)
public this(GraphicsContext context, VertexElement[] elements, VertexShader vertexShader)
{
nativeShaderCode = vertexShader.nativeCode..AddRef();
_context = context..AddRef();
_elements = ownElements;
_elements = elements;
CreateNativeLayout();
}
+4 -6
View File
@@ -77,18 +77,16 @@ namespace GlitchyEngine.Renderer
{
private GraphicsContext _context ~ _?.ReleaseRef();
private VertexElement[] _elements ~ delete _;
private VertexElement[] _elements;
public GraphicsContext Context => _context;
public VertexElement[] Elements => _elements;
// Todo: DirectX needs shader!
/// Takes ownership of ownElements!
public this(GraphicsContext context, VertexElement[] ownElements, VertexShader vertexShader)
public this(GraphicsContext context, VertexElement[] elements, VertexShader vertexShader)
{
_context = context..AddRef();
_elements = ownElements;
_elements = elements;
CreateNativeLayout();
}
@@ -98,6 +96,6 @@ namespace GlitchyEngine.Renderer
public interface IVertexData
{
static VertexLayout VertexLayout {get;}
static VertexElement[] VertexElements {get;}
}
}