12 #ifndef MANAGEDMESH_H_6014714286 13 #define MANAGEDMESH_H_6014714286 62 const std::unique_ptr< Details > pimpl;
111 virtual bool controlsSameVideoResource(
const GeometryFeature& )
const override;
146 template<
typename VertexType,
typename IndexType >
150 const std::vector< VertexType > vertices;
151 const std::vector< IndexType > indices;
154 ,
const VertexType* vertices
155 ,
const std::size_t vertexCount
156 ,
const IndexType* indices
157 ,
const std::size_t indexCount );
174 (
unsigned int primitiveType
175 ,
const VertexType* vertices
176 ,
const std::size_t vertexCount
177 ,
const IndexType* indices
178 ,
const std::size_t indexCount );
183 template<
typename VertexType,
typename IndexType >
185 (
unsigned int primitiveType
186 ,
const VertexType* vertices
187 ,
const std::size_t vertexCount
188 ,
const IndexType* indices
189 ,
const std::size_t indexCount )
191 , vertices( vertices, vertices + vertexCount )
192 , indices ( indices, indices + indexCount )
197 template<
typename VertexType,
typename IndexType >
201 vb->
copy( &vertices.front(), vertices.size() );
206 template<
typename VertexType,
typename IndexType >
210 ib->
copy( &indices.front(), indices.size() );
215 template<
typename VertexType,
typename IndexType >
218 ,
const VertexType* vertices
219 ,
const std::size_t vertexCount
220 ,
const IndexType* indices
221 ,
const std::size_t indexCount )
232 #endif // MANAGEDMESH_H_6014714286 Specializes VertexBufferBase for particular VertexType.
void copy(const IndexType *indicesPtr, const std::size_t indicesCount)
Copies indicesCount indices referenced by indicesPtr to the maintained index buffer object...
ManagedMeshInterface ManagedInterface
Defines the type to be used for interfacing the video resource.
void copy(const Vertex *verticesPtr, const std::size_t verticesCount)
Copies verticesCount vertices referenced by verticesPtr to the maintained vertex buffer object...
IndexType Index
Holds the element type of the index buffer.
virtual VertexBufferBase * loadVertexBuffer() override
Creates OpenGL vertex buffer object and fills it with data.
Defines Carna::base::GeometryFeature.
Defines Carna::base::Mesh.
Represents "components" that are aggregated by Geometry objects. Closer description is given here...
Maintains GL_ARRAY_BUFFER object that holds vertices. This class realizes the RAII-idiom.
virtual IndexBufferBase * loadIndexBuffer() override
Creates OpenGL index buffer object and fills it with data.
Represents MeshBase object whose lifetime is managed by instances of this class. This is a format-ind...
Defines Carna::base::ManagedMeshInterface.
Interfaces the MeshBase that a ManagedMeshBase represents.
VertexType Vertex
Holds the element type of the vertex buffer.
Format-independent abstract Mesh base class. Each mesh consists of a VertexBuffer, an IndexBuffer and a vertex array. This class realizes the RAII-idiom w.r.t. the vertex array.
Specializes IndexBufferBase for particular IndexType.
Implements MeshBase class for particular VertexType and IndexType.
const unsigned int primitiveType
Holds the primitive type, like GL_TRIANGLES, that should be used when rendering this mesh...
std::vector< VertexAttribute > VertexAttributes
Defines VertexAttribute vector.
const VertexAttributes vertexAttributes
Holds the vertex format of the vertices contained by the vertex buffer.
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Maintains GL_ELEMENT_ARRAY_BUFFER object that holds the vertex indices, that interconnect the vertice...
static ManagedMesh< VertexType, IndexType > & create(unsigned int primitiveType, const VertexType *vertices, const std::size_t vertexCount, const IndexType *indices, const std::size_t indexCount)
Instantiates. Call release when you do not need the object any longer.