mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
VertexBuffer, VertexLayout and GeometryBinding improvements
- VertexBuffer: Added constructor that takes stride instead of type - VertexLayout: Added Refcounting to VertexLayout and ownership parameters for VertexElements - Fixed: GeometryBinding using stride and offset from buffer instead of buffer binding
This commit is contained in:
@@ -40,6 +40,21 @@ namespace GlitchyEngine.Renderer
|
||||
_defaultBinding = .(this, (.)_vertexType.Stride, 0);
|
||||
}
|
||||
|
||||
public this(GraphicsContext context, uint32 vertexStride, uint32 vertexCount, Usage usage = .Default, CPUAccessFlags cpuAccess = .None) : base(context)
|
||||
{
|
||||
_vertexType = null;
|
||||
|
||||
_description = .(){
|
||||
Size = (vertexStride * vertexCount),
|
||||
Usage = usage,
|
||||
CPUAccess = cpuAccess,
|
||||
BindFlags = .Vertex,
|
||||
MiscFlags = .None
|
||||
};
|
||||
|
||||
_defaultBinding = .(this, vertexStride, 0);
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public static implicit operator VertexBufferBinding(Self buffer) => buffer._defaultBinding;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user