mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-24 04:41:10 +00:00
40 lines
1,000 B
C#
40 lines
1,000 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace CodeImp.DoomBuilder.Rendering
|
|||
|
{
|
|||
|
public class Mesh : IDisposable
|
|||
|
{
|
|||
|
public Mesh(VertexElement[] vertexDecl, WorldVertex[] vertexData, int[] indexData)
|
|||
|
{
|
|||
|
VertexDecl = new VertexDeclaration(vertexDecl);
|
|||
|
unsafe { Vertices = new VertexBuffer(sizeof(WorldVertex)); }
|
|||
|
Vertices.SetBufferData(vertexData);
|
|||
|
Indices = new IndexBuffer(sizeof(int) * indexData.Length);
|
|||
|
Indices.SetBufferData(indexData);
|
|||
|
}
|
|||
|
|
|||
|
~Mesh()
|
|||
|
{
|
|||
|
Dispose();
|
|||
|
}
|
|||
|
|
|||
|
public void DrawSubset(int index)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public void Dispose()
|
|||
|
{
|
|||
|
if (Vertices != null) Vertices.Dispose();
|
|||
|
if (Indices != null) Indices.Dispose();
|
|||
|
}
|
|||
|
|
|||
|
VertexDeclaration VertexDecl;
|
|||
|
VertexBuffer Vertices;
|
|||
|
IndexBuffer Indices;
|
|||
|
}
|
|||
|
}
|