KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
VertexArray.h
Go to the documentation of this file.
1
10#pragma once
11
14#include "Karma/Renderer/Mesh.h"
16
17namespace Karma
18{
23 {
24 public:
30 virtual ~VertexArray()
31 {
32 }
33
40 virtual void Bind() const = 0;
41
48 virtual void UnBind() const = 0;
49
50 // For legacy purposes. Use Mesh abstraction.
51 virtual void AddVertexBuffer(const std::shared_ptr<VertexBuffer>& vertexBuffer) = 0;
52 virtual void SetIndexBuffer(const std::shared_ptr<IndexBuffer>& indexBuffer) = 0;
53 virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers() const = 0;
54 virtual const IndexBuffer* GetIndexBuffer() const = 0;
55 // end legacy purpose context
56
63 virtual void SetMesh(std::shared_ptr<Mesh> mesh) = 0;
64
65 // For legacy purposes. Use Material abstraction.
66 virtual void SetShader(std::shared_ptr<Shader> shader) = 0;
67
76 virtual void SetMaterial(std::shared_ptr<Material> material) = 0;
77
84 virtual void UpdateProcessAndSetReadyForSubmission() const = 0;
85
86 // Getters
87 //virtual std::shared_ptr<Mesh> GetMesh() const = 0;
88
94 virtual std::shared_ptr<Material> GetMaterial() const = 0;
95
101 static VertexArray* Create();
102 };
103}
This file contains base classes for various kinds of buffers used by the Engine.
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the Material class.
This file contains the class Mesh and relevant data structures.
This file contains the Shader class.
An abstract class for index buffer.
Definition Buffer.h:313
A class, comprising of Mesh and Material substances along with relevant setup, for a renderable unit.
Definition VertexArray.h:23
virtual void Bind() const =0
For binding OpenGL vertex array object.
virtual ~VertexArray()
A destructor.
Definition VertexArray.h:30
virtual std::shared_ptr< Material > GetMaterial() const =0
Getter function for material.
virtual void UnBind() const =0
Undo what Bind does.
virtual void SetMaterial(std::shared_ptr< Material > material)=0
Sets the material.
static VertexArray * Create()
Create the VertexArray object based on the rendering API chosen by the programmer.
Definition VertexArray.cpp:8
virtual void SetMesh(std::shared_ptr< Mesh > mesh)=0
Sets the index and vertex buffers seperately.
virtual void UpdateProcessAndSetReadyForSubmission() const =0
Called each game loop for updating.