Unique resource handle with exclusive ownership of a GPU framebuffer.
More...
#include <donut/graphics/Framebuffer.hpp>
|
class | TextureAttachment |
| Scope guard type representing an active texture attachment to a framebuffer that automatically detaches itself when destroyed. More...
|
|
Unique resource handle with exclusive ownership of a GPU framebuffer.
- Examples
- example_game.cpp, and example_rectangle.cpp.
◆ Framebuffer()
donut::graphics::Framebuffer::Framebuffer |
( |
| ) |
|
Create a new GPU framebuffer resource.
- Exceptions
-
◆ attachTexture2D()
Attach a 2D texture to the color attachment of the framebuffer for drawing to.
- Parameters
-
texture | the texture to attach. Must be a valid 2D texture with a framebuffer-compatible internal format, size and options. Otherwise, the behavior is unspecified. |
- Returns
- a scope guard representing the texture attachment. The attachment ends when the guard object is destroyed.
◆ get()
Handle donut::graphics::Framebuffer::get |
( |
| ) |
const |
|
inlinenoexcept |
Get an opaque handle to the GPU representation of the framebuffer.
- Returns
- a non-owning resource handle to the GPU representation of the framebuffer.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
The documentation for this class was generated from the following file: