Generic abstraction of a GPU vertex array object and its associated buffers.
More...
#include <donut/graphics/Mesh.hpp>
|
| Mesh (MeshBufferUsage verticesUsage, std::span< const Vertex > vertices) requires(!IS_INDEXED &&!IS_INSTANCED) |
| Constructor for meshes that only have a vertex buffer. More...
|
|
| Mesh (MeshBufferUsage verticesUsage, MeshBufferUsage indicesUsage, std::span< const Vertex > vertices, std::span< const Index > indices) requires(IS_INDEXED &&!IS_INSTANCED) |
| Constructor for meshes that have a vertex buffer and an index buffer. More...
|
|
| Mesh (MeshBufferUsage verticesUsage, MeshBufferUsage instancesUsage, std::span< const Vertex > vertices, std::span< const Instance > instances) requires(!IS_INDEXED &&IS_INSTANCED) |
| Constructor for meshes that have a vertex buffer and an instance buffer. More...
|
|
| Mesh (MeshBufferUsage verticesUsage, MeshBufferUsage indicesUsage, MeshBufferUsage instancesUsage, std::span< const Vertex > vertices, std::span< const Index > indices, std::span< const Instance > instances) requires(IS_INDEXED &&IS_INSTANCED) |
| Constructor for meshes that have a vertex buffer, an index buffer and an instance buffer. More...
|
|
void | setVertices (MeshBufferUsage verticesUsage, std::span< const Vertex > vertices) noexcept requires(!IS_INDEXED) |
| Set the contents of the vertex buffer. More...
|
|
void | setVertices (MeshBufferUsage verticesUsage, MeshBufferUsage indicesUsage, std::span< const Vertex > vertices, std::span< const Index > indices) noexcept requires(IS_INDEXED) |
| Set the contents of the vertex and index buffers. More...
|
|
Handle | getVertexBuffer () const noexcept |
| Get an opaque handle to the GPU representation of the vertex buffer. More...
|
|
Handle | getIndexBuffer () const noexcept requires(IS_INDEXED) |
| Get an opaque handle to the GPU representation of the index buffer. More...
|
|
Handle | getInstanceBuffer () const noexcept requires(IS_INSTANCED) |
| Get an opaque handle to the GPU representation of the instance buffer. More...
|
|
Handle | get () const noexcept |
| Get an opaque handle to the GPU representation of the vertex array. More...
|
|
template<typename Vertex, typename Index = NoIndex, typename Instance = NoInstance>
class donut::graphics::Mesh< Vertex, Index, Instance >
Generic abstraction of a GPU vertex array object and its associated buffers.
- Template Parameters
-
◆ Mesh() [1/4]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Constructor for meshes that only have a vertex buffer.
- Parameters
-
verticesUsage | intended access pattern of the vertex buffer, see MeshBufferUsage. |
vertices | initial data to copy into the vertex buffer. |
◆ Mesh() [2/4]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Constructor for meshes that have a vertex buffer and an index buffer.
- Parameters
-
verticesUsage | intended access pattern of the vertex buffer, see MeshBufferUsage. |
indicesUsage | intended access pattern of the index buffer, see MeshBufferUsage. |
vertices | initial data to copy into the vertex buffer. |
indices | initial data to copy into the index buffer. |
◆ Mesh() [3/4]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Constructor for meshes that have a vertex buffer and an instance buffer.
- Parameters
-
verticesUsage | intended access pattern of the vertex buffer, see MeshBufferUsage. |
instancesUsage | intended access pattern of the instance buffer, see MeshBufferUsage. |
vertices | initial data to copy into the vertex buffer. |
instances | initial data to copy into the instance buffer. |
◆ Mesh() [4/4]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Constructor for meshes that have a vertex buffer, an index buffer and an instance buffer.
- Parameters
-
verticesUsage | intended access pattern of the vertex buffer, see MeshBufferUsage. |
indicesUsage | intended access pattern of the index buffer, see MeshBufferUsage. |
instancesUsage | intended access pattern of the instance buffer, see MeshBufferUsage. |
vertices | initial data to copy into the vertex buffer. |
indices | initial data to copy into the index buffer. |
instances | initial data to copy into the instance buffer. |
◆ setVertices() [1/2]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Set the contents of the vertex buffer.
- Parameters
-
verticesUsage | new intended access pattern of the vertex buffer, see MeshBufferUsage. |
vertices | new data to copy into the vertex buffer. |
- Note
- The old contents of the buffer are discarded.
◆ setVertices() [2/2]
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Set the contents of the vertex and index buffers.
- Parameters
-
verticesUsage | new intended access pattern of the vertex buffer, see MeshBufferUsage. |
indicesUsage | new intended access pattern of the index buffer, see MeshBufferUsage. |
vertices | new data to copy into the vertex buffer. |
indices | new data to copy into the index buffer. |
- Note
- The old contents of the buffers are discarded.
◆ getVertexBuffer()
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Get an opaque handle to the GPU representation of the vertex buffer.
- Returns
- a non-owning resource handle to the GPU representation of the vertex buffer.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
◆ getIndexBuffer()
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Get an opaque handle to the GPU representation of the index buffer.
- Returns
- a non-owning resource handle to the GPU representation of the index buffer.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
◆ getInstanceBuffer()
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Get an opaque handle to the GPU representation of the instance buffer.
- Returns
- a non-owning resource handle to the GPU representation of the instance buffer.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
◆ get()
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Get an opaque handle to the GPU representation of the vertex array.
- Returns
- a non-owning resource handle to the GPU representation of the vertex array.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
◆ IS_INDEXED
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Tells if the mesh has an index buffer or not.
◆ IS_INSTANCED
template<typename Vertex , typename Index = NoIndex, typename Instance = NoInstance>
Tells if the mesh has an instance buffer or not.
The documentation for this class was generated from the following file: