|
Sparkle 0.0.1
|
RAII wrapper for an OpenGL framebuffer with typed attachments. More...
#include <spk_frame_buffer_object.hpp>


Classes | |
| class | Attachment |
| Texture attachment with basic format presets for FBOs. More... | |
Public Member Functions | |
| FrameBufferObject () | |
| Constructs an empty framebuffer. | |
| FrameBufferObject (const FrameBufferObject &p_other) | |
| Copies framebuffer state, attachments, and size from another instance. | |
| FrameBufferObject & | operator= (const FrameBufferObject &p_other) |
| Assigns framebuffer content from another instance. | |
| void | addAttachment (const GLuint &p_index, Attachment::Type p_type) |
| Adds an attachment at the given color index. | |
| Attachment & | attachment (const GLuint &p_index) |
| Accesses an attachment by index. | |
| const Attachment & | attachment (const GLuint &p_index) const |
| Accesses an attachment by index. | |
| bool | hasAttachment (const GLuint &p_index) const |
| Checks if an attachment exists. | |
| void | resize (const spk::Vector2UInt &p_size) |
| Resizes all attachments and viewport to the given size. | |
| const spk::Vector2UInt & | size () const |
| Returns current framebuffer size. | |
| const spk::OpenGL::ViewRegion & | viewRegion () const |
| Returns the view region associated with this framebuffer. | |
| void | clear (const spk::Color &p_color, const ViewRegion::ClearMask &p_clearMask) |
| Clears the framebuffer with the given color and mask. | |
| spk::OpenGL::TextureObject | exportAttachmentTexture (GLuint p_index) |
| Exports an attachment texture by value (copy). | |
| Public Member Functions inherited from spk::ActivableObject | |
| 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. | |
| Public Member Functions inherited from spk::StatefulObject< ActivationStatus > | |
| 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. | |
| Public Member Functions inherited from spk::SynchronizableObject | |
| 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. | |
Additional Inherited Members | |
| Public Types inherited from spk::ActivableObject | |
| using | Contract = StatefulObject<ActivationStatus>::Contract |
| Subscription handle controlling callback lifetime. | |
| using | Job = StatefulObject<ActivationStatus>::Job |
| Callback signature executed on activation state changes. | |
| Public Types inherited from spk::StatefulObject< ActivationStatus > | |
| using | Contract |
| Handle allowing subscribers to manage callback lifetimes. | |
| using | Job |
| Callable invoked when the object transitions to a state. | |
RAII wrapper for an OpenGL framebuffer with typed attachments.
| spk::OpenGL::FrameBufferObject::FrameBufferObject | ( | const FrameBufferObject & | p_other | ) |
Copies framebuffer state, attachments, and size from another instance.
| p_other | Framebuffer to duplicate. |

| void spk::OpenGL::FrameBufferObject::addAttachment | ( | const GLuint & | p_index, |
| Attachment::Type | p_type ) |
Adds an attachment at the given color index.
| p_index | Attachment index (color slot). |
| p_type | Attachment type/format. |

| FrameBufferObject::Attachment & spk::OpenGL::FrameBufferObject::attachment | ( | const GLuint & | p_index | ) |
Accesses an attachment by index.
| p_index | Attachment index. |

| const FrameBufferObject::Attachment & spk::OpenGL::FrameBufferObject::attachment | ( | const GLuint & | p_index | ) | const |
| void spk::OpenGL::FrameBufferObject::clear | ( | const spk::Color & | p_color, |
| const ViewRegion::ClearMask & | p_clearMask ) |
Clears the framebuffer with the given color and mask.
| p_color | Clear color. |
| p_clearMask | Buffer mask. |

| spk::OpenGL::TextureObject spk::OpenGL::FrameBufferObject::exportAttachmentTexture | ( | GLuint | p_index | ) |
Exports an attachment texture by value (copy).
| p_index | Attachment index. |

| bool spk::OpenGL::FrameBufferObject::hasAttachment | ( | const GLuint & | p_index | ) | const |
| FrameBufferObject & spk::OpenGL::FrameBufferObject::operator= | ( | const FrameBufferObject & | p_other | ) |
Assigns framebuffer content from another instance.
| p_other | Framebuffer to copy from. |

| void spk::OpenGL::FrameBufferObject::resize | ( | const spk::Vector2UInt & | p_size | ) |
Resizes all attachments and viewport to the given size.
| p_size | New dimensions. |

| const spk::Vector2UInt & spk::OpenGL::FrameBufferObject::size | ( | ) | const |
Returns current framebuffer size.
| const spk::OpenGL::ViewRegion & spk::OpenGL::FrameBufferObject::viewRegion | ( | ) | const |
Returns the view region associated with this framebuffer.