KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
RendererAPI.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "glm/glm.hpp"
13#include "VertexArray.h"
14
15namespace Karma
16{
21 {
22 public:
26 enum class API
27 {
32 None = 0,
36 OpenGL = 1,
41 };
42
43 public:
49 virtual ~RendererAPI() {}
50
57 virtual void SetClearColor(const glm::vec4& color) = 0;
58
64 virtual void Clear() = 0;
65
72 virtual void BeginScene() = 0;
73
79 virtual void DrawIndexed(std::shared_ptr<VertexArray> vertexArray) = 0;
80
86 virtual void EndScene() = 0;
87
93 inline glm::vec4& GetClearColor() const { return m_ClearColor; }
94
100 inline static API GetAPI() { return s_API; }
101
102 private:
103 static API s_API;
104
105 protected:
106 // Need to see the utility
107 static glm::vec4 m_ClearColor;
108 };
109}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
@ None
Events of the unknown category.
Definition Event.h:35
@ Vulkan
Vulkan RHI interface type.
Definition KarmaRHI.h:30
This file contains the VertexArray class.
An abstract class for a renderer.
Definition RendererAPI.h:21
static API GetAPI()
Getter for rendering api being used.
Definition RendererAPI.h:100
virtual void Clear()=0
Clear the rendering screen.
glm::vec4 & GetClearColor() const
Getter for m_ClearColor variable.
Definition RendererAPI.h:93
API
The rendering API used by the Engine.
Definition RendererAPI.h:27
virtual void DrawIndexed(std::shared_ptr< VertexArray > vertexArray)=0
Routine for drawing primitives.
virtual void EndScene()=0
Instructions for end of the scene.
virtual ~RendererAPI()
A destructor.
Definition RendererAPI.h:49
virtual void BeginScene()=0
Setting up resources for rendering of a scene.
virtual void SetClearColor(const glm::vec4 &color)=0
Set the color to be used for clear (rendering) screen.