![]() |
Gorgon Game Engine
|
This is a frame buffer object that can be used for render to texture tasks. More...
Public Member Functions | |
| FrameBuffer () | |
| Does not perform any action, allows late generation of buffers. More... | |
| FrameBuffer (bool depth) | |
| Generates a frame buffer. More... | |
| FrameBuffer (const FrameBuffer &)=delete | |
| ~FrameBuffer () | |
| void | Destroy () |
| Destroys the frame buffer. More... | |
| void | Generate (bool depth) |
| Generates a frame buffer. More... | |
| Texture | GetTexture () const |
| Returns the texture of this buffer. More... | |
| bool | IsFunctional () const |
| Returns if the frame buffer is fully functional. More... | |
| bool | IsReady () const |
| Returns if the frame buffer ready. More... | |
| FrameBuffer & | operator= (const FrameBuffer &)=delete |
| void | RenderToScreen () |
| Stop using this buffer and render to screen instead. More... | |
| void | Use () |
| Begin using this frame buffer. More... | |
Static Public Member Functions | |
| static void | UpdateSizes () |
| Updates the size of all framebuffers. More... | |
Static Public Attributes | |
| static bool | HardwareSupport |
| Whether hardware supports frame buffers. More... | |
This is a frame buffer object that can be used for render to texture tasks.
This object cannot be copied.
|
delete |
| FrameBuffer | ( | ) |
Does not perform any action, allows late generation of buffers.
|
explicit |
Generates a frame buffer.
If software frame buffer does not work, this will create only a texture. Use UpdateTexture to update the texture. See Generate.
References FrameBuffer::Generate().
| ~FrameBuffer | ( | ) |
References FrameBuffer::Destroy().
| void Destroy | ( | ) |
Destroys the frame buffer.
References Gorgon::GL::DestroyTexture(), glDeleteFramebuffers, and glDeleteRenderbuffers.
| void Generate | ( | bool | depth | ) |
Generates a frame buffer.
If software frame buffer does not work, this will create only a texture. Use UpdateTexture to update the texture. This function will cause the system to switch to render to screen.
References Gorgon::GL::GenerateEmptyTexture(), Window::GetMinimumRequiredSize(), glBindFramebuffer, glBindRenderbuffer, glDrawBuffers, glFramebufferRenderbuffer, glFramebufferTexture2D, glGenFramebuffers, glGenRenderbuffers, glRenderbufferStorage, Gorgon::GL::log, and Gorgon::Graphics::RGBA.
| Texture GetTexture | ( | ) | const |
Returns the texture of this buffer.
| bool IsFunctional | ( | ) | const |
Returns if the frame buffer is fully functional.
References glBindFramebuffer.
| bool IsReady | ( | ) | const |
Returns if the frame buffer ready.
|
delete |
| void RenderToScreen | ( | ) |
Stop using this buffer and render to screen instead.
References Gorgon::GL::RenderToScreen().
|
static |
Updates the size of all framebuffers.
References Window::GetMinimumRequiredSize(), glBindRenderbuffer, glRenderbufferStorage, Gorgon::GL::ResizeTexture(), and Gorgon::Graphics::RGBA.
| void Use | ( | ) |
Begin using this frame buffer.
References glBindFramebuffer.
|
static |
Whether hardware supports frame buffers.
If it does not, using frame buffer has no effect. However, frame buffer will generate a screen sized texture keeping it updated with the screen resolution. Thus, even if operation is performed on software, it is still a good idea to use FrameBuffer class