|
| enum class | Type : GLenum {
Unknow = GL_INVALID_ENUM
, Storage = GL_ARRAY_BUFFER
, Element = GL_ELEMENT_ARRAY_BUFFER
, Uniform = GL_UNIFORM_BUFFER
,
Texture = GL_TEXTURE_BUFFER
, TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER
, ShaderStorage = GL_SHADER_STORAGE_BUFFER
, PixelPack = GL_PIXEL_PACK_BUFFER
,
PixelUnpack = GL_PIXEL_UNPACK_BUFFER
, DrawIndirect = GL_DRAW_INDIRECT_BUFFER
, AtomicCounter = GL_ATOMIC_COUNTER_BUFFER
} |
| | Supported OpenGL binding targets for buffer uploads.
|
| enum class | Usage : GLenum {
Unknow = GL_INVALID_ENUM
, Static = GL_STATIC_DRAW
, Dynamic = GL_DYNAMIC_DRAW
, Stream = GL_STREAM_DRAW
,
StaticRead = GL_STATIC_READ
, DynamicRead = GL_DYNAMIC_READ
, StreamRead = GL_STREAM_READ
, StaticCopy = GL_STATIC_COPY
,
DynamicCopy = GL_DYNAMIC_COPY
, StreamCopy = GL_STREAM_COPY
} |
| | Usage hints forwarded to the OpenGL driver.
|
|
using | Buffer = std::vector<uint8_t> |
| | CPU-side byte buffer used as staging before GPU upload.
|
|
using | Contract = StatefulObject<ActivationStatus>::Contract |
| | Subscription handle controlling callback lifetime.
|
|
using | Job = StatefulObject<ActivationStatus>::Job |
| | Callback signature executed on activation state changes.
|
|
using | Contract |
| | Handle allowing subscribers to manage callback lifetimes.
|
|
using | Job |
| | Callable invoked when the object transitions to a state.
|
|
| | BufferObject (const Type &p_type, const Usage &p_usage) |
| | Constructs a buffer with target type and usage hint.
|
| | BufferObject (const BufferObject &p_other) |
| | Copies buffer configuration and staged content from another buffer.
|
| BufferObject & | operator= (const BufferObject &p_other) |
| | Copies buffer configuration and staged content from another buffer.
|
| void | reserve (size_t p_size) |
| | Reserves CPU-side storage without changing size.
|
| void | resize (size_t p_size) |
| | Resizes CPU-side buffer and marks for sync.
|
| void | swapData (std::vector< uint8_t > &p_data) |
| | Swaps CPU staging buffer with external vector.
|
| template<typename TType> |
| void | setData (const std::vector< TType > &p_data) |
| | Replaces buffer contents with a vector of trivially copyable values.
|
| template<typename TType> |
| void | setData (std::initializer_list< TType > p_data) |
| | Replaces buffer contents with an initializer list of values.
|
| void | setData (const void *p_data, size_t p_size) |
| | Replaces CPU buffer content with raw data.
|
| void | pushData (const void *p_data, size_t p_size) |
| | Appends raw data to CPU buffer.
|
| template<typename TType> |
| void | pushData (const TType &p_value) |
| | Appends a single trivially copyable value to the buffer.
|
| template<typename TType> |
| void | pushData (const std::vector< TType > &p_values) |
| | Appends a vector of trivially copyable values to the buffer.
|
| template<typename TType> |
| void | pushData (std::initializer_list< TType > p_values) |
| | Appends an initializer list of trivially copyable values to the buffer.
|
| void | editData (const void *p_data, size_t p_offset, size_t p_size) |
| | Overwrites a range of the CPU buffer.
|
| template<typename TType> |
| void | editData (const TType &p_value, size_t p_offset) |
| | Overwrites part of the buffer with a single value.
|
| size_t | size () const |
| | Returns the current CPU buffer size.
|
| Buffer & | buffer () |
| | Mutable access to the CPU staging buffer.
|
| const Buffer & | buffer () const |
| | Const access to the CPU staging buffer.
|
| Buffer::value_type * | data () |
| | Mutable pointer to underlying bytes.
|
| const Buffer::value_type * | data () const |
| | Const pointer to underlying bytes.
|
|
| ActivableObject () |
| | Builds a deactivated object.
|
| | ActivableObject (ActivationStatus p_initial) |
| | Builds with a custom initial activation state.
|
|
void | activate () |
| | Sets the state to Activated.
|
|
void | deactivate () |
| | Sets the state to Deactivated.
|
|
void | toggle () |
| | Toggles between activated and deactivated states.
|
| bool | isActive () const |
| | Checks whether the object is currently activated.
|
| Contract | addActivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object activates.
|
| Contract | addDeactivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object deactivates.
|
| | StatefulObject (const ActivationStatus &p_initialState) |
| | Builds with an initial state.
|
|
StatefulObject & | operator= (const StatefulObject &p_other)=delete |
| void | setState (const ActivationStatus &p_newState) |
| | Sets a new state and triggers callbacks registered for it.
|
| ActivationStatus | state () const |
| | Returns the current state.
|
| Contract | addCallback (const ActivationStatus &p_state, const Job &p_callback) |
| | Subscribes a callback for a specific state.
|
|
void | requestSynchronization () noexcept |
| | Marks the object as needing synchronization.
|
| bool | needsSynchronization () const noexcept |
| | Checks if synchronization is pending.
|
|
void | synchronize () |
| | Performs synchronization if requested.
|
|
void | forceSynchronization () |
| | Forces synchronization regardless of current flag.
|
Owns an OpenGL buffer with CPU-side staging and synchronization to GPU.
- See also
- BufferSetObject, UniformBufferObject, ShaderStorageBufferObject
spk::OpenGL::BufferObject::Usage::Dynamic);
buf.setData(std::vector<float>{1.f, 2.f, 3.f});
buf.activate();
Owns an OpenGL buffer with CPU-side staging and synchronization to GPU.
Definition spk_buffer_object.hpp:33