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  YI_BLEND_MODE {
  YI_NONE = 0,
  YI_ALPHA_PREMULT = 1,
  YI_ALPHA_ERASE = 2,
  YI_ALPHA_POSTMULT = 3,
  YI_ADDITIVE = 4,
  YI_MASK = 5,
  YI_MASK_APPLY = 6,
  YI_EFFECT_APPLY = 7,
  YI_SOURCE_OVER = YI_ALPHA_PREMULT,
  YI_SOURCE_IN = 8,
  YI_SOURCE_OUT = 9,
  YI_SOURCE_ATOP = 10,
  YI_DESTINATION_OVER = 11,
  YI_DESTINATION_IN = 12,
  YI_DESTINATION_OUT = 13,
  YI_DESTINATION_ATOP = 14,
  YI_LIGHTER = YI_ADDITIVE,
  YI_COPY = 15,
  YI_XOR = 16,
  YI_BLEND_MODE_COUNT
}
 
enum  YI_DEPTH_TEST {
  YI_NEVER,
  YI_LESS,
  YI_EQUAL,
  YI_LESS_EQUAL,
  YI_GREATER,
  YI_NOT_EQUAL,
  YI_GREATER_EQUAL,
  YI_ALWAYS,
  YI_DEPTH_TEST_COUNT
}
 
enum  YI_STENCIL_MODE {
  YI_STENCIL_OFF,
  YI_GLOBAL_MASK_SET,
  YI_GLOBAL_MASK_CLEAR,
  YI_STENCIL_CAPTURE,
  YI_STENCIL_CAPTURE_NO_OVERLAP,
  YI_STENCIL_MASK_INNER,
  YI_STENCIL_MASK_OUTER,
  YI_STENCIL_MASK_INNER_AND_RESET,
  YI_STENCIL_MASK_OUTER_AND_RESET,
  YI_STENCIL_MODE_COUNT
}
 
enum  YI_WINDING {
  YI_CLOCKWISE,
  YI_COUNTER_CLOCKWISE,
  YI_WINDING_COUNT
}
 
enum  YI_CULL_FACE {
  YI_FRONT,
  YI_BACK,
  YI_CULL_NONE,
  YI_CULL_FACE_COUNT
}
 

Public Member Functions

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

Static Public Member Functions

static CYIRenderSystemGetInstance ()
 

Member Enumeration Documentation

Control the alpha blending rules of the graphics API.

Enumerator
YI_NONE 

No blending, result = src_color

YI_ALPHA_PREMULT 

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

YI_ALPHA_ERASE 

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

YI_ALPHA_POSTMULT 

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

YI_ADDITIVE 

Additive blending, result = src_color + dst_color

YI_MASK 

Mask image, replace alpha, result = src_alpha + dst_color

YI_MASK_APPLY 

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

YI_EFFECT_APPLY 

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

YI_SOURCE_OVER 

Draws new color on top of the existing color.

YI_SOURCE_IN 

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

YI_SOURCE_OUT 

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

YI_SOURCE_ATOP 

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

YI_DESTINATION_OVER 

New colors are drawn behind the existing colors.

YI_DESTINATION_IN 

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

YI_DESTINATION_OUT 

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

YI_DESTINATION_ATOP 

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

YI_LIGHTER 

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

YI_COPY 

Only the new color is shown.

YI_XOR 

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

YI_BLEND_MODE_COUNT 

Control the face culling rules of the graphics API

Enumerator
YI_FRONT 

Will cull the front-facing polygons.

YI_BACK 

Will cull the rear-facing polygons.

YI_CULL_NONE 

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

YI_CULL_FACE_COUNT 

Control the depth testing rules of the graphics API

Enumerator
YI_NEVER 

Never passes

YI_LESS 

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

YI_EQUAL 

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

YI_LESS_EQUAL 

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

YI_GREATER 

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

YI_NOT_EQUAL 

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

YI_GREATER_EQUAL 

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

YI_ALWAYS 

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

YI_DEPTH_TEST_COUNT 

Control stencil operations of the graphics API

Enumerator
YI_STENCIL_OFF 

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

YI_GLOBAL_MASK_SET 

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

YI_GLOBAL_MASK_CLEAR 

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

YI_STENCIL_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.

YI_STENCIL_CAPTURE_NO_OVERLAP 

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.

YI_STENCIL_MASK_INNER 

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

YI_STENCIL_MASK_OUTER 

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

YI_STENCIL_MASK_INNER_AND_RESET 

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.

YI_STENCIL_MASK_OUTER_AND_RESET 

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.

YI_STENCIL_MODE_COUNT 

Triangle winding enum for use with SetFrontFaceWinding

Enumerator
YI_CLOCKWISE 

Clockwise winding

YI_COUNTER_CLOCKWISE 

Counter-clockwise winding.

YI_WINDING_COUNT 

Constructor & Destructor Documentation

virtual CYIRenderSystem::~CYIRenderSystem ( )
virtual

Member Function Documentation

IYIBufferFactory* CYIRenderSystem::GetBufferFactory ( )

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

const CYICapabilities* CYIRenderSystem::GetCapabilities ( ) const

Returns a pointer to the CYICapabilities class.

static CYIRenderSystem* CYIRenderSystem::GetInstance ( )
static

Returns a pointer to the singleton class.

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.

CYIMeshFactory* CYIRenderSystem::GetMeshFactory ( )

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

IYIRenderer* CYIRenderSystem::GetSceneRenderer ( )

Returns the platform-specific renderer.

void CYIRenderSystem::SetScreenFrameBufferBinding ( )

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