OpenMiner/include/gl/VertexBuffer.hpp

42 lines
984 B
C++
Raw Normal View History

2014-12-18 07:02:48 +01:00
/*
* =====================================================================================
*
* Filename: VertexBuffer.hpp
*
2018-06-05 01:24:54 +02:00
* Description:
2014-12-18 07:02:48 +01:00
*
* Created: 15/12/2014 17:09:58
*
* Author: Quentin Bazin, <quent42340@gmail.com>
2014-12-18 07:02:48 +01:00
*
* =====================================================================================
*/
#ifndef VERTEXBUFFER_HPP_
#define VERTEXBUFFER_HPP_
#include "OpenGL.hpp"
class VertexBuffer {
public:
VertexBuffer(GLenum mode, GLint first, GLsizei count);
2014-12-18 07:02:48 +01:00
~VertexBuffer();
2018-06-05 01:24:54 +02:00
void setData(GLsizeiptr size, const GLvoid *data, GLenum usage) const;
void updateData(GLintptr offset, GLsizeiptr size, const GLvoid *data) const;
GLenum mode() const { return m_mode; }
GLint first() const { return m_first; }
GLsizei count() const { return m_count; }
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
static void bind(const VertexBuffer *vertexBuffer);
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
private:
GLuint m_id;
GLenum m_mode;
GLint m_first;
GLsizei m_count;
2014-12-18 07:02:48 +01:00
};
#endif // VERTEXBUFFER_HPP_