mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 20:32:34 +00:00
d701987fb4
- CopyTexture bug fixes
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace CodeImp.DoomBuilder.Rendering
|
|
{
|
|
public class VertexBuffer : IDisposable
|
|
{
|
|
public VertexBuffer()
|
|
{
|
|
Handle = VertexBuffer_New();
|
|
if (Handle == IntPtr.Zero)
|
|
throw new Exception("VertexBuffer_New failed");
|
|
}
|
|
|
|
~VertexBuffer()
|
|
{
|
|
Dispose();
|
|
}
|
|
|
|
public bool Disposed { get { return Handle == IntPtr.Zero; } }
|
|
|
|
public void Dispose()
|
|
{
|
|
if (!Disposed)
|
|
{
|
|
VertexBuffer_Delete(Handle);
|
|
Handle = IntPtr.Zero;
|
|
}
|
|
}
|
|
|
|
internal IntPtr Handle;
|
|
|
|
[DllImport("BuilderNative.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern IntPtr VertexBuffer_New();
|
|
|
|
[DllImport("BuilderNative.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void VertexBuffer_Delete(IntPtr handle);
|
|
}
|
|
}
|