mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
(Breaking) Made VertexLayout initialization sexy
This commit is contained in:
@@ -91,9 +91,9 @@ namespace GlitchyEngine
|
|||||||
// Create Input Layout
|
// Create Input Layout
|
||||||
|
|
||||||
_vertexLayout = new VertexLayout(_window.Context, new .(
|
_vertexLayout = new VertexLayout(_window.Context, new .(
|
||||||
VertexElement("POSITION", 0, .R32G32B32_Float, 0),
|
VertexElement(.R32G32B32_Float, "POSITION"),
|
||||||
VertexElement("COLOR", 0, .R8G8B8A8_UNorm, 0)
|
VertexElement(.R8G8B8A8_UNorm, "COLOR"),
|
||||||
), _vertexShader.[Friend]nativeCode);
|
), _vertexShader);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load pixel shader
|
// Load pixel shader
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ namespace GlitchyEngine.Renderer
|
|||||||
{
|
{
|
||||||
internal ID3D11InputLayout* nativeLayout ~ _?.Release();
|
internal ID3D11InputLayout* nativeLayout ~ _?.Release();
|
||||||
|
|
||||||
public ID3DBlob* nativeShaderCode;
|
public ID3DBlob* nativeShaderCode ~ _?.Release();
|
||||||
|
|
||||||
public this(GraphicsContext context, VertexElement[] ownElements, ID3DBlob* nativeShaderCode)
|
public this(GraphicsContext context, VertexElement[] ownElements, VertexShader vertexShader)
|
||||||
{
|
{
|
||||||
this.nativeShaderCode = nativeShaderCode;
|
nativeShaderCode = vertexShader.nativeCode..AddRef();
|
||||||
|
|
||||||
_context = context;
|
_context = context;
|
||||||
_elements = ownElements;
|
_elements = ownElements;
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ namespace GlitchyEngine.Renderer
|
|||||||
|
|
||||||
public this() => this = default;
|
public this() => this = default;
|
||||||
|
|
||||||
public this(String semanticName, uint32 semanticIndex, Format format, uint32 inputSlot, uint32 offset = (.)-1, InputClassification slotClass = .PerVertexData, uint32 instanceStepRate = 0)
|
public this(Format format, String semanticName, uint32 semanticIndex = 0, uint32 inputSlot = 0, uint32 offset = (.)-1, InputClassification slotClass = .PerVertexData, uint32 instanceStepRate = 0)
|
||||||
{
|
{
|
||||||
|
Format = format;
|
||||||
SemanticName = semanticName;
|
SemanticName = semanticName;
|
||||||
SemanticIndex = semanticIndex;
|
SemanticIndex = semanticIndex;
|
||||||
Format = format;
|
|
||||||
InputSlot = inputSlot;
|
InputSlot = inputSlot;
|
||||||
AlignedByteOffset = offset;
|
AlignedByteOffset = offset;
|
||||||
InputSlotClass = slotClass;
|
InputSlotClass = slotClass;
|
||||||
@@ -85,7 +85,7 @@ namespace GlitchyEngine.Renderer
|
|||||||
|
|
||||||
// Todo: DirectX needs shader!
|
// Todo: DirectX needs shader!
|
||||||
/// Takes ownership of ownElements!
|
/// Takes ownership of ownElements!
|
||||||
public this(GraphicsContext context, VertexElement[] ownElements)
|
public this(GraphicsContext context, VertexElement[] ownElements, VertexShader vertexShader)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_elements = ownElements;
|
_elements = ownElements;
|
||||||
|
|||||||
Reference in New Issue
Block a user