mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
37 lines
536 B
C++
37 lines
536 B
C++
|
|
#include "Precomp.h"
|
|
#include "IndexBuffer.h"
|
|
#include "RenderDevice.h"
|
|
|
|
IndexBuffer::~IndexBuffer()
|
|
{
|
|
if (Device && mBuffer != 0)
|
|
{
|
|
glDeleteBuffers(1, &mBuffer);
|
|
mBuffer = 0;
|
|
}
|
|
}
|
|
|
|
GLuint IndexBuffer::GetBuffer()
|
|
{
|
|
if (mBuffer == 0)
|
|
glGenBuffers(1, &mBuffer);
|
|
return mBuffer;
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern "C"
|
|
{
|
|
|
|
IndexBuffer* IndexBuffer_New()
|
|
{
|
|
return new IndexBuffer();
|
|
}
|
|
|
|
void IndexBuffer_Delete(IndexBuffer* buffer)
|
|
{
|
|
RenderDevice::DeleteObject(buffer);
|
|
}
|
|
|
|
}
|