RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
Loading...
Searching...
No Matches
VertexBuffer.cpp
Go to the documentation of this file.
1#include "VertexBuffer.h"
2#include "Renderer.h"
3
4VertexBuffer::VertexBuffer(const void* data, unsigned int size)
5{
6 GLCall(glGenBuffers(1, &m_RendererID));
7 GLCall(glBindBuffer(GL_ARRAY_BUFFER, m_RendererID));
8 GLCall(glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW));
9}
10
12{
13 GLCall(glDeleteBuffers(1, &m_RendererID));
14}
15
17{
18 GLCall(glBindBuffer(GL_ARRAY_BUFFER, m_RendererID));
19}
20
22{
23 GLCall(glBindBuffer(GL_ARRAY_BUFFER, 0));
24}
#define GLCall(x)
Definition Renderer.h:12
void Bind() const
unsigned int m_RendererID
void Unbind() const
VertexBuffer(const void *data, unsigned int size)