17 #ifndef MESHINSTANCE_H
18 #define MESHINSTANCE_H
104 void invalidateAttributes();
105 bool checkAttributes();
106 bool areAttributesReady()
const;
110 GLenum mMode = GL_TRIANGLES;
111 bool mAttributesInvalid =
true;
112 std::vector<int> mAttributeIndexes;
115 #endif // MESHINSTANCE_H
const MeshPtr & getMesh() const
Returns the current Mesh.
Definition: MeshInstance.h:62
static MeshInstancePtr createCompatibleMesh(int vertexCount, GLenum mode, const ShaderPtr &shader)
Creates a Mesh that contains all of the vertex Attributes in a given Shader, also creating a MeshInst...
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
GLenum getMode() const
Returns the GL primitive type to draw (i.e. GL_TRIANGLES).
Definition: MeshInstance.h:53
void setMesh(const MeshPtr &mesh)
Sets the current Mesh, rebinding vertex Attribute locations.
void bind()
Binds the Mesh, and its vertex attribute arrays to the attribute locations in this instance's Shader...
Mesh bound to a specific Shader.
Definition: MeshInstance.h:35
const ShaderPtr & getShader() const
Returns the current Shader to which the current Mesh is bound to.
Definition: MeshInstance.h:71
void setMode(GLenum value)
Sets the kind of GL primitive to draw.
std::shared_ptr< Shader > ShaderPtr
Shared pointer typedef for Shader.
Definition: PointerDeclarations.h:143
std::shared_ptr< MeshInstance > MeshInstancePtr
Shared pointer typedef for MeshInstance.
Definition: PointerDeclarations.h:113
std::shared_ptr< Mesh > MeshPtr
Shared pointer typedef for Mesh.
Definition: PointerDeclarations.h:103
void unbind()
Reverses a call to bind(), unbinding the Mesh and disabling vertex attribute arrays.
MeshInstance()
Construct an empty MeshInstance.
void setShader(const ShaderPtr &shader)
Sets the current shader, rebinding vertex Attribute locations.