-
Notifications
You must be signed in to change notification settings - Fork 45
/
Buffer.Index.cs
35 lines (30 loc) · 1.65 KB
/
Buffer.Index.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
namespace DirectX12GameEngine.Graphics
{
public partial class GraphicsBuffer
{
public static class Index
{
public static unsafe GraphicsBuffer New(GraphicsDevice device, int size, int structureByteStride, GraphicsHeapType heapType = GraphicsHeapType.Default)
{
return GraphicsBuffer.New(device, size, structureByteStride, BufferFlags.IndexBuffer, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, int elementCount, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New<T>(device, elementCount, BufferFlags.IndexBuffer, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, in T data, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New(device, data, BufferFlags.IndexBuffer, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, Span<T> data, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New(device, data, BufferFlags.IndexBuffer, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, Span<T> data, int structureByteStride, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New(device, data, structureByteStride, BufferFlags.IndexBuffer, heapType);
}
}
}
}