|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Persistent system that provides 2D rendering capabilities. More...
#include <GREM/graphics_2d/Renderer2D.hpp>
Public Types | |
| using | DefaultModel2DVertexShader = Model2D::VertexShader |
| Default vertex shader type for drawing 2D models. | |
| using | PlainModel2DFragmentShader = Model2D::FragmentShader |
| Default fragment shader type for drawing plain 2D models. | |
| using | TextModel2DFragmentShader = Model2D::FragmentShader |
| Default fragment shader type for drawing text. | |
| using | TonemappingModel2DFragmentShader = Model2D::FragmentShader |
| Default fragment shader type for tonemapping. | |
Public Member Functions | |
| Renderer2D (Device &device, const Renderer2DOptions &options={}) | |
| Construct a 2D renderer. | |
| ~Renderer2D () | |
| Destructor. | |
| Renderer2D (const Renderer2D &)=delete | |
| Copying a renderer is not allowed. | |
| Renderer2D (Renderer2D &&)=delete | |
| Moving a renderer is not allowed. | |
| Renderer2D & | operator= (const Renderer2D &)=delete |
| Copying a renderer is not allowed. | |
| Renderer2D & | operator= (Renderer2D &&)=delete |
| Moving a renderer is not allowed. | |
| template<typename... ExtraBuffers> | |
| void | drawFrame (RenderPass &renderPass, StridedSpan< const Instances2DView > instanceBatches, const Camera2D &camera, const ExtraBuffers &... extraBuffers) |
| Push the draw commands of a frame of 2D instance batches to a render pass. | |
| const Texture & | getInvisibleTexture2D () |
| Get the default invisible 2D texture. | |
| const Texture & | getInvisibleTexture2DArray () |
| Get the default invisible 2D array texture. | |
| const Texture & | getInvisibleTextureCube () |
| Get the default invisible cube texture. | |
| const Texture & | getInvisibleTextureCubeArray () |
| Get the default invisible cube array texture. | |
| const Texture & | getWhiteTexture2D () |
| Get the default white 2D texture. | |
| const Texture & | getWhiteTextureCube () |
| Get the default white cubemap texture. | |
| const Texture & | getFlatNormalTexture2D () |
| Get the default flat normal map 2D texture. | |
| const Texture & | getDefaultDepthTexture2D () |
| Get the default 2D depth texture. | |
| const Texture & | getDefaultDepthTexture2DArray () |
| Get the default 2D array depth texture. | |
| const Texture & | getDefaultDepthTextureCube () |
| Get the default cube depth texture. | |
| const Texture & | getDefaultDepthTextureCubeArray () |
| Get the default cube array depth texture. | |
| const Model2D::VertexShader & | getDefaultModel2DVertexShader () |
| Get the default 2D model vertex shader. | |
| const PlainModel2DFragmentShader & | getPlainModel2DFragmentShader () |
| Get the default plain 2D model fragment shader. | |
| const Model2D::ShaderPipeline & | getPlainModel2DShaderPipeline () |
| Get the default plain 2D model shader pipeline. | |
| const TextModel2DFragmentShader & | getTextModel2DFragmentShader () |
| Get the default text fragment shader. | |
| const Model2D::ShaderPipeline & | getTextModel2DShaderPipeline () |
| Get the default text shader pipeline. | |
| const TonemappingModel2DFragmentShader & | getTonemappingModel2DFragmentShader () |
| Get the default tonemapping fragment shader. | |
| const Model2D::ShaderPipeline & | getTonemappingModel2DShaderPipeline () |
| Get the default tonemapping shader pipeline. | |
| const Model2D & | getUnitSquareModel2D () const noexcept |
| Get the default 2D unit square model, which holds a single mesh that forms a square using a triangle strip of 2 triangles, consisting of 4 vertices in total with the following positions (and identical texture coordinates): | |
| const Model2D & | getUnitRightAngledTriangleModel2D () const noexcept |
| Get the default 2D unit right-angled triangle model, which holds a single mesh that forms a single triangle, consisting of 3 vertices in total with the following positions (and identical texture coordinates): | |
Persistent system that provides 2D rendering capabilities.
Default vertex shader type for drawing 2D models.
Default fragment shader type for drawing plain 2D models.
Default fragment shader type for drawing text.
Default fragment shader type for tonemapping.
|
explicit |
Construct a 2D renderer.
| device | device to create the renderer for. Must outlive the renderer. |
| options | initial configuration of the renderer, see Renderer2DOptions. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| grem::graphics::Renderer2D::~Renderer2D | ( | ) |
Destructor.
|
delete |
Copying a renderer is not allowed.
|
delete |
Moving a renderer is not allowed.
|
delete |
Copying a renderer is not allowed.
|
delete |
Moving a renderer is not allowed.
|
inline |
Push the draw commands of a frame of 2D instance batches to a render pass.
| renderPass | render pass to push the draw commands to. |
| instanceBatches | list of read-only views over the instance batches to draw. |
| camera | perspective to render the instances from. |
| extraBuffers | extra buffers required by the shaders used in the batch. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Get the default invisible 2D texture.
|
inlinenodiscard |
Get the default invisible 2D array texture.
|
inlinenodiscard |
Get the default invisible cube texture.
|
inlinenodiscard |
Get the default invisible cube array texture.
|
inlinenodiscard |
Get the default white 2D texture.
|
inlinenodiscard |
Get the default white cubemap texture.
|
inlinenodiscard |
Get the default flat normal map 2D texture.
|
inlinenodiscard |
Get the default 2D depth texture.
|
inlinenodiscard |
Get the default 2D array depth texture.
|
inlinenodiscard |
Get the default cube depth texture.
|
inlinenodiscard |
Get the default cube array depth texture.
|
nodiscard |
Get the default 2D model vertex shader.
|
nodiscard |
Get the default plain 2D model fragment shader.
|
inlinenodiscard |
Get the default plain 2D model shader pipeline.
|
nodiscard |
Get the default text fragment shader.
|
inlinenodiscard |
Get the default text shader pipeline.
|
nodiscard |
Get the default tonemapping fragment shader.
|
inlinenodiscard |
Get the default tonemapping shader pipeline.
|
inlinenodiscardnoexcept |
Get the default 2D unit square model, which holds a single mesh that forms a square using a triangle strip of 2 triangles, consisting of 4 vertices in total with the following positions (and identical texture coordinates):
|
inlinenodiscardnoexcept |
Get the default 2D unit right-angled triangle model, which holds a single mesh that forms a single triangle, consisting of 3 vertices in total with the following positions (and identical texture coordinates):