NWengine 0.9
Loading...
Searching...
No Matches
Renderer Class Reference

The Renderer class is responsible for rendering GameObjects using a specified shader. More...

#include <Renderer.h>

Public Member Functions

 Renderer ()=default
 Default constructor for the Renderer class.
 
 Renderer (const std::string &shaderPath)
 Constructor for the Renderer class that takes a shader path as input.
 
 ~Renderer ()
 Destructor for the Renderer class.
 
Rendereroperator() (Renderer *renderer, bool captureOnDefaultFrame=0)
 Operator overload for adding a renderer as a decorator.
 
Rendereroperator() (bool captureOnDefaultFrame=0)
 Operator overload for adding a renderer as a decorator.
 
void DrawOnDefaultFrame ()
 Draws on the default framebuffer.
 
void CaptureOnCamFrame ()
 Captures on the camera framebuffer.
 
void Use ()
 Sets this renderer as the current renderer.
 
void Unuse ()
 Sets the default renderer as the current renderer. The default renderer is managed by the Core frontend or a custom one.
 
void SetShader (const std::string &shaderPath)
 Sets the shader for this renderer.
 
void SetUp ()
 Adds components to the componentContainer.
 

Static Public Member Functions

static void Init ()
 Initializes the default renderer.
 
static void Destroy ()
 Destroys the default renderer.
 
static std::string GetType ()
 Gets the type of the Renderer class.
 

Public Attributes

GameObject componentContainer = GameObject()
 The container for the GameObject components.
 
Cameratarget = nullptr
 The target camera for rendering.
 
fVec2 stretchCoeff = fVec2(1.0f, 1.0f)
 The stretch coefficients for rendering.
 

Static Public Attributes

static RendererdefaultRenderer = nullptr
 The default renderer.
 
static RenderercurrentRenderer = nullptr
 The current renderer.
 

Detailed Description

The Renderer class is responsible for rendering GameObjects using a specified shader.

Constructor & Destructor Documentation

◆ Renderer()

Renderer::Renderer ( const std::string & shaderPath)

Constructor for the Renderer class that takes a shader path as input.

Parameters
shaderPathThe path to the shader file.

Member Function Documentation

◆ GetType()

static std::string Renderer::GetType ( )
inlinestatic

Gets the type of the Renderer class.

Returns
The type of the Renderer class.

◆ operator()() [1/2]

Renderer * Renderer::operator() ( bool captureOnDefaultFrame = 0)

Operator overload for adding a renderer as a decorator.

Parameters
captureOnDefaultFrameBoolean indicating if the renderer should capture on the default framebuffer.
Returns
The modified renderer.

◆ operator()() [2/2]

Renderer * Renderer::operator() ( Renderer * renderer,
bool captureOnDefaultFrame = 0 )

Operator overload for adding a renderer as a decorator.

Parameters
rendererThe renderer to add as a decorator.
captureOnDefaultFrameBoolean indicating if the renderer should capture on the default framebuffer.
Returns
The modified renderer.

◆ SetShader()

void Renderer::SetShader ( const std::string & shaderPath)

Sets the shader for this renderer.

Parameters
shaderPathThe path to the shader file.

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