This class is an abstraction of a generic render target. More...
#include <Luminous/FrameBuffer.hpp>
Public Types | |
| enum | FrameBufferBind { BIND_DEFAULT, BIND_READ, BIND_DRAW } |
| How FrameBuffer is bound. Determines what to do when target is bound. More... | |
| enum | FrameBufferType { INVALID, WINDOW, NORMAL } |
| Type of FrameBuffer. More... | |
Public Types inherited from Luminous::RenderResource | |
| typedef uint64_t | Id |
| Id of a resource. | |
| enum | Type { VertexArray, Buffer, Program, Texture, RenderBuffer, FrameBuffer } |
| Different types of render resources. More... | |
Public Member Functions | |
| void | attach (GLenum attachment, Luminous::Texture &texture) |
| Attach a Texture to this render target. More... | |
| void | attach (GLenum attachment, Luminous::RenderBuffer &buffer) |
| Attach a RenderBuffer to this render target. More... | |
| Luminous::RenderBuffer & | createRenderBufferAttachment (GLenum attachment, GLenum storageFormat) |
| Creates RenderBuffer and attaches it to given slot. More... | |
| Luminous::Texture & | createTextureAttachment (GLenum attachment, const Luminous::PixelFormat &format) |
| Creates Texture and attaches it to given slot. More... | |
| FrameBufferCopy | deepCopy () const |
| Deep copy creates an identical render target to the copied one. More... | |
| FrameBuffer (FrameBufferType type=NORMAL) | |
| Constructor of FrameBuffer. More... | |
| FrameBuffer (const FrameBufferCopy &rt) | |
| Construct render target from proxy object returned by one of copy functions. More... | |
| FrameBuffer (FrameBuffer &&rt) | |
| Move constructor. More... | |
| FrameBuffer & | operator= (const FrameBufferCopy &rt) |
| Assign proxy object to render target. More... | |
| FrameBuffer & | operator= (FrameBuffer &&rt) |
| Move assignment operator. More... | |
| Luminous::RenderBuffer * | renderBuffer (GLenum attachment) const |
| Returns RenderBuffer attached for given slot. More... | |
| QList< GLenum > | renderBufferAttachments () const |
| Returns list of attachments where RenderBuffer is used. More... | |
| unsigned | samples () const |
| Number of samples if using multisampling. More... | |
| void | setSamples (unsigned int samples) |
| Sets number of samples for multisampling. More... | |
| void | setSize (const Nimble::Size &size) |
| Sets size for this render target. More... | |
| void | setTargetBind (FrameBufferBind bind) |
| Sets the binding type for this target. More... | |
| FrameBufferCopy | shallowCopy () const |
| Shallow copy with attachments. More... | |
| FrameBufferCopy | shallowCopyNoAttachments () const |
| Shallow copy without attachments. More... | |
| const Nimble::Size & | size () const |
| Size of the render target. More... | |
| FrameBufferBind | targetBind () const |
| Returns the current binding type for this target. More... | |
| FrameBufferType | targetType () const |
| Returns type of this render target. More... | |
| Luminous::Texture * | texture (GLenum attachment) const |
| Returns Texture attached for given slot. More... | |
| QList< GLenum > | textureAttachments () const |
| Returns list of attachments where Texture is used. More... | |
| ~FrameBuffer () | |
| Destructor. | |
Public Member Functions inherited from Luminous::RenderResource | |
| unsigned int | expiration () const |
| Returns resource expiration time. More... | |
| int | generation () const |
| Returns generation of this resource. More... | |
| void | invalidate () |
| Invalidates correspondent GPU objects and forces uploading of data to GPU. | |
| RenderResource & | operator= (RenderResource &&rr) |
| Move assignment operator. More... | |
| RenderResource (Type type) | |
| Constructor of RenderResource. More... | |
| RenderResource (RenderResource &&rr) | |
| Move constructor. More... | |
| Id | resourceId () const |
| Returns identifier of resource. More... | |
| Type | resourceType () const |
| Returns type of the resource. More... | |
| void | setExpiration (unsigned int seconds) |
| Set resource expiration time. More... | |
| void | setGeneration (int generation) |
| Sets generation for this resource. More... | |
| virtual | ~RenderResource () |
| Destructor of RenderResource. | |
Additional Inherited Members | |
Protected Member Functions inherited from Luminous::RenderResource | |
| RenderResource & | operator= (const RenderResource &rr) |
| Assignment operator. More... | |
| RenderResource (const RenderResource &rr) | |
| Copy constructor. More... | |
This class is an abstraction of a generic render target.
It provides an abstraction of the OpenGL FrameBufferObject API. GPU correspondent of this class is FrameBufferGL.
How FrameBuffer is bound. Determines what to do when target is bound.
| Enumerator | |
|---|---|
| BIND_DEFAULT |
Bind into both read and draw targets. |
| BIND_READ |
Bind only for read target. |
| BIND_DRAW |
Bind only for draw target. |
Type of FrameBuffer.
| Luminous::FrameBuffer::FrameBuffer | ( | FrameBufferType | type = NORMAL | ) |
Constructor of FrameBuffer.
| type | Type of the render target |
| Luminous::FrameBuffer::FrameBuffer | ( | const FrameBufferCopy & | rt | ) |
Construct render target from proxy object returned by one of copy functions.
| rt | FrameBufferCopy of the copied render target |
| Luminous::FrameBuffer::FrameBuffer | ( | FrameBuffer && | rt | ) |
Move constructor.
| rt | Render target to move |
| void Luminous::FrameBuffer::attach | ( | GLenum | attachment, |
| Luminous::Texture & | texture | ||
| ) |
| void Luminous::FrameBuffer::attach | ( | GLenum | attachment, |
| Luminous::RenderBuffer & | buffer | ||
| ) |
Attach a RenderBuffer to this render target.
| attachment | Attachment point (f. ex. GL_COLOR_ATTACHMENT0) |
| buffer | RenderBuffer to attach |
| Luminous::RenderBuffer& Luminous::FrameBuffer::createRenderBufferAttachment | ( | GLenum | attachment, |
| GLenum | storageFormat | ||
| ) |
Creates RenderBuffer and attaches it to given slot.
| attachment | Slot to attach newly created render buffer |
| storageFormat | Format of the render buffer to be created |
| Luminous::Texture& Luminous::FrameBuffer::createTextureAttachment | ( | GLenum | attachment, |
| const Luminous::PixelFormat & | format | ||
| ) |
Creates Texture and attaches it to given slot.
| attachment | Slot to attach newly created texture |
| format | Format of the texture to be created |
| FrameBufferCopy Luminous::FrameBuffer::deepCopy | ( | ) | const |
Deep copy creates an identical render target to the copied one.
Copied object has its own attachments whose values are copied from this.
| FrameBuffer& Luminous::FrameBuffer::operator= | ( | const FrameBufferCopy & | rt | ) |
Assign proxy object to render target.
| rt | FrameBufferCopy of the copied render target |
| FrameBuffer& Luminous::FrameBuffer::operator= | ( | FrameBuffer && | rt | ) |
| Luminous::RenderBuffer* Luminous::FrameBuffer::renderBuffer | ( | GLenum | attachment | ) | const |
Returns RenderBuffer attached for given slot.
If no render buffer is attached here returns nullptr.
| attachment | Attachment slot to be searched. |
| QList<GLenum> Luminous::FrameBuffer::renderBufferAttachments | ( | ) | const |
Returns list of attachments where RenderBuffer is used.
| unsigned Luminous::FrameBuffer::samples | ( | ) | const |
Number of samples if using multisampling.
Zero if multisampling is disabled.
| void Luminous::FrameBuffer::setSamples | ( | unsigned int | samples | ) |
Sets number of samples for multisampling.
Zero disables multisampling
| samples | Number of samples to take |
| void Luminous::FrameBuffer::setSize | ( | const Nimble::Size & | size | ) |
| void Luminous::FrameBuffer::setTargetBind | ( | FrameBufferBind | bind | ) |
Sets the binding type for this target.
| bind | How to bind this target. |
| FrameBufferCopy Luminous::FrameBuffer::shallowCopy | ( | ) | const |
Shallow copy with attachments.
The copied FrameBuffer will use the same render buffers and textures as attachments.
| FrameBufferCopy Luminous::FrameBuffer::shallowCopyNoAttachments | ( | ) | const |
Shallow copy without attachments.
Copes only target type, size and sampling options.
| const Nimble::Size& Luminous::FrameBuffer::size | ( | ) | const |
Size of the render target.
Each attachment has this as theirs size
| FrameBufferBind Luminous::FrameBuffer::targetBind | ( | ) | const |
Returns the current binding type for this target.
| FrameBufferType Luminous::FrameBuffer::targetType | ( | ) | const |
Returns type of this render target.
| Luminous::Texture* Luminous::FrameBuffer::texture | ( | GLenum | attachment | ) | const |
Returns Texture attached for given slot.
If no texture is attached here returns nullptr.
| attachment | Attachment slot to be searched. |
| QList<GLenum> Luminous::FrameBuffer::textureAttachments | ( | ) | const |
Returns list of attachments where Texture is used.