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

An implementation of the RenderAPI for OpenGL. More...

#include <OpenGLRendererAPI.h>

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

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from Muto::RenderAPI
enum class  API { RAPI_None = 0 , RAPI_OpenGL = 1 }
 API that can be used by the Renderer. More...
 
- Static Public Member Functions inherited from Muto::RenderAPI
static API GetAPI ()
 Returns the current rendering API.
 

Detailed Description

An implementation of the RenderAPI for OpenGL.

Note
Should only be called by the RenderCommand class.

Member Function Documentation

◆ Clear()

void Muto::OpenGLRendererAPI::Clear ( )
overridevirtual

Clears the OpenGL rendering buffers.

Implements Muto::RenderAPI.

30 {
32
34 }
#define MU_PROFILE_FUNCTION()
Definition Instrumentor.h:240
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

◆ DrawIndexed()

void Muto::OpenGLRendererAPI::DrawIndexed ( const Ref< VertexArray > &  vertexArray,
uint32_t  indexCount = 0 
)
overridevirtual

Draws indexed geometry using the provided vertex array in OpenGL.

Implements Muto::RenderAPI.

37 {
39
40 uint32_t count = indexCount ? indexCount : vertexArray->GetIndexBuffer()->GetCount();
41 if (count == 0)
42 return;
43
44 vertexArray->Bind();
47 vertexArray->Unbind();
48 }

◆ Init()

void Muto::OpenGLRendererAPI::Init ( )
overridevirtual

Initializes the OpenGL rendering API.

Implements Muto::RenderAPI.

◆ SetClearColor()

void Muto::OpenGLRendererAPI::SetClearColor ( const glm::vec4 &  color)
overridevirtual

Sets the clear color for OpenGL.

Implements Muto::RenderAPI.

23 {
25
27 }

◆ SetViewport()

void Muto::OpenGLRendererAPI::SetViewport ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)
overridevirtual

Sets the viewport dimensions for OpenGL.

Implements Muto::RenderAPI.

16 {
18
20 }

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