You.i Engine
IYIRenderer Class Referenceabstract

Detailed Description

The renderer is responsible for interfacing with the graphics api on the target platform. Since the renderer is a low-level member of the You.i Engine framework, application developers are not expected to interface with it directly except in the most unique circumstances.

General purpose rendering needs can be met via CYISceneNode, CYIMesh, CYIMaterial, CYIRenderTarget, and the CYIAssetHardware (and subclasses).

#include <renderer/YiRenderer.h>


struct  Command

Public Member Functions

 IYIRenderer ()
virtual ~IYIRenderer ()
virtual void SetScreenFrameBufferBinding (int32_t fboID=0)=0
virtual void SetFrontFaceWinding (CYIRenderSystem::Winding winding)=0
virtual void SetDepthTest (CYIRenderSystem::DepthTest test)=0
virtual void SetBlendMode (CYIRenderSystem::BlendMode mode)=0
virtual void SetBlendColor (float red, float green, float blue, float alpha)=0
virtual void RenderNodes (const std::vector< Command > &renderList)=0
virtual const std::shared_ptr< IYIShaderProgram > & GetActiveShader () const =0
virtual void Draw (const std::shared_ptr< CYIMesh > &pMesh, const std::shared_ptr< CYIMaterial > &pMat, const std::shared_ptr< IYIUniformBufferObject > &pNodeProperties, const glm::mat4 *pModelMatrixOverride)=0
virtual void PushScreenClipping (const YI_RECT_REL &clipBox)=0
virtual void PushScreenClippingDisabled ()=0
virtual void PopScreenClipping ()=0

Constructor & Destructor Documentation

◆ IYIRenderer()

IYIRenderer::IYIRenderer ( )

◆ ~IYIRenderer()

virtual IYIRenderer::~IYIRenderer ( )

Member Function Documentation

◆ Draw()

virtual void IYIRenderer::Draw ( const std::shared_ptr< CYIMesh > &  pMesh,
const std::shared_ptr< CYIMaterial > &  pMat,
const std::shared_ptr< IYIUniformBufferObject > &  pNodeProperties,
const glm::mat4 *  pModelMatrixOverride 
pure virtual

Draw a mesh to the screen using the current shader program, the provided material, and the provided shader uniforms.

◆ GetActiveShader()

virtual const std::shared_ptr<IYIShaderProgram>& IYIRenderer::GetActiveShader ( ) const
pure virtual

Get the active shader program.

◆ PopScreenClipping()

virtual void IYIRenderer::PopScreenClipping ( )
pure virtual

Pop the top-most clipping volume from the clipping stack

◆ PushScreenClipping()

virtual void IYIRenderer::PushScreenClipping ( const YI_RECT_REL clipBox)
pure virtual

Push a screen-space clipping rectangle onto the clipping stack

◆ PushScreenClippingDisabled()

virtual void IYIRenderer::PushScreenClippingDisabled ( )
pure virtual

Push a disabled clipping state onto the clipping stack

◆ RenderNodes()

virtual void IYIRenderer::RenderNodes ( const std::vector< Command > &  renderList)
pure virtual

The renderer consumes a list of Command objects in order to do its rendering. This render list is built by the scene nodes and scene manager, for naive consumption here.

Each render action corresponds to an atomic rendering operation, such as rendering a mesh or changing a render target.

When debugging rendering related issues, the render list provided here should be scrutinized first to ensure that the instructions making it to the renderer are valid.

◆ SetBlendColor()

virtual void IYIRenderer::SetBlendColor ( float  red,
float  green,
float  blue,
float  alpha 
pure virtual

Set the blend color for use with constant blend functions.

◆ SetBlendMode()

virtual void IYIRenderer::SetBlendMode ( CYIRenderSystem::BlendMode  mode)
pure virtual

Set the blend mode to one of BlendMode.

Blending does not need to be enabled/disabled separately, You.i Engine will intelligently turn off blending if the user specifies BlendMode::None.

The default blend mode is YI_ALPHA_PREMULT

◆ SetDepthTest()

virtual void IYIRenderer::SetDepthTest ( CYIRenderSystem::DepthTest  test)
pure virtual

Set the depth test to be used when depth testing is enabled on a mesh. By default this is DepthTest::LessOrEqual

Depth testing is enabled/disabled per mesh via flags in CYIMesh.

◆ SetFrontFaceWinding()

virtual void IYIRenderer::SetFrontFaceWinding ( CYIRenderSystem::Winding  winding)
pure virtual

Set the triangle winding order that corresponds to front-facing polygons.

Winding can be either clockwise or counter-clockwise. This winding is determined by the order of vertices that are sent in to the renderer. Supposing three points A(-5,0), B(5,0) and C(0,5), triangle ABC would be wound clockwise and triangle ACB would be wound counter- clockwise.

By default this is Winding::CounterClockwise

◆ SetScreenFrameBufferBinding()

virtual void IYIRenderer::SetScreenFrameBufferBinding ( int32_t  fboID = 0)
pure virtual

Can be called from the platform to set the ID of the screen FBO.

This is used on iOS devices to reset the screen FBO to the ID of the GLKView. This can also be used by applications for an external FBO as a screen target, required for some VR SDKs.

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