libdonut  2.3.2
Application framework for cross-platform game development in C++20
Classes | Public Attributes | Static Public Attributes | List of all members
donut::graphics::TexturedQuad Struct Reference

Square 2D mesh for textured rendering. More...

#include <donut/graphics/TexturedQuad.hpp>

Classes

struct  Instance
 Data layout for the attributes of a single instance of the mesh. More...
 
struct  Vertex
 Data layout for the attributes of a single vertex of the mesh. More...
 

Public Attributes

Mesh< Vertex, NoIndex, Instancemesh {VERTICES_USAGE, INSTANCES_USAGE, VERTICES, {}}
 Mesh data stored on the GPU. More...
 

Static Public Attributes

static constexpr MeshBufferUsage VERTICES_USAGE = MeshBufferUsage::STATIC_DRAW
 Hint regarding the intended memory access pattern of the vertex buffer. More...
 
static constexpr MeshBufferUsage INSTANCES_USAGE = MeshBufferUsage::STREAM_DRAW
 Hint regarding the intended memory access pattern of the instance buffer. More...
 
static constexpr MeshPrimitiveType PRIMITIVE_TYPE = MeshPrimitiveType::TRIANGLE_STRIP
 The type of 3D primitives represented by the mesh vertices. More...
 
static constexpr std::array< Vertex, 4 > VERTICES
 The constant vertex data stored in the mesh. More...
 
static constexpr std::int32_t TEXTURE_UNIT = 0
 Main texture unit index to use in the shader. More...
 
static constexpr std::int32_t TEXTURE_UNIT_COUNT = 1
 Total number of texture units required to render a textured quad. More...
 

Detailed Description

Square 2D mesh for textured rendering.

The vertices of the mesh are stored on the GPU, together with an associated instance buffer set up for instanced rendering with a single texture.

Member Data Documentation

◆ VERTICES_USAGE

constexpr MeshBufferUsage donut::graphics::TexturedQuad::VERTICES_USAGE = MeshBufferUsage::STATIC_DRAW
staticconstexpr

Hint regarding the intended memory access pattern of the vertex buffer.

◆ INSTANCES_USAGE

constexpr MeshBufferUsage donut::graphics::TexturedQuad::INSTANCES_USAGE = MeshBufferUsage::STREAM_DRAW
staticconstexpr

Hint regarding the intended memory access pattern of the instance buffer.

◆ PRIMITIVE_TYPE

constexpr MeshPrimitiveType donut::graphics::TexturedQuad::PRIMITIVE_TYPE = MeshPrimitiveType::TRIANGLE_STRIP
staticconstexpr

The type of 3D primitives represented by the mesh vertices.

◆ VERTICES

constexpr std::array<Vertex, 4> donut::graphics::TexturedQuad::VERTICES
staticconstexpr
Initial value:
{{
{.coordinates{0.0f, 0.0f}},
{.coordinates{0.0f, 1.0f}},
{.coordinates{1.0f, 0.0f}},
{.coordinates{1.0f, 1.0f}},
}}

The constant vertex data stored in the mesh.

◆ TEXTURE_UNIT

constexpr std::int32_t donut::graphics::TexturedQuad::TEXTURE_UNIT = 0
staticconstexpr

Main texture unit index to use in the shader.

◆ TEXTURE_UNIT_COUNT

constexpr std::int32_t donut::graphics::TexturedQuad::TEXTURE_UNIT_COUNT = 1
staticconstexpr

Total number of texture units required to render a textured quad.

◆ mesh

Mesh<Vertex, NoIndex, Instance> donut::graphics::TexturedQuad::mesh {VERTICES_USAGE, INSTANCES_USAGE, VERTICES, {}}

Mesh data stored on the GPU.


The documentation for this struct was generated from the following file: