27#ifndef EASY_RENDERER_VERTEX_ARRAY_OBJECT_H
28#define EASY_RENDERER_VERTEX_ARRAY_OBJECT_H
30#include <easy3d/renderer/opengl.h>
73 GLuint
id()
const {
return id_; }
98 bool create_array_buffer(GLuint&
buffer, GLuint index,
const void* data, std::size_t size, std::size_t dim,
bool dynamic =
false);
144 static void get_buffer_data(GLenum target, GLuint
buffer, GLintptr offset, GLsizeiptr size,
void* data);
A thin wrapper around an OpenGL Vertex Array Object (VAO).
Definition vertex_array_object.h:52
bool create_array_buffer(GLuint &buffer, GLuint index, const void *data, std::size_t size, std::size_t dim, bool dynamic=false)
Creates an OpenGL array buffer and uploads data to the buffer.
Definition vertex_array_object.cpp:100
GLuint id() const
Get the OpenGL ID of the VAO.
Definition vertex_array_object.h:73
static void * map_buffer(GLenum target, GLuint buffer, GLenum access)
Maps a buffer object's data store.
Definition vertex_array_object.cpp:174
void release() const
Release the VAO.
Definition vertex_array_object.cpp:85
bool update_storage_buffer(GLuint &buffer, GLintptr offset, GLsizeiptr size, const void *data)
Updates an OpenGL shader storage buffer with new data.
Definition vertex_array_object.cpp:164
void bind()
Bind the VAO.
Definition vertex_array_object.cpp:72
~VertexArrayObject()
Destructor.
Definition vertex_array_object.cpp:64
bool create_element_buffer(GLuint &buffer, const void *data, std::size_t size, bool dynamic=false)
Creates an OpenGL element buffer and uploads data to the buffer.
Definition vertex_array_object.cpp:121
static bool is_supported()
Check if VAOs are supported by the current OpenGL context.
Definition vertex_array_object.cpp:39
static void release_buffer(GLuint &buffer)
Frees the GPU memory of the buffer specified by 'buffer'.
Definition vertex_array_object.cpp:91
VertexArrayObject()
Constructor.
Definition vertex_array_object.cpp:46
static void get_buffer_data(GLenum target, GLuint buffer, GLintptr offset, GLsizeiptr size, void *data)
Returns a subset of a buffer object's data store.
Definition vertex_array_object.cpp:194
bool create_storage_buffer(GLuint &buffer, GLuint index, const void *data, std::size_t size)
Creates an OpenGL shader storage buffer and uploads data to the buffer.
Definition vertex_array_object.cpp:140
static void unmap_buffer(GLenum target, GLuint buffer)
Unmaps a buffer object's data store.
Definition vertex_array_object.cpp:186
Functions for updating render buffers.
Definition buffer.cpp:45
Definition collider.cpp:182