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
12#include "krpch.h"
13
16#include "Karma/Renderer/Mesh.h"
18
19namespace Karma
20{
25 {
26 public:
32 virtual ~VertexArray()
33 {
34 }
35
42 virtual void Bind() const = 0;
43
50 virtual void UnBind() const = 0;
51
52 // For legacy purposes. Use Mesh abstraction.
53 virtual void AddVertexBuffer(const std::shared_ptr<VertexBuffer>& vertexBuffer) = 0;
54 virtual void SetIndexBuffer(const std::shared_ptr<IndexBuffer>& indexBuffer) = 0;
55 virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers() const = 0;
56 virtual const IndexBuffer* GetIndexBuffer() const = 0;
57 // end legacy purpose context
58
65 virtual void SetMesh(std::shared_ptr<Mesh> mesh) = 0;
66
67 // For legacy purposes. Use Material abstraction.
68 virtual void SetShader(std::shared_ptr<Shader> shader) = 0;
69
78 virtual void SetMaterial(std::shared_ptr<Material> material) = 0;
79
86 virtual void UpdateProcessAndSetReadyForSubmission() const = 0;
87
88 // Getters
89 //virtual std::shared_ptr<Mesh> GetMesh() const = 0;
90
96 virtual std::shared_ptr<Material> GetMaterial() const = 0;
97
103 static VertexArray* Create();
104 };
105}
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:315
A class, comprising of Mesh and Material substances along with relevant setup, for a renderable unit.
Definition VertexArray.h:25
virtual void Bind() const =0
For binding OpenGL vertex array object.
virtual ~VertexArray()
A destructor.
Definition VertexArray.h:32
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:9
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.