KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
RenderCommand.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "RendererAPI.h"
13
14namespace Karma
15{
20 {
21 public:
29 static void Init();
30
36 static void DeInit();
37
43 inline static void SetClearColor(const glm::vec4& color)
44 {
45 s_RendererAPI->SetClearColor(color);
46 }
47
56 inline static void Clear()
57 {
58 s_RendererAPI->Clear();
59 }
60
79 inline static void BeginScene()
80 {
81 s_RendererAPI->BeginScene();
82 }
83
94 inline static void DrawIndexed(const std::shared_ptr<VertexArray>& vertexArray)
95 {
96 s_RendererAPI->DrawIndexed(vertexArray);
97 }
98
104 static void EndScene()
105 {
106 s_RendererAPI->EndScene();
107 }
108
114 inline static glm::vec4& GetClearColor()
115 {
116 return s_RendererAPI->GetClearColor();
117 }
118
124 inline static RendererAPI* GetRendererAPI() { return s_RendererAPI; }
125
126 private:
127 static RendererAPI* s_RendererAPI;
128 };
129}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the class RendererAPI.
A class with static routines relevant for rendering a scene using RendererAPI.
Definition RenderCommand.h:20
static RendererAPI * GetRendererAPI()
Getter for the renderer API.
Definition RenderCommand.h:124
static void EndScene()
The clearing of resources, if any, at the end of frame.
Definition RenderCommand.h:104
static void DeInit()
Deinitialize RenderCommand by freeing up rendering resources.
Definition RenderCommand.cpp:30
static void Clear()
Clears the rendering screen.
Definition RenderCommand.h:56
static void DrawIndexed(const std::shared_ptr< VertexArray > &vertexArray)
Actually issue a draw call of primitives with indexed vertices.
Definition RenderCommand.h:94
static glm::vec4 & GetClearColor()
Getter for the set clear color.
Definition RenderCommand.h:114
static void Init()
Initializing RenderCommand by creating the instance of appropriate RendererAPI Called in the main fun...
Definition RenderCommand.cpp:9
static void BeginScene()
Setting up resources for rendering of a scene.
Definition RenderCommand.h:79
static void SetClearColor(const glm::vec4 &color)
Sets the background color of the screen.
Definition RenderCommand.h:43
An abstract class for a renderer.
Definition RendererAPI.h:21