2016-03-21 04:10:14 +00:00
|
|
|
#ifndef _VBO_H_
|
|
|
|
#define _VBO_H_
|
|
|
|
|
2020-07-31 19:18:51 +00:00
|
|
|
#include <GL/glew.h>
|
2016-03-21 04:10:14 +00:00
|
|
|
|
|
|
|
class VBO
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VBO();
|
|
|
|
|
|
|
|
void Create (GLenum target, GLenum usage, GLsizeiptr size, const void* data=nullptr);
|
|
|
|
void BufferSubData (GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
2016-03-24 13:17:17 +00:00
|
|
|
bool AppendData (GLsizeiptr size, const GLvoid* data);
|
|
|
|
void Reset (); // don't delete data, just go back to start
|
2016-03-21 04:10:14 +00:00
|
|
|
void Destroy ();
|
|
|
|
void Bind (bool enable);
|
2016-03-24 13:17:17 +00:00
|
|
|
int GetSize ();
|
|
|
|
int GetCapacity ();
|
2016-03-21 04:10:14 +00:00
|
|
|
|
|
|
|
private:
|
2022-11-07 21:33:01 +00:00
|
|
|
GLuint m_id;
|
|
|
|
GLenum m_target;
|
|
|
|
int m_capacity;
|
|
|
|
int m_size;
|
2016-03-21 04:10:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|