Carna
Version 3.0.1
|
Represents MeshBase object whose lifetime is managed by instances of this class. This is a format-independent abstract ManagedMesh base class. More...
#include <ManagedMesh.h>
Public Types | |
typedef ManagedMeshInterface | ManagedInterface |
Defines the type to be used for interfacing the video resource. | |
Public Member Functions | |
virtual bool | controlsSameVideoResource (const GeometryFeature &) const override |
Tells whether this instance maintains the same video resources like other. | |
virtual ManagedMeshInterface * | acquireVideoResource () override |
Acquires the video resources from this GeometryFeature by returning new instance of a class derived from ManagedInterface, that realizes the RAII idiom. Refer to its documentation for details. May return nullptr if this GeometryFeature does not provide any video resources. | |
![]() | |
unsigned int | videoResourceAcquisitionsCount () const |
Tells current number of video resource acquisitions. | |
void | release () |
Denotes that this object is no longer required and may be deleted as soon as it is valid to delete it. More... | |
void | addTo (Geometry &sceneGraphNode, unsigned int role) |
Puts this geometry feature on the sceneGraphNode. More... | |
void | removeFrom (Geometry &sceneGraphNode) |
Removes this geometry feature from the sceneGraphNode. More... | |
Public Attributes | |
const unsigned int | primitiveType |
Holds the primitive type, like GL_TRIANGLES , that should be used when rendering this mesh. | |
const VertexAttributes | vertexAttributes |
Holds the vertex format of the vertices contained by the vertex buffer. | |
Protected Member Functions | |
ManagedMeshBase (unsigned int primitiveType, const VertexAttributes &va) | |
Instantiates. | |
virtual | ~ManagedMeshBase () |
Deletes. | |
virtual VertexBufferBase * | loadVertexBuffer ()=0 |
Creates OpenGL vertex buffer object and fills it with data. | |
virtual IndexBufferBase * | loadIndexBuffer ()=0 |
Creates OpenGL index buffer object and fills it with data. | |
void | acquireMesh () |
Acquires mesh within current OpenGL context. | |
void | releaseMesh () |
Releases mesh within current OpenGL context. | |
const MeshBase & | mesh () const |
References mesh within current OpenGL context. | |
![]() | |
GeometryFeature () | |
Instantiates. | |
virtual | ~GeometryFeature () |
Deletes and logs an error if video resources are leaked. | |
Friends | |
class | GeometryFeature |
class | ManagedMeshInterface |
Represents MeshBase object whose lifetime is managed by instances of this class. This is a format-independent abstract ManagedMesh base class.
The class maintains one VertexBuffer and one IndexBuffer on an application level. The buffers are created the first time the mesh's video resources are acquired. The buffers are deleted when the last acquisition is released. The buffer instances are available across all OpenGL contexts.
The MeshBase class is only valid within the OpenGL context it was created within. Refer to the class documentation for an explanation.
Definition at line 56 of file ManagedMesh.h.
Documentation generated by Doxygen