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>

Classes

struct  Command
 

Public Member Functions

 IYIRenderer ()
 
virtual ~IYIRenderer ()
 
virtual void SetScreenFrameBufferBinding (int32_t nFBO_ID=0)=0
 
virtual void SetFrontFaceWinding (CYIRenderSystem::YI_WINDING eWinding)=0
 
virtual void SetDepthTest (CYIRenderSystem::YI_DEPTH_TEST eTest)=0
 
virtual void SetBlendMode (CYIRenderSystem::YI_BLEND_MODE mode)=0
 
virtual void SetBlendColor (float fRed, float fGreen, float fBlue, float fAlpha)=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 ( )
inline
virtual IYIRenderer::~IYIRenderer ( )
inlinevirtual

Member Function Documentation

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.

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

Get the active shader program.

virtual void IYIRenderer::PopScreenClipping ( )
pure virtual

Pop the top-most clipping volume from the clipping stack

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

Push a screen-space clipping rectangle onto the clipping stack

virtual void IYIRenderer::PushScreenClippingDisabled ( )
pure virtual

Push a disabled clipping state onto the clipping stack

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.

virtual void IYIRenderer::SetBlendColor ( float  fRed,
float  fGreen,
float  fBlue,
float  fAlpha 
)
pure virtual

Set the blend color for use with constant blend functions.

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

Set the blend mode to one of YI_BLEND_MODE.

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

The default blend mode is YI_ALPHA_PREMULT

virtual void IYIRenderer::SetDepthTest ( CYIRenderSystem::YI_DEPTH_TEST  eTest)
pure virtual

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

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

virtual void IYIRenderer::SetFrontFaceWinding ( CYIRenderSystem::YI_WINDING  eWinding)
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 YI_COUNTER_CLOCKWISE

virtual void IYIRenderer::SetScreenFrameBufferBinding ( int32_t  nFBO_ID = 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: