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 "krpch.h"
13
14#include "glm/glm.hpp"
15#include "VertexArray.h"
16
17namespace Karma
18{
23 {
24 public:
28 enum class API
29 {
34 None = 0,
38 OpenGL = 1,
43 };
44
45 public:
51 virtual ~RendererAPI() {}
52
59 virtual void SetClearColor(const glm::vec4& color) = 0;
60
66 virtual void Clear() = 0;
67
74 virtual void BeginScene() = 0;
75
81 virtual void DrawIndexed(std::shared_ptr<VertexArray> vertexArray) = 0;
82
88 virtual void EndScene() = 0;
89
95 inline glm::vec4& GetClearColor() const { return m_ClearColor; }
96
102 inline static API GetAPI() { return s_API; }
103
104 private:
105 static API s_API;
106
107 protected:
108 // Need to see the utility
109 static glm::vec4 m_ClearColor;
110 };
111}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the VertexArray class.
An abstract class for a renderer.
Definition RendererAPI.h:23
static API GetAPI()
Getter for rendering api being used.
Definition RendererAPI.h:102
virtual void Clear()=0
Clear the rendering screen.
glm::vec4 & GetClearColor() const
Getter for m_ClearColor variable.
Definition RendererAPI.h:95
API
The rendering API used by the Engine.
Definition RendererAPI.h:29
@ Vulkan
Vulkan (https://www.vulkan.org)
Definition RendererAPI.h:42
@ None
No rendering.
Definition RendererAPI.h:34
@ OpenGL
OpenGL (https://www.opengl.org)
Definition RendererAPI.h:38
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:51
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.