mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
49 lines
795 B
C++
49 lines
795 B
C++
#pragma once
|
|
|
|
#include <list>
|
|
|
|
enum class VertexFormat : int32_t { Flat, World };
|
|
|
|
class RenderDevice;
|
|
class VertexBuffer;
|
|
|
|
class SharedVertexBuffer
|
|
{
|
|
public:
|
|
SharedVertexBuffer(VertexFormat format, int size);
|
|
|
|
GLuint GetBuffer();
|
|
GLuint GetVAO();
|
|
|
|
VertexFormat Format = VertexFormat::Flat;
|
|
|
|
int NextPos = 0;
|
|
int Size = 0;
|
|
|
|
std::list<VertexBuffer*> VertexBuffers;
|
|
|
|
static const int FlatStride = 24;
|
|
static const int WorldStride = 36;
|
|
|
|
static void SetupFlatVAO();
|
|
static void SetupWorldVAO();
|
|
|
|
private:
|
|
GLuint mBuffer = 0;
|
|
GLuint mVAO = 0;
|
|
};
|
|
|
|
class VertexBuffer
|
|
{
|
|
public:
|
|
~VertexBuffer();
|
|
|
|
VertexFormat Format = VertexFormat::Flat;
|
|
|
|
RenderDevice* Device = nullptr;
|
|
std::list<VertexBuffer*>::iterator ListIt;
|
|
|
|
int BufferOffset = 0;
|
|
int BufferStartIndex = 0;
|
|
int Size = 0;
|
|
};
|