KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::RenderCommand Class Reference

A class with static routines relevant for rendering a scene using RendererAPI. More...

#include <RenderCommand.h>

Static Public Member Functions

static void Init ()
 Initializing RenderCommand by creating the instance of appropriate RendererAPI Called in the main function at the moment.
 
static void DeInit ()
 Deinitialize RenderCommand by freeing up rendering resources.
 
static void SetClearColor (const glm::vec4 &color)
 Sets the background color of the screen.
 
static void Clear ()
 Clears the rendering screen.
 
static void BeginScene ()
 Setting up resources for rendering of a scene.
 
static void DrawIndexed (const std::shared_ptr< VertexArray > &vertexArray)
 Actually issue a draw call of primitives with indexed vertices.
 
static void EndScene ()
 The clearing of resources, if any, at the end of frame.
 
static glm::vec4 & GetClearColor ()
 Getter for the set clear color.
 
static RendererAPIGetRendererAPI ()
 Getter for the renderer API.
 

Detailed Description

A class with static routines relevant for rendering a scene using RendererAPI.

Member Function Documentation

◆ BeginScene()

static void Karma::RenderCommand::BeginScene ( )
inlinestatic

Setting up resources for rendering of a scene.

Usually the sequence for rendering frame goes like

Karma::RenderCommand::SetClearColor({ 0.0f, 0.0f, 0.0f, 1 });
KR_INFO("DeltaTime = {0} ms", deltaTime * 1000.0f);
m_SquareVA->UpdateProcessAndSetReadyForSubmission();
m_SquareVA->Bind();
#define KR_INFO(...)
A macro for logging information in the Client part.
Definition Log.h:117
static void Clear()
Clears the rendering screen.
Definition RenderCommand.h:58
static void SetClearColor(const glm::vec4 &color)
Sets the background color of the screen.
Definition RenderCommand.h:45
static void EndScene()
The clearing of resources, if any, at the end of frame.
Definition Renderer.cpp:12
static void BeginScene(std::shared_ptr< Scene > scene)
Setting up resources for rendering of a scene.
Definition Renderer.cpp:7
static void Submit(std::shared_ptr< Scene > scene)
Submitting a scene for rendering.
Definition Renderer.cpp:17
Since
Karma 1.0.0

◆ Clear()

static void Karma::RenderCommand::Clear ( )
inlinestatic

Clears the rendering screen.

Todo
Seems like VulkanRendererAPI is not using this function call for clearing.
Since
Karma 1.0.0

◆ DeInit()

void Karma::RenderCommand::DeInit ( )
static

Deinitialize RenderCommand by freeing up rendering resources.

Since
Karma 1.0.0

◆ DrawIndexed()

static void Karma::RenderCommand::DrawIndexed ( const std::shared_ptr< VertexArray > & vertexArray)
inlinestatic

Actually issue a draw call of primitives with indexed vertices.

For OpenGL the command is glDrawElements For Vulkan the command is vkCmdDrawIndexed

Parameters
vertexArrayThe mesh + material to be rendered
Since
Karma 1.0.0

◆ EndScene()

static void Karma::RenderCommand::EndScene ( )
inlinestatic

The clearing of resources, if any, at the end of frame.

Since
Karma 1.0.0

◆ GetClearColor()

static glm::vec4 & Karma::RenderCommand::GetClearColor ( )
inlinestatic

Getter for the set clear color.

Since
Karma 1.0.0

◆ GetRendererAPI()

static RendererAPI * Karma::RenderCommand::GetRendererAPI ( )
inlinestatic

Getter for the renderer API.

Since
Karma 1.0.0

◆ Init()

void Karma::RenderCommand::Init ( )
static

Initializing RenderCommand by creating the instance of appropriate RendererAPI Called in the main function at the moment.

See also
RendererAPI::API
Since
Karma 1.0.0

◆ SetClearColor()

static void Karma::RenderCommand::SetClearColor ( const glm::vec4 & color)
inlinestatic

Sets the background color of the screen.

Since
Karma 1.0.0

The documentation for this class was generated from the following files: