#include <RenderTexture.hpp>
Definition at line 42 of file RenderTexture.hpp.
Color attachment slot
Enumerator |
---|
Depth |
Depth attachment slot.
|
Stencil |
Stencil attachment slot.
|
DepthStencil |
Depth-stencil attachment slot.
|
Color0 |
First color attachment slot.
|
__Count |
For internal functionality, do not use.
|
Definition at line 52 of file RenderTexture.hpp.
jop::RenderTexture::RenderTexture |
( |
| ) |
|
Constructor.
Doesn't initialize the frame buffer.
jop::RenderTexture::~RenderTexture |
( |
| ) |
|
|
override |
bool jop::RenderTexture::addCubemapAttachment |
( |
const Slot |
slot, |
|
|
const Texture::Format |
format |
|
) |
| |
Add a cube map attachment.
- Parameters
-
slot | The attachment slot |
format | The cube map format |
- Returns
- True if added successfully
bool jop::RenderTexture::addRenderbufferAttachment |
( |
const Slot |
slot, |
|
|
const Texture::Format |
format |
|
) |
| |
Add a render buffer attachment.
This will always return false when the size hasn't been set.
- Parameters
-
slot | The attachment slot |
format | The render buffer format |
- Returns
- True if added successfully
- See also
- getMaximumRenderbufferSize()
-
setSize()
bool jop::RenderTexture::addTextureAttachment |
( |
const Slot |
slot, |
|
|
const Texture::Format |
format |
|
) |
| |
Add a texture attachment.
This will always return false when the size hasn't been set.
- Parameters
-
slot | The attachment slot |
format | The texture format |
- Returns
- True if added successfully
- See also
- setSize()
bool jop::RenderTexture::bind |
( |
| ) |
const |
|
overridevirtual |
Bind this frame buffer for drawing.
- Returns
- True if successful
Implements jop::RenderTarget.
bool jop::RenderTexture::bindCubeFace |
( |
const Slot |
slot, |
|
|
const Cubemap::Face |
face |
|
) |
| const |
Bind cube map face.
- Note
- This will also bind the frame buffer object as the draw frame buffer
- Warning
- If the texture in the slot is not actually a cube map, but a regular 2D texture, it will be bound instead
- Parameters
-
slot | The attachment slot |
face | The cube map face to bind |
- Returns
- True if successful
bool jop::RenderTexture::bindDraw |
( |
| ) |
const |
Bind this frame buffer for drawing.
- Returns
- True if successful
bool jop::RenderTexture::bindRead |
( |
| ) |
const |
Bind this frame buffer for reading.
- Returns
- True if successful
void jop::RenderTexture::destroy |
( |
const bool |
framebuffer, |
|
|
const bool |
attachments |
|
) |
| |
Destroy this frame buffer.
- Parameters
-
framebuffer | Destroy the frame buffer object? |
attachments | Destroy the attachments? |
static unsigned int jop::RenderTexture::getMaximumRenderbufferSize |
( |
| ) |
|
|
static |
Get the maximum render buffer size.
- Returns
- The maximum render buffer size
glm::uvec2 jop::RenderTexture::getSize |
( |
| ) |
const |
|
overridevirtual |
Get the frame buffer texture size.
- Returns
- The size in pixels
Implements jop::RenderTarget.
Texture* jop::RenderTexture::getTextureAttachment |
( |
const Slot |
slot | ) |
|
Get a texture attachment.
- Parameters
-
- Returns
- Pointer to the texture. nullptr if none exists in the slot
const Texture* jop::RenderTexture::getTextureAttachment |
( |
const Slot |
slot | ) |
const |
Get a texture attachment.
- Parameters
-
- Returns
- Pointer to the texture. nullptr if none exists in the slot
bool jop::RenderTexture::isValid |
( |
| ) |
const |
Check if this frame buffer is valid.
- Returns
- True if valid
void jop::RenderTexture::setSize |
( |
const glm::uvec2 & |
size | ) |
|
Set the size for attachments.
Must be called before attempting to add attachments. Has no effect when already called once before destroy().
- Parameters
-
static void jop::RenderTexture::unbind |
( |
| ) |
|
|
static |
Unbind the currently bound draw frame buffer.
Rebinds the window as the frame buffer
The documentation for this class was generated from the following file: