KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::VertexArray Class Referenceabstract

A class, comprising of Mesh and Material substances along with relevant setup, for a renderable unit. More...

#include <VertexArray.h>

Inheritance diagram for Karma::VertexArray:

Public Member Functions

virtual ~VertexArray ()
 A destructor.
 
virtual void Bind () const =0
 For binding OpenGL vertex array object.
 
virtual void UnBind () const =0
 Undo what Bind does.
 
virtual void AddVertexBuffer (const std::shared_ptr< VertexBuffer > &vertexBuffer)=0
 
virtual void SetIndexBuffer (const std::shared_ptr< IndexBuffer > &indexBuffer)=0
 
virtual const std::vector< std::shared_ptr< VertexBuffer > > & GetVertexBuffers () const =0
 
virtual const IndexBufferGetIndexBuffer () const =0
 
virtual void SetMesh (std::shared_ptr< Mesh > mesh)=0
 Sets the index and vertex buffers seperately.
 
virtual void SetShader (std::shared_ptr< Shader > shader)=0
 
virtual void SetMaterial (std::shared_ptr< Material > material)=0
 Sets the material.
 
virtual void UpdateProcessAndSetReadyForSubmission () const =0
 Called each game loop for updating.
 
virtual std::shared_ptr< MaterialGetMaterial () const =0
 Getter function for material.
 

Static Public Member Functions

static VertexArrayCreate ()
 Create the VertexArray object based on the rendering API chosen by the programmer.
 

Detailed Description

A class, comprising of Mesh and Material substances along with relevant setup, for a renderable unit.

Constructor & Destructor Documentation

◆ ~VertexArray()

virtual Karma::VertexArray::~VertexArray ( )
inlinevirtual

A destructor.

Since
Karma 1.0.0

Member Function Documentation

◆ Bind()

virtual void Karma::VertexArray::Bind ( ) const
pure virtual

For binding OpenGL vertex array object.

Todo
Seems only specific to OpenGL. Need to think the abstraction with Vulkan in mind
Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.

◆ Create()

VertexArray * Karma::VertexArray::Create ( )
static

Create the VertexArray object based on the rendering API chosen by the programmer.

Since
Karma 1.0.0

◆ GetIndexBuffer()

virtual const IndexBuffer * Karma::VertexArray::GetIndexBuffer ( ) const
pure virtual

Implemented in Karma::OpenGLVertexArray.

◆ GetMaterial()

virtual std::shared_ptr< Material > Karma::VertexArray::GetMaterial ( ) const
pure virtual

Getter function for material.

Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.

◆ GetVertexBuffers()

virtual const std::vector< std::shared_ptr< VertexBuffer > > & Karma::VertexArray::GetVertexBuffers ( ) const
pure virtual

Implemented in Karma::OpenGLVertexArray.

◆ SetMaterial()

virtual void Karma::VertexArray::SetMaterial ( std::shared_ptr< Material > material)
pure virtual

Sets the material.

Parameters
materialShader and texture setting
Todo
a seperate setting of shader may be redundant
Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.

◆ SetMesh()

virtual void Karma::VertexArray::SetMesh ( std::shared_ptr< Mesh > mesh)
pure virtual

Sets the index and vertex buffers seperately.

Parameters
meshA collection of index and vertex buffers to be set
Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.

◆ UnBind()

virtual void Karma::VertexArray::UnBind ( ) const
pure virtual

Undo what Bind does.

Todo
Again, need to think the abstraction
Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.

◆ UpdateProcessAndSetReadyForSubmission()

virtual void Karma::VertexArray::UpdateProcessAndSetReadyForSubmission ( ) const
pure virtual

Called each game loop for updating.

Note
includes uniform updation (vertex coordinates updation in shader by view and projection matrices)
Since
Karma 1.0.0

Implemented in Karma::OpenGLVertexArray, and Karma::VulkanVertexArray.


The documentation for this class was generated from the following files: