You.i Engine
CYIUniformBufferId Class Reference

Detailed Description

The CYIUniformBufferId class is an identification class for Uniform buffers that also reveals the name of the uniform buffer as a string.

The CYIUniformBufferId can only be generated using CYIUniformBufferId::Generate, which takes a string. The user is responsible of retaining the instance of the CYIUniformBufferId for updating any type of custom shader uniforms using IYIUniformBufferObject::Set

CYIUniformBufferId also comes with a set of predefined instances for You.i Engine default shader program.

  • YiModelMatrix
  • YiMeshMatrix
  • YiAlpha
  • YiTextureMatrix[]
See also
IYIUniformBufferObject

#include <renderer/YiUniformBufferId.h>

Public Member Functions

 CYIUniformBufferId ()
 
const CYIStringGetUniformName () const
 
size_t GetID () const
 
bool operator< (const CYIUniformBufferId &uniformBufferId) const
 
bool operator== (const CYIUniformBufferId &uniformBufferId) const
 
bool operator!= (const CYIUniformBufferId &uniformBufferId) const
 

Static Public Member Functions

static CYIUniformBufferId Generate (const CYIString &uniformName)
 
static void Init ()
 

Static Public Attributes

static const CYIUniformBufferId s_YiMatricesID
 
static const CYIUniformBufferId s_YiNormalMatrixID
 
static const CYIUniformBufferId s_YiMVMatrixID
 
static const CYIUniformBufferId s_YiMVPMatrixID
 
static const CYIUniformBufferId s_YiCameraMatrixID
 
static const CYIUniformBufferId s_YiModelMatrixID
 
static const CYIUniformBufferId s_YiMeshMatrixID
 
static const CYIUniformBufferId s_YiAlphaID
 
static const CYIUniformBufferId s_YiColorID
 
static const CYIUniformBufferId s_YiViewportSizeID
 
static std::vector< CYIUniformBufferIds_YiTextureID
 
static std::vector< CYIUniformBufferIds_YiTextureMatrixID
 

Constructor & Destructor Documentation

◆ CYIUniformBufferId()

CYIUniformBufferId::CYIUniformBufferId ( )
inline

Member Function Documentation

◆ Generate()

static CYIUniformBufferId CYIUniformBufferId::Generate ( const CYIString uniformName)
static

Generates an instance of CYIUniformBufferId using a given name. Please note that using the same uniform name will not return the same ID than the previous time. A new unique ID will be generated each time, which is why it is the user's responsibility to retain their CYIUniformBufferId instance for their custom shaders.

◆ GetID()

size_t CYIUniformBufferId::GetID ( ) const
inline

Returns a unique ID associated with a specific uniform buffer object.

◆ GetUniformName()

const CYIString & CYIUniformBufferId::GetUniformName ( ) const
inline

Returns the name of the uniform buffer

◆ Init()

static void CYIUniformBufferId::Init ( )
static

Initializer for the predefined uniform buffer Ids for You.i Engine default shader program. For internal use only.

◆ operator!=()

bool CYIUniformBufferId::operator!= ( const CYIUniformBufferId uniformBufferId) const
inline

Convenient compare operator to determine if the uniforms buffer IDs are not equal

◆ operator<()

bool CYIUniformBufferId::operator< ( const CYIUniformBufferId uniformBufferId) const
inline

Required operator for std::map for element lookup and sorting.

◆ operator==()

bool CYIUniformBufferId::operator== ( const CYIUniformBufferId uniformBufferId) const
inline

Convenient compare operator to determine if the uniforms buffer IDs are equal

Member Data Documentation

◆ s_YiAlphaID

const CYIUniformBufferId CYIUniformBufferId::s_YiAlphaID
static

◆ s_YiCameraMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiCameraMatrixID
static

◆ s_YiColorID

const CYIUniformBufferId CYIUniformBufferId::s_YiColorID
static

◆ s_YiMatricesID

const CYIUniformBufferId CYIUniformBufferId::s_YiMatricesID
static

◆ s_YiMeshMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiMeshMatrixID
static

◆ s_YiModelMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiModelMatrixID
static

◆ s_YiMVMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiMVMatrixID
static

◆ s_YiMVPMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiMVPMatrixID
static

◆ s_YiNormalMatrixID

const CYIUniformBufferId CYIUniformBufferId::s_YiNormalMatrixID
static

◆ s_YiTextureID

std::vector<CYIUniformBufferId> CYIUniformBufferId::s_YiTextureID
static

◆ s_YiTextureMatrixID

std::vector<CYIUniformBufferId> CYIUniformBufferId::s_YiTextureMatrixID
static

◆ s_YiViewportSizeID

const CYIUniformBufferId CYIUniformBufferId::s_YiViewportSizeID
static

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