Cogs.Core
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
Cogs::Core::RenderStates Struct Reference

Classes

struct  RasterizerStateInstance
 

Public Member Functions

void initialize (IGraphicsDevice *device)
 
void setupDepthStates (IGraphicsDevice *device)
 
void cleanup ()
 
uint16_t COGSCORE_DLL_API getRasterizerState (const Cogs::Core::RenderPassOptions &passOptions, RasterizerState::CullMode cullMode, bool wireFrame, bool counterClockWise)
 
COGSCORE_DLL_API uint16_t getRasterizerState (const RasterizerState &rs)
 
Cogs::DepthStencilStateHandle getDepthStencilState (const DepthStencilState &ds)
 
Cogs::SamplerStateHandle getSamplerState (const SamplerState &ss)
 

Public Attributes

bool reverseDepth = false
 
Cogs::RasterizerStateHandle defaultRasterizerStateHandle
 
Cogs::RasterizerStateHandle defaultCCWasterizerStateHandle
 
std::vector< Cogs::RasterizerStateHandlerasterizerStateHandles
 
struct {
   Cogs::BlendState   color = Cogs::BlendState::DefaultState()
 
   Cogs::BlendState   alpha = Cogs::BlendState::DefaultState()
 
   Cogs::BlendStateHandle   handle = Cogs::BlendStateHandle::NoHandle
 
blendStates [size_t(BlendMode::Count)]
 
Cogs::DepthStencilStateHandle commonDepthStates [(int) DepthMode::Count *(int) DepthFunc::Count]
 
Cogs::SamplerStateHandle defaultSampler
 
Cogs::SamplerStateHandle commonSamplerStates [4]
 
Cogs::SamplerStateHandle shadowSampler
 
Cogs::VertexBufferHandle fullScreenTriangle
 

Static Public Attributes

static constexpr uint16_t defaultDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::Less)
 
static constexpr uint16_t noWriteDepthStencilState = getDepthState(DepthMode::NoWrite, DepthFunc::Less)
 
static constexpr uint16_t noDepthStencilState = getDepthState(DepthMode::Disabled, DepthFunc::Always)
 
static constexpr uint16_t noTestDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::Always)
 
static constexpr uint16_t leqDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::LessOrEqual)
 

Private Attributes

IGraphicsDevicedevice = nullptr
 
std::unordered_map< RasterizerState, RasterizerStateInstancerasterizerStates
 
std::unordered_map< DepthStencilState, Cogs::DepthStencilStateHandledepthStencilStates
 
std::unordered_map< SamplerState, Cogs::SamplerStateHandlesamplerStates
 

Detailed Description

Definition at line 25 of file RenderStates.h.

Member Function Documentation

◆ cleanup()

void Cogs::Core::RenderStates::cleanup ( )

Definition at line 258 of file RenderStates.cpp.

◆ getDepthStencilState()

Cogs::DepthStencilStateHandle Cogs::Core::RenderStates::getDepthStencilState ( const DepthStencilState ds)

Definition at line 339 of file RenderStates.cpp.

◆ getRasterizerState() [1/2]

uint16_t Cogs::Core::RenderStates::getRasterizerState ( const Cogs::Core::RenderPassOptions passOptions,
RasterizerState::CullMode  cullMode,
bool  wireFrame,
bool  counterClockWise 
)

Definition at line 288 of file RenderStates.cpp.

◆ getRasterizerState() [2/2]

uint16_t Cogs::Core::RenderStates::getRasterizerState ( const RasterizerState rs)

Definition at line 313 of file RenderStates.cpp.

◆ getSamplerState()

Cogs::SamplerStateHandle Cogs::Core::RenderStates::getSamplerState ( const SamplerState ss)

Definition at line 364 of file RenderStates.cpp.

◆ initialize()

void Cogs::Core::RenderStates::initialize ( IGraphicsDevice device)

Definition at line 21 of file RenderStates.cpp.

◆ setupDepthStates()

void Cogs::Core::RenderStates::setupDepthStates ( IGraphicsDevice device)

Definition at line 209 of file RenderStates.cpp.

Member Data Documentation

◆ alpha

Cogs::BlendState Cogs::Core::RenderStates::alpha = Cogs::BlendState::DefaultState()

Definition at line 40 of file RenderStates.h.

◆ color

Cogs::BlendState Cogs::Core::RenderStates::color = Cogs::BlendState::DefaultState()

Definition at line 39 of file RenderStates.h.

◆ commonDepthStates

Cogs::DepthStencilStateHandle Cogs::Core::RenderStates::commonDepthStates[(int) DepthMode::Count *(int) DepthFunc::Count]

Definition at line 50 of file RenderStates.h.

◆ commonSamplerStates

Cogs::SamplerStateHandle Cogs::Core::RenderStates::commonSamplerStates[4]

Definition at line 55 of file RenderStates.h.

◆ defaultCCWasterizerStateHandle

Cogs::RasterizerStateHandle Cogs::Core::RenderStates::defaultCCWasterizerStateHandle

Definition at line 34 of file RenderStates.h.

◆ defaultDepthStencilState

constexpr uint16_t Cogs::Core::RenderStates::defaultDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::Less)
staticconstexpr

Definition at line 44 of file RenderStates.h.

◆ defaultRasterizerStateHandle

Cogs::RasterizerStateHandle Cogs::Core::RenderStates::defaultRasterizerStateHandle

Definition at line 33 of file RenderStates.h.

◆ defaultSampler

Cogs::SamplerStateHandle Cogs::Core::RenderStates::defaultSampler

Definition at line 53 of file RenderStates.h.

◆ depthStencilStates

std::unordered_map<DepthStencilState, Cogs::DepthStencilStateHandle> Cogs::Core::RenderStates::depthStencilStates
private

Definition at line 82 of file RenderStates.h.

◆ device

IGraphicsDevice* Cogs::Core::RenderStates::device = nullptr
private

Definition at line 73 of file RenderStates.h.

◆ fullScreenTriangle

Cogs::VertexBufferHandle Cogs::Core::RenderStates::fullScreenTriangle

Definition at line 61 of file RenderStates.h.

◆ handle

Cogs::BlendStateHandle Cogs::Core::RenderStates::handle = Cogs::BlendStateHandle::NoHandle

Definition at line 41 of file RenderStates.h.

◆ leqDepthStencilState

constexpr uint16_t Cogs::Core::RenderStates::leqDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::LessOrEqual)
staticconstexpr

Definition at line 48 of file RenderStates.h.

◆ noDepthStencilState

constexpr uint16_t Cogs::Core::RenderStates::noDepthStencilState = getDepthState(DepthMode::Disabled, DepthFunc::Always)
staticconstexpr

Definition at line 46 of file RenderStates.h.

◆ noTestDepthStencilState

constexpr uint16_t Cogs::Core::RenderStates::noTestDepthStencilState = getDepthState(DepthMode::Default, DepthFunc::Always)
staticconstexpr

Definition at line 47 of file RenderStates.h.

◆ noWriteDepthStencilState

constexpr uint16_t Cogs::Core::RenderStates::noWriteDepthStencilState = getDepthState(DepthMode::NoWrite, DepthFunc::Less)
staticconstexpr

Definition at line 45 of file RenderStates.h.

◆ rasterizerStateHandles

std::vector<Cogs::RasterizerStateHandle> Cogs::Core::RenderStates::rasterizerStateHandles

Definition at line 36 of file RenderStates.h.

◆ rasterizerStates

std::unordered_map<RasterizerState, RasterizerStateInstance> Cogs::Core::RenderStates::rasterizerStates
private

Definition at line 81 of file RenderStates.h.

◆ reverseDepth

bool Cogs::Core::RenderStates::reverseDepth = false

Definition at line 31 of file RenderStates.h.

◆ samplerStates

std::unordered_map<SamplerState, Cogs::SamplerStateHandle> Cogs::Core::RenderStates::samplerStates
private

Definition at line 83 of file RenderStates.h.

◆ shadowSampler

Cogs::SamplerStateHandle Cogs::Core::RenderStates::shadowSampler

Definition at line 58 of file RenderStates.h.


The documentation for this struct was generated from the following files: