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
|
|
|
|
*
|
2018-06-14 03:19:35 +02:00
|
|
|
* 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:
|
2018-06-20 01:07:18 +02:00
|
|
|
VertexBuffer();
|
|
|
|
~VertexBuffer() noexcept;
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-06-14 21:16:56 +02:00
|
|
|
void setData(GLsizeiptr size, const GLvoid *data, GLenum usage) const;
|
|
|
|
void updateData(GLintptr offset, GLsizeiptr size, const GLvoid *data) const;
|
|
|
|
|
2018-06-18 20:44:17 +02:00
|
|
|
void setAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) const;
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VERTEXBUFFER_HPP_
|