GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Public Member Functions | Static Public Member Functions | Private Attributes
radix::Renderer Class Reference

Main renderer - handles sub-renderers and provides low level render functions. More...

#include <external/RadixEngine/include/radix/renderer/Renderer.hpp>

Data Structures

struct  Support
 

Public Member Functions

 Renderer (World &world)
 
void setViewport (Viewport *vp)
 
ViewportgetViewport () const
 
void init ()
 
void updateLights (Shader &shader)
 Initializes the lights in the world on the given shader. More...
 
void render ()
 Cycles through all the sub-renderers and calls their render function. More...
 
void renderText (RenderContext &rc, Text text)
 Renders a string to the screen using signed-distance field text rendering. More...
 
void renderMesh (RenderContext &rc, Shader &shader, Matrix4f &mdlMtx, const Mesh &mesh, const Material *mat=nullptr)
 Renders a mesh with the specified material and transform determined by the given modelMatrix. More...
 
void renderMesh (RenderContext &rc, Shader &shader, Matrix4f &mdlMtx, const Mesh &mesh, const Material &mat)
 
void addRenderer (SubRenderer &subRenderer)
 Add a renderer to the render queue. More...
 
void removeRenderer (SubRenderer &subRenderer)
 Remove a renderer from the render queue. More...
 

Static Public Member Functions

static Matrix4f getFrameView (const Matrix4f &src, const Matrix4f &in, const Matrix4f &out)
 
static Matrix4f getFrameView (const Matrix4f &src, const Transform &in, const Transform &out)
 
static bool clipViewFrame (const RenderContext &rc, const Mesh &frame, const Transform &frameTform, RectangleI &scissor)
 
static Matrix4f clipProjMat (const Entity &ent, const Matrix4f &view, const Matrix4f &proj)
 

Private Attributes

struct radix::Renderer::Support support
 
uint lightsUBO
 
Worldworld
 
Viewportviewport
 
RenderContext rc
 
TextRenderer textRenderer
 
std::vector< SubRenderer * > subRenderers
 
int vpWidth
 
int vpHeight
 

Detailed Description

Main renderer - handles sub-renderers and provides low level render functions.

This class is responsible for all rendering. You push all of your sub-renderers into a renderer stack, and those sub-renderers then get invoked by one main render function.

As well as that, it also provides low-level render functions to be used by specific renderers.

Constructor & Destructor Documentation

radix::Renderer::Renderer ( World world)
Parameters
worldThe world to render

Member Function Documentation

void radix::Renderer::addRenderer ( SubRenderer subRenderer)

Add a renderer to the render queue.

static Matrix4f radix::Renderer::clipProjMat ( const Entity ent,
const Matrix4f view,
const Matrix4f proj 
)
static
bool radix::Renderer::clipViewFrame ( const RenderContext rc,
const Mesh frame,
const Transform frameTform,
RectangleI scissor 
)
static
Matrix4f radix::Renderer::getFrameView ( const Matrix4f src,
const Matrix4f in,
const Matrix4f out 
)
static
static Matrix4f radix::Renderer::getFrameView ( const Matrix4f src,
const Transform in,
const Transform out 
)
inlinestatic
Viewport* radix::Renderer::getViewport ( ) const
inline
void radix::Renderer::init ( )
void radix::Renderer::removeRenderer ( SubRenderer subRenderer)

Remove a renderer from the render queue.

void radix::Renderer::render ( )

Cycles through all the sub-renderers and calls their render function.

void radix::Renderer::renderMesh ( RenderContext rc,
Shader shader,
Matrix4f mdlMtx,
const Mesh mesh,
const Material mat = nullptr 
)

Renders a mesh with the specified material and transform determined by the given modelMatrix.

Parameters
rcRenderContext
shaderShader to use to render the mesh
mdlMtxThe model matrix determining the position, rotation and scale of the mesh
meshThe mesh to render
matThe material to render the mesh with
void radix::Renderer::renderMesh ( RenderContext rc,
Shader shader,
Matrix4f mdlMtx,
const Mesh mesh,
const Material mat 
)
inline
void radix::Renderer::renderText ( RenderContext rc,
Text  text 
)

Renders a string to the screen using signed-distance field text rendering.

Parameters
textThe text to render
void radix::Renderer::setViewport ( Viewport vp)
inline
void radix::Renderer::updateLights ( Shader shader)

Initializes the lights in the world on the given shader.

Field Documentation

uint radix::Renderer::lightsUBO
private
RenderContext radix::Renderer::rc
private
std::vector<SubRenderer*> radix::Renderer::subRenderers
private
struct radix::Renderer::Support radix::Renderer::support
private
TextRenderer radix::Renderer::textRenderer
private
Viewport* radix::Renderer::viewport
private
int radix::Renderer::vpHeight
private
int radix::Renderer::vpWidth
private
World& radix::Renderer::world
private

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