|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Batch of instances to be drawn in a Renderer2D frame. More...
#include <GREM/graphics_2d/Instances2D.hpp>
Public Member Functions | |
| Instances2D (Device &device, Renderer2D &renderer2D) | |
| Construct a batch of instances. | |
| void | clear () |
| Clear the batch of all instances. | |
| void | putModelInstance (const Model2D &model, const ModelInstance2D &instance) |
| Add a 2D model instance to be rendered using a plain 2D model shader. | |
| void | putShadedModelInstance (const Model2D::ShaderPipeline &shaderPipeline, const Model2D &model, const ModelInstance2D &instance) |
| Add a 2D model instance to be rendered using a specific shader pipeline. | |
| void | putTriangleInstance (const TriangleInstance2D &instance) |
| Add a triangle instance to be rendered using a plain 2D model shader. | |
| void | putShadedTriangleInstance (const Model2D::ShaderPipeline &shaderPipeline, const TriangleInstance2D &instance) |
| Add a triangle instance to be rendered using a specific shader pipeline. | |
| void | putQuadInstance (const QuadInstance2D &instance) |
| Add a quad instance to be rendered using a plain 2D model shader. | |
| void | putShadedQuadInstance (const Model2D::ShaderPipeline &shaderPipeline, const QuadInstance2D &instance) |
| Add a quad instance to be rendered using a specific shader pipeline. | |
| void | putRectangleInstance (const RectangleInstance2D &instance) |
| Add a rectangle instance to be rendered using a plain 2D model shader. | |
| void | putShadedRectangleInstance (const Model2D::ShaderPipeline &shaderPipeline, const RectangleInstance2D &instance) |
| Add a rectangle instance to be rendered using a specific shader pipeline. | |
| void | putImageInstance (const Texture &texture, const ImageInstance2D &instance={}) |
| Add an image instance to be rendered using a plain 2D model shader. | |
| void | putShadedImageInstance (const Model2D::ShaderPipeline &shaderPipeline, const Texture &texture, const ImageInstance2D &instance={}) |
| Add an image instance to be rendered using a specific shader pipeline. | |
| void | putSpriteInstance (const SpriteAtlas &spriteAtlas, SpriteID spriteID, const SpriteInstance2D &instance) |
| Add a sprite instance to be rendered using a plain 2D model shader. | |
| void | putShadedSpriteInstance (const Model2D::ShaderPipeline &shaderPipeline, const SpriteAtlas &spriteAtlas, SpriteID spriteID, const SpriteInstance2D &instance) |
| Add a sprite instance to be rendered using a specific shader pipeline. | |
| void | putTextInstance (const Text2D &text, const TextInstance2D &instance) |
| Add a 2D text instance to be rendered using a plain 2D text shader. | |
| void | putShadedTextInstance (const Model2D::ShaderPipeline &shaderPipeline, const Text2D &text, const TextInstance2D &instance) |
| Add a text instance to be rendered using a specific shader pipeline. | |
| void | putTextStringInstance (Font2D &font, UTF8StringView string, const TextStringInstance2D &instance) |
| Add a 2D text string instance to be rendered using a plain 2D text shader. | |
| void | putShadedTextStringInstance (const Model2D::ShaderPipeline &shaderPipeline, Font2D &font, UTF8StringView string, const TextStringInstance2D &instance) |
| Add a 2D text string instance to be rendered using a specific shader pipeline. | |
| void | putTextStringInstance (Font2D &font, StringView string, const TextStringInstance2D &instance) |
| Add a 2D text string instance to be rendered using a plain 2D text shader. | |
| void | putShadedTextStringInstance (const Model2D::ShaderPipeline &shaderPipeline, Font2D &font, StringView string, const TextStringInstance2D &instance) |
| Add a 2D text string instance to be rendered using a specific shader pipeline. | |
Batch of instances to be drawn in a Renderer2D frame.
|
inline |
Construct a batch of instances.
| device | device to create the batch for. Must outlive the batch. |
| renderer2D | renderer to create the batch for. Must be associated with the given device. Must outlive 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. |
|
inline |
Clear the batch of all instances.
| 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. |
| void grem::graphics::Instances2D::putModelInstance | ( | const Model2D & | model, |
| const ModelInstance2D & | instance ) |
Add a 2D model instance to be rendered using a plain 2D model shader.
| model | model to draw. |
| instance | configuration of the model instance to draw, see ModelInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedModelInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const Model2D & | model, | ||
| const ModelInstance2D & | instance ) |
Add a 2D model instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the model with. |
| model | model to draw. |
| instance | configuration of the model instance to draw, see ModelInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putTriangleInstance | ( | const TriangleInstance2D & | instance | ) |
Add a triangle instance to be rendered using a plain 2D model shader.
| instance | configuration of the triangle instance to draw, see TriangleInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedTriangleInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const TriangleInstance2D & | instance ) |
Add a triangle instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the triangle with. |
| instance | configuration of the triangle instance to draw, see TriangleInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putQuadInstance | ( | const QuadInstance2D & | instance | ) |
Add a quad instance to be rendered using a plain 2D model shader.
| instance | configuration of the quad instance to draw, see QuadInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedQuadInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const QuadInstance2D & | instance ) |
Add a quad instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the quad with. |
| instance | configuration of the quad instance to draw, see QuadInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putRectangleInstance | ( | const RectangleInstance2D & | instance | ) |
Add a rectangle instance to be rendered using a plain 2D model shader.
| instance | configuration of the rectangle instance to draw, see RectangleInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedRectangleInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const RectangleInstance2D & | instance ) |
Add a rectangle instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the rectangle with. |
| instance | configuration of the rectangle instance to draw, see RectangleInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putImageInstance | ( | const Texture & | texture, |
| const ImageInstance2D & | instance = {} ) |
Add an image instance to be rendered using a plain 2D model shader.
| texture | texture of the image to draw. Must be a valid 2D texture. |
| instance | configuration of the image instance to draw, see ImageInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedImageInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const Texture & | texture, | ||
| const ImageInstance2D & | instance = {} ) |
Add an image instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the texture with. |
| texture | texture of the image to draw. Must be a valid 2D texture. |
| instance | configuration of the image instance to draw, see ImageInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putSpriteInstance | ( | const SpriteAtlas & | spriteAtlas, |
| SpriteID | spriteID, | ||
| const SpriteInstance2D & | instance ) |
Add a sprite instance to be rendered using a plain 2D model shader.
| spriteAtlas | sprite atlas to fetch the sprite image from. |
| spriteID | identifier of the sprite in the atlas to draw. Must be a valid sprite identifier obtained from the given atlas. |
| instance | configuration of the sprite instance to draw, see SpriteInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedSpriteInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const SpriteAtlas & | spriteAtlas, | ||
| SpriteID | spriteID, | ||
| const SpriteInstance2D & | instance ) |
Add a sprite instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the sprite with. |
| spriteAtlas | sprite atlas to fetch the sprite image from. |
| spriteID | identifier of the sprite in the atlas to draw. Must be a valid sprite identifier obtained from the given atlas. |
| instance | configuration of the sprite instance to draw, see SpriteInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putTextInstance | ( | const Text2D & | text, |
| const TextInstance2D & | instance ) |
Add a 2D text instance to be rendered using a plain 2D text shader.
| text | shaped text to draw. |
| instance | configuration of the text instance to draw, see TextInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedTextInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| const Text2D & | text, | ||
| const TextInstance2D & | instance ) |
Add a text instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the text with. |
| text | shaped text to draw. |
| instance | configuration of the text instance to draw, see TextInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putTextStringInstance | ( | Font2D & | font, |
| UTF8StringView | string, | ||
| const TextStringInstance2D & | instance ) |
Add a 2D text string instance to be rendered using a plain 2D text shader.
| font | font from which to shape the text. |
| string | UTF-8-encoded string to shape the text from. |
| instance | configuration of the text string instance to draw, see TextStringInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedTextStringInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| Font2D & | font, | ||
| UTF8StringView | string, | ||
| const TextStringInstance2D & | instance ) |
Add a 2D text string instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the text with. |
| font | font from which to shape the text. |
| string | UTF-8-encoded string to shape the text from. |
| instance | configuration of the text string instance to draw, see TextStringInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putTextStringInstance | ( | Font2D & | font, |
| StringView | string, | ||
| const TextStringInstance2D & | instance ) |
Add a 2D text string instance to be rendered using a plain 2D text shader.
| font | font from which to shape the text. |
| string | string to shape the text from, which will be interpreted as being UTF-8-encoded. |
| instance | configuration of the text string instance to draw, see TextStringInstance2D. |
| 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. |
| void grem::graphics::Instances2D::putShadedTextStringInstance | ( | const Model2D::ShaderPipeline & | shaderPipeline, |
| Font2D & | font, | ||
| StringView | string, | ||
| const TextStringInstance2D & | instance ) |
Add a 2D text string instance to be rendered using a specific shader pipeline.
| shaderPipeline | shader pipeline to render the text with. |
| font | font from which to shape the text. |
| string | string to shape the text from, which will be interpreted as being UTF-8-encoded. |
| instance | configuration of the text string instance to draw, see TextStringInstance2D. |
| 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. |