Untitled Game engine no.5  1.0
Public Member Functions | List of all members
Engine::GLRenderer Class Reference

#include <GLRenderer.hpp>

Inheritance diagram for Engine::GLRenderer:
Inheritance graph
[legend]
Collaboration diagram for Engine::GLRenderer:
Collaboration graph
[legend]

Public Member Functions

 ~GLRenderer ()
 Destructor.
 
void Init () override
 sets up the renderer
 
void Shutdown () override
 Shutdown the render api.
 
void SetClearColor (uint32_t c) override
 
void Clear () override
 Clear the screen.
 
void Submit (const std::string &tag, const Ref< Transform > &transform, const Ref< MeshRenderer > &renderer) override
 
float AddTexture (const Ref< Texture > &texture)
 
void AddTag (const std::string &name, RenderTag tag, ViewProjection projection=ViewProjection::PROJECTION) override
 Adds a rendering step to the Flush cycle. More...
 
void Flush () override
 
- Public Member Functions inherited from Engine::Renderer
virtual void SetClearColor (unsigned int c)=0
 

Additional Inherited Members

- Public Types inherited from Engine::Renderer
enum  API { None = 0, OpenGL = 1 }
 Rendering system api enumeration.
 
- Static Public Member Functions inherited from Engine::Renderer
static API GetAPI ()
 Get the current api we are using.
 
static Uni< RendererCreate ()
 Create the render API.
 

Detailed Description

Wrapper to facilitate management of OpenGL rendering data.

Member Function Documentation

◆ AddTag()

void Engine::GLRenderer::AddTag ( const std::string &  name,
RenderTag  tag,
ViewProjection  projection = ViewProjection::PROJECTION 
)
overridevirtual

Adds a rendering step to the Flush cycle.

Parameters
namekey string of the rendering step
tagshader vertex data
projectionthe type of projection to use for the render step

Implements Engine::Renderer.

◆ AddTexture()

float Engine::GLRenderer::AddTexture ( const Ref< Texture > &  texture)

Add a texture to the render sampler lookup.

Parameters
texturetexture reference
Returns
the index in the sampler lookup

◆ Flush()

void Engine::GLRenderer::Flush ( )
overridevirtual

Draw the elements to the screen.

TODO: (assumes each draw is a quad) so for 4 verts / 4 * 6 is 6 calls this is to prevent overlapping draws

Implements Engine::Renderer.

◆ SetClearColor()

void Engine::GLRenderer::SetClearColor ( uint32_t  c)
override

Set the color for the background whenever the color is cleared.

◆ Submit()

void Engine::GLRenderer::Submit ( const std::string &  tag,
const Ref< Transform > &  transform,
const Ref< MeshRenderer > &  renderer 
)
overridevirtual

Submit an object to the render queue right now it draw it right away

Parameters
meshto draw
transformlocation to draw at

Implements Engine::Renderer.


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