gtsam_points
Loading...
Searching...
No Matches
shader_storage_buffer.hpp
Go to the documentation of this file.
1#ifndef GLK_SHADER_STORAGE_BUFFER_HPP
2#define GLK_SHADER_STORAGE_BUFFER_HPP
3
4#include <vector>
5#include <iostream>
6#include <GL/gl3w.h>
7
8namespace glk {
9
11public:
12 ShaderStorageBuffer(size_t size, const void* data = nullptr, GLenum usage = GL_DYNAMIC_COPY);
14
15 GLuint id() const;
16 size_t size() const;
17
18 void set_data(size_t buffer_size, const void* data);
19 void get_data(size_t buffer_size, void* data) const;
20
21 template <typename T>
22 void clear_data(const T& data);
23
24 void copy_to(ShaderStorageBuffer& dst, size_t size = 0) const;
25
26 void bind(int index = 0);
27 void unbind(int index = 0);
28
29private:
30 size_t buffer_size;
31 GLuint ssbo;
32};
33
34} // namespace glk
35
36#endif
Definition shader_storage_buffer.hpp:10
void clear_data(const T &data)
void copy_to(ShaderStorageBuffer &dst, size_t size=0) const
void get_data(size_t buffer_size, void *data) const
void set_data(size_t buffer_size, const void *data)
void bind(int index=0)
ShaderStorageBuffer(size_t size, const void *data=nullptr, GLenum usage=GL_DYNAMIC_COPY)
void unbind(int index=0)
Definition async_buffer_copy.hpp:6
std::enable_if_t< needs_aligned_allocator< T >::value, std::shared_ptr< T > > make_shared(Args &&... args)
Definition make_shared.hpp:20