|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Container for a set of 2D triangle strip meshes stored on the GPU. More...
#include <GREM/graphics_2d/Model2D.hpp>
Classes | |
| struct | Vertex |
| Data layout for the attributes of a single vertex of a 2D model mesh. More... | |
| struct | Instance |
| Data layout for the attributes of a single instance of a 2D model mesh. More... | |
| struct | VertexShaderConstants |
| Struct of default vertex shader constants. More... | |
| struct | VertexShaderOutputs |
| Struct of fields output by the default vertex shader. More... | |
| struct | FragmentShaderConstants |
| Struct of default fragment shader constants. More... | |
| struct | FragmentShaderOutputs |
| Struct of fields output by the default fragment shader. More... | |
| struct | TextureParameters |
| Struct of shader parameters representing the texture of a 2D model. More... | |
| struct | Transformation3DParameters |
| Struct of shader fields representing the 3D transformation of a 2D model. More... | |
| struct | Node |
| Node of a 2D model. More... | |
Public Types | |
| using | Mesh = graphics::Mesh<Vertex, NoIndex, NoParameters, Instance> |
| Type of a single mesh of a 2D model. | |
| using | TextureBuffer = UniformBuffer<TextureParameters, "Model2DTexture"> |
| Shader buffer for 2D model texture parameters. | |
| using | Transformation3DBuffer = UniformBuffer<Transformation3DParameters, "Model2DTransformation3D"> |
| Shader buffer for 2D model 3D transformation parameters. | |
| template<typename Constants, typename Outputs, typename... ExtraBuffers> | |
| using | VertexShaderBase = graphics::VertexShader<Mesh, Constants, Outputs, Camera2D::ParameterBuffer, ExtraBuffers...> |
| Vertex shader for drawing 2D models. | |
| using | VertexShader = VertexShaderBase<VertexShaderConstants, VertexShaderOutputs> |
| Default vertex shader for drawing 2D models. | |
| template<typename Inputs, typename Constants, typename Outputs, typename... ExtraBuffers> | |
| using | FragmentShaderBase = graphics::FragmentShader<Mesh, Inputs, Constants, Outputs, Camera2D::ParameterBuffer, ExtraBuffers..., TextureBuffer> |
| Fragment shader for drawing 2D models. | |
| using | FragmentShader = FragmentShaderBase<VertexShaderOutputs, FragmentShaderConstants, FragmentShaderOutputs> |
| Default fragment shader type for drawing 2D models. | |
| using | ShaderPipeline = graphics::ShaderPipeline<Mesh> |
| Shader pipeline for drawing 2D models. | |
Public Member Functions | |
| Model2D () noexcept=default | |
| Construct an invalid model that must be reassigned before use. | |
| Model2D (Device &device, Renderer2D &renderer2D, ArrayList< Node > nodes) noexcept | |
| Construct a model from a list of nodes. | |
| Model2D (Device &device, Renderer2D &renderer2D, Span< const Vertex > vertices) | |
| Construct a model with a single mesh from a list of vertices. | |
| Span< const Node > | getNodes () const noexcept |
| Get the nodes of the model. | |
| Box< 2, float > | getBoundingBox () const noexcept |
| Get the local bounding box of the model. | |
| float | getBoundingRadius () const noexcept |
| Get the local bounding radius of the model. | |
Static Public Attributes | |
| static constexpr VertexShaderConstants | DEFAULT_VERTEX_SHADER_CONSTANTS {} |
| Default 2D model vertex shader constants. | |
| static constexpr FragmentShaderConstants | DEFAULT_FRAGMENT_SHADER_CONSTANTS {} |
| Default 2D model fragment shader constants. | |
| static constexpr ShaderPipelineOptions | DEFAULT_SHADER_PIPELINE_OPTIONS |
| Default 2D model graphics pipeline configuration. | |
Container for a set of 2D triangle strip meshes stored on the GPU.
Type of a single mesh of a 2D model.
| using grem::graphics::Model2D::TextureBuffer = UniformBuffer<TextureParameters, "Model2DTexture"> |
Shader buffer for 2D model texture parameters.
| using grem::graphics::Model2D::Transformation3DBuffer = UniformBuffer<Transformation3DParameters, "Model2DTransformation3D"> |
Shader buffer for 2D model 3D transformation parameters.
| using grem::graphics::Model2D::VertexShaderBase = graphics::VertexShader<Mesh, Constants, Outputs, Camera2D::ParameterBuffer, ExtraBuffers...> |
Vertex shader for drawing 2D models.
| Constants | user-defined aggregate type of external constants that are declared in the shader. |
| Outputs | user-defined aggregate type of fields that are declared in the shader and passed to the next pipeline stage. |
| ExtraBuffers | list of buffers that the shader reads from in addition to the required 2D model buffers. |
| using grem::graphics::Model2D::VertexShader = VertexShaderBase<VertexShaderConstants, VertexShaderOutputs> |
Default vertex shader for drawing 2D models.
| using grem::graphics::Model2D::FragmentShaderBase = graphics::FragmentShader<Mesh, Inputs, Constants, Outputs, Camera2D::ParameterBuffer, ExtraBuffers..., TextureBuffer> |
Fragment shader for drawing 2D models.
| Inputs | user-defined aggregate type of fields that are passed into the shader from the previous pipeline stage. |
| Constants | user-defined aggregate type of external constants that are declared in the shader. |
| Outputs | user-defined aggregate type of fields that are declared in the shader and passed to the next pipeline stage. |
| ExtraBuffers | list of buffers that the shader reads from in addition to the required 2D model buffers. |
| using grem::graphics::Model2D::FragmentShader = FragmentShaderBase<VertexShaderOutputs, FragmentShaderConstants, FragmentShaderOutputs> |
Default fragment shader type for drawing 2D models.
Shader pipeline for drawing 2D models.
|
defaultnoexcept |
Construct an invalid model that must be reassigned before use.
|
inlinenoexcept |
Construct a model from a list of nodes.
| device | device to create the model for. Must outlive the model. |
| renderer2D | renderer to create the model for. Must be associated with the given device. Must outlive the model. |
| nodes | nodes that define the model. Must not be empty. |
|
inline |
Construct a model with a single mesh from a list of vertices.
| device | device to create the model for. Must outlive the model. |
| renderer2D | renderer to create the model for. Must be associated with the given device. Must outlive the model. |
| vertices | vertices that define the mesh of the model. |
| graphics::Error | on failure to create the model. |
| 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. |
Get the nodes of the model.
|
inlinenodiscardnoexcept |
Get the local bounding box of the model.
|
inlinenodiscardnoexcept |
Get the local bounding radius of the model.
|
staticconstexpr |
Default 2D model vertex shader constants.
|
staticconstexpr |
Default 2D model fragment shader constants.
|
staticconstexpr |
Default 2D model graphics pipeline configuration.