Persistent system for rendering the batched draw commands of a RenderPass onto a Framebuffer, such as the user's screen.
More...
#include <donut/graphics/Renderer.hpp>
|
| Renderer (const RendererOptions &options={}) |
| Construct a renderer. More...
|
|
| ~Renderer () |
| Destructor. More...
|
|
| Renderer (const Renderer &)=delete |
| Copying a renderer is not allowed, since it manages global state. More...
|
|
| Renderer (Renderer &&)=delete |
| Moving a renderer is not allowed, since it manages global state. More...
|
|
Renderer & | operator= (const Renderer &)=delete |
| Copying a renderer is not allowed, since it manages global state. More...
|
|
Renderer | operator= (Renderer &&)=delete |
| Moving a renderer is not allowed, since it manages global state. More...
|
|
void | clearFramebufferDepth (Framebuffer &framebuffer) |
| Clear the depth buffer contents of a Framebuffer. More...
|
|
void | clearFramebufferColor (Framebuffer &framebuffer, Color color) |
| Clear the color contents of a Framebuffer. More...
|
|
void | clearFramebufferColorAndDepth (Framebuffer &framebuffer, Color color) |
| Clear the color and depth buffer contents of a Framebuffer. More...
|
|
void | render (Framebuffer &framebuffer, const RenderPass &renderPass, const Viewport &viewport, const Camera &camera, std::optional< Rectangle< int >> scissor={}) |
| Render the contents of a RenderPass to a Framebuffer. More...
|
|
Persistent system for rendering the batched draw commands of a RenderPass onto a Framebuffer, such as the user's screen.
An instance of this class should be kept throughout the lifetime of the application in order to continuously render the visual state of the latest frame produced through the application::Application::display() callback. It can also be used for smaller render jobs in the middle of a frame, such as copying a GPU Texture.
- See also
- RenderPass
- Examples
- example_game.cpp, and example_rectangle.cpp.
◆ Renderer() [1/3]
donut::graphics::Renderer::Renderer |
( |
const RendererOptions & |
options = {} | ) |
|
|
explicit |
Construct a renderer.
- Parameters
-
- Exceptions
-
File::Error | on failure to open a required resource file. |
graphics::Error | on failure to create or initialize a required GPU resource. |
std::bad_alloc | on allocation failure. |
◆ ~Renderer()
donut::graphics::Renderer::~Renderer |
( |
| ) |
|
◆ Renderer() [2/3]
donut::graphics::Renderer::Renderer |
( |
const Renderer & |
| ) |
|
|
delete |
Copying a renderer is not allowed, since it manages global state.
◆ Renderer() [3/3]
donut::graphics::Renderer::Renderer |
( |
Renderer && |
| ) |
|
|
delete |
Moving a renderer is not allowed, since it manages global state.
◆ operator=() [1/2]
Copying a renderer is not allowed, since it manages global state.
◆ operator=() [2/2]
Moving a renderer is not allowed, since it manages global state.
◆ clearFramebufferDepth()
void donut::graphics::Renderer::clearFramebufferDepth |
( |
Framebuffer & |
framebuffer | ) |
|
◆ clearFramebufferColor()
void donut::graphics::Renderer::clearFramebufferColor |
( |
Framebuffer & |
framebuffer, |
|
|
Color |
color |
|
) |
| |
◆ clearFramebufferColorAndDepth()
void donut::graphics::Renderer::clearFramebufferColorAndDepth |
( |
Framebuffer & |
framebuffer, |
|
|
Color |
color |
|
) |
| |
◆ render()
Render the contents of a RenderPass to a Framebuffer.
- Parameters
-
framebuffer | framebuffer to render to. |
renderPass | render pass to render from. |
viewport | rectangular region of the framebuffer to render inside of. |
camera | camera to render from. |
scissor | if set, specifies a rectangular region of the framebuffer outside of which any attempts to render a pixel will be discarded. |
- Note
- This function should typically be called at least once every frame during the application::Application::display() callback.
The documentation for this class was generated from the following file: