Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::RenderAPI Class Referenceabstract

An abstract class defining the interface for a rendering API. More...

#include <RendererAPI.h>

Inheritance diagram for Muto::RenderAPI:
Muto::OpenGLRendererAPI

Public Types

enum class  API { RAPI_None = 0 , RAPI_OpenGL = 1 }
 API that can be used by the Renderer. More...
 

Public Member Functions

virtual void Clear ()=0
 Clears the rendering buffers.
 
virtual void DrawIndexed (const Ref< VertexArray > &vertexArray, uint32_t indexCount=0)=0
 Draws indexed geometry using the provided vertex array.
 
virtual void Init ()=0
 Initializes the rendering API.
 
virtual void SetClearColor (const glm::vec4 &color)=0
 Sets the clear color for the rendering API.
 
virtual void SetViewport (uint32_t x, uint32_t y, uint32_t width, uint32_t height)=0
 Sets the viewport dimensions.
 
virtual ~RenderAPI ()=default
 

Static Public Member Functions

static API GetAPI ()
 Returns the current rendering API.
 

Static Private Attributes

static API s_API = RenderAPI::API::RAPI_OpenGL
 

Detailed Description

An abstract class defining the interface for a rendering API.

Todo:

Add abstraction layers (similar to OpenGL) for Vulkan and DirectX and implement corresponding RenderAPI subclasses for each API.

Add NVRHI as an additional API for DirectX and Vulkan to simplify cross-platform rendering support.

Member Enumeration Documentation

◆ API

API that can be used by the Renderer.

Enumerator
RAPI_None 
RAPI_OpenGL 
21 {
22 RAPI_None = 0,
23 RAPI_OpenGL = 1,
24 };

Constructor & Destructor Documentation

◆ ~RenderAPI()

virtual Muto::RenderAPI::~RenderAPI ( )
virtualdefault

Member Function Documentation

◆ Clear()

virtual void Muto::RenderAPI::Clear ( )
pure virtual

Clears the rendering buffers.

Implemented in Muto::OpenGLRendererAPI.

Referenced by Muto::RenderCommand::Clear().

◆ DrawIndexed()

virtual void Muto::RenderAPI::DrawIndexed ( const Ref< VertexArray > &  vertexArray,
uint32_t  indexCount = 0 
)
pure virtual

Draws indexed geometry using the provided vertex array.

Implemented in Muto::OpenGLRendererAPI.

◆ GetAPI()

static API Muto::RenderAPI::GetAPI ( )
inlinestatic

Returns the current rendering API.

41{ return s_API; }
static API s_API
Definition RendererAPI.h:43

References s_API.

Referenced by Muto::Renderer::GetAPI().

◆ Init()

virtual void Muto::RenderAPI::Init ( )
pure virtual

Initializes the rendering API.

Implemented in Muto::OpenGLRendererAPI.

Referenced by Muto::RenderCommand::Init().

◆ SetClearColor()

virtual void Muto::RenderAPI::SetClearColor ( const glm::vec4 &  color)
pure virtual

Sets the clear color for the rendering API.

Implemented in Muto::OpenGLRendererAPI.

◆ SetViewport()

virtual void Muto::RenderAPI::SetViewport ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)
pure virtual

Sets the viewport dimensions.

Implemented in Muto::OpenGLRendererAPI.

Referenced by Muto::RenderCommand::SetViewport().

Member Data Documentation

◆ s_API

RenderAPI::API Muto::RenderAPI::s_API = RenderAPI::API::RAPI_OpenGL
staticprivate

Referenced by GetAPI().


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