You.i Engine
CYIRenderSystem Class Reference

Detailed Description

CYIRenderSystem is a singleton class used to acquire global instances of a number of classes.

CYIRenderSystem can be initialized by calling Init() which will create instances of all of the referenced classes. If GetInstance() is called without calling Init() then a nullptr pointer will be returned.

#include <renderer/YiRenderSystem.h>

Public Types

enum  BlendMode {
  BlendMode::None = 0,
  BlendMode::AlphaPreMultiplied = 1,
  BlendMode::AlphaErase = 2,
  BlendMode::AlphaPostMultiplied = 3,
  BlendMode::Additive = 4,
  BlendMode::Mask = 5,
  BlendMode::MaskApply = 6,
  BlendMode::EffectApply = 7,
  BlendMode::SourceOver = AlphaPreMultiplied,
  BlendMode::SourceIn = 8,
  BlendMode::SourceOut = 9,
  BlendMode::SourceAtop = 10,
  BlendMode::DestinationOver = 11,
  BlendMode::DestinationIn = 12,
  BlendMode::DestinationOut = 13,
  BlendMode::DestinationAtop = 14,
  BlendMode::Lighter = Additive,
  BlendMode::Copy = 15,
  BlendMode::Xor = 16,
  BlendMode::BlendModesCount
}
 
enum  DepthTest {
  DepthTest::Never = 0,
  DepthTest::Less,
  DepthTest::Equal,
  DepthTest::LessOrEqual,
  DepthTest::Greater,
  DepthTest::NotEqual,
  DepthTest::GreaterOrEqual,
  DepthTest::Always,
  DepthTest::DepthTestsCount
}
 
enum  StencilMode {
  StencilMode::Off = 0,
  StencilMode::GlobalMaskSet,
  StencilMode::GlobalMaskClear,
  StencilMode::Capture,
  StencilMode::CaptureNoOverlap,
  StencilMode::MaskInner,
  StencilMode::MaskOuter,
  StencilMode::MaskInnerAndReset,
  StencilMode::MaskOuterAndReset,
  StencilMode::StencilModesCount
}
 
enum  Winding {
  Winding::Clockwise = 0,
  Winding::CounterClockwise,
  Winding::WindingsCount
}
 
enum  CullFace {
  CullFace::None = 0,
  CullFace::Front,
  CullFace::Back,
  CullFace::CullFacesCount
}
 

Public Member Functions

virtual ~CYIRenderSystem ()
 
void SetScreenFrameBufferBinding ()
 
const CYICapabilitiesGetCapabilities () const
 
IYIMaterialFactoryGetMaterialFactory ()
 
CYIMeshFactoryGetMeshFactory ()
 
IYIBufferFactoryGetBufferFactory ()
 
IYIRendererGetSceneRenderer ()
 

Static Public Member Functions

static CYIRenderSystemGetInstance ()
 

Member Enumeration Documentation

◆ BlendMode

Control the alpha blending rules of the graphics API.

Enumerator
None 

No blending, result = src_color

AlphaPreMultiplied 

Pre-multiplied alpha, result = 1.0 * src_color + (1 - src_alpha) * dst_color

AlphaErase 

When layering You.i engine overtop of another surface, result.rgb = src_alpha * src_color + (1.0 - src_alpha) * dst_color. result.a = 1.0 - src_alpha

AlphaPostMultiplied 

Post-multiplied alpha, result = src_alpha * src_color + (1 - src_alpha) * dst_color

Additive 

Additive blending, result = src_color + dst_color

Mask 

Mask image, replace alpha, result = src_alpha + dst_color

MaskApply 

Post Mask image, result = (1 - dst_alpha) * src_color + dst_alpha * dst_color

EffectApply 

Apply effect layers, result = (LocalOpacity) * src_color + (1 - LocalOpacity) * dst_color

SourceOver 

Draws new color on top of the existing color.

SourceIn 

The new color is drawn only where both the new color and the destination color overlap. Everything else is made transparent.

SourceOut 

The new color is drawn where it doesn't overlap the existing color.

SourceAtop 

The new color is only drawn where it overlaps the existing color.

DestinationOver 

New colors are drawn behind the existing colors.

DestinationIn 

The existing color is kept where both the new color and existing color overlap. Everything else is made transparent.

DestinationOut 

The existing color is kept where it doesn't overlap the new color.

DestinationAtop 

The existing color is only kept where it overlaps the new color. The new color is drawn behind the existing color.

Lighter 

Where both colors overlap the color is determined by adding color values.

Copy 

Only the new color is shown.

Xor 

Colors are made transparent where both overlap and drawn normal everywhere else.

BlendModesCount 

◆ CullFace

Control the face culling rules of the graphics API

Enumerator
None 

Will disable face culling. Both front and back facing polygons will be visible.

Front 

Will cull the front-facing polygons.

Back 

Will cull the rear-facing polygons.

CullFacesCount 

◆ DepthTest

Control the depth testing rules of the graphics API

Enumerator
Never 

Never passes

Less 

Passes if the incoming depth value is less than the depth buffer value

Equal 

Passes if the incoming depth value is equal to the depth buffer value

LessOrEqual 

Passes if the incoming depth value is less than or equal to the depth buffer value

Greater 

Passes if the incoming depth value is greater than the depth buffer value

NotEqual 

Passes if the incoming depth value is not equal to the depth buffer value

GreaterOrEqual 

Passes if the incoming depth value is greater than or equal to the depth buffer value

Always 

Always passes, functionally equivalent to disabling the depth test, though costlier

DepthTestsCount 

◆ StencilMode

Control stencil operations of the graphics API

Enumerator
Off 

Disables any stencil operation (default). The stencil buffer won't be read and won't be written to.

GlobalMaskSet 

Enables writing to the current global mask. The writing is stencil-tested.

GlobalMaskClear 

Enables clearing from the current global mask. The writing is stencil-tested.

Capture 

Enables write operation to stencil buffer. Front faced triangles will increase the value, and back faced triangles will decrease the value, which can be use to add and remove parts in your stencil buffer. Overlapping geometry may increase/decrease multiple times. After you are done drawing your mask, you may apply the mask on your next draw using any of the YI_STENCIL_MASK below.

CaptureNoOverlap 

Enables write operation to stencil buffer. Front faced triangles will increase the value, and back faced triangles will decrease the value, which can be use to add and remove parts in your stencil buffer. Overlapping geometry will increment or decrement only once. After you are done drawing your mask, you may apply the mask on your next draw using any of the YI_STENCIL_MASK below.

MaskInner 

Applies the stencil to mask the inner part to all future draw operations. The stencil buffers is read-only.

MaskOuter 

Applies the stencil to mask the outer part all to all future draw operations. The stencil buffers is read-only.

MaskInnerAndReset 

Applies the stencil to mask the inner part to the next draw operation. After the draw operation, the affected area in the stencil buffer will be zeroized, essentially removing parts of the captured mask.

MaskOuterAndReset 

Applies the stencil to mask the outer part to the next draw operation. After the draw operation, the affected area in the stencil buffer will be zeroized, essentially removing parts of the captured mask.

StencilModesCount 

◆ Winding

Triangle winding enum for use with SetFrontFaceWinding

Enumerator
Clockwise 

Clockwise winding

CounterClockwise 

Counter-clockwise winding.

WindingsCount 

Constructor & Destructor Documentation

◆ ~CYIRenderSystem()

virtual CYIRenderSystem::~CYIRenderSystem ( )
virtual

Member Function Documentation

◆ GetBufferFactory()

IYIBufferFactory* CYIRenderSystem::GetBufferFactory ( )

The buffer factory is the entry point for the creation of platform-specific buffer objects, such as vertex and index buffers.

◆ GetCapabilities()

const CYICapabilities* CYIRenderSystem::GetCapabilities ( ) const

Returns a pointer to the CYICapabilities class.

◆ GetInstance()

static CYIRenderSystem* CYIRenderSystem::GetInstance ( )
static

Returns a pointer to the singleton class.

◆ GetMaterialFactory()

IYIMaterialFactory* CYIRenderSystem::GetMaterialFactory ( )

The material factory is the entry point for the creation of platform-specific objects related to materials, such as: textures, shaders, and related data.

◆ GetMeshFactory()

CYIMeshFactory* CYIRenderSystem::GetMeshFactory ( )

The mesh factory is the entry point for convenience functions related to mesh creation.

◆ GetSceneRenderer()

IYIRenderer* CYIRenderSystem::GetSceneRenderer ( )

Returns the platform-specific renderer.

◆ SetScreenFrameBufferBinding()

void CYIRenderSystem::SetScreenFrameBufferBinding ( )

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