CUGL 4.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cugl::graphics::BlendState Class Reference

#include <CUGraphicsBase.h>

Public Member Functions

 BlendState ()
 
 BlendState (BlendMode mode)
 
 BlendState (const BlendState &state)
 
BlendStateset (BlendMode mode)
 
BlendStateoperator= (BlendMode mode)
 
BlendStateoperator= (const BlendState &state)
 
bool operator== (const BlendState &state) const noexcept
 
bool operator!= (const BlendState &state) const noexcept
 
size_t hash ()
 

Public Attributes

BlendFactor srcFactor
 
BlendFactor dstFactor
 
BlendFactor srcAlphaFactor
 
BlendFactor dstAlphaFactor
 
BlendEq colorEq
 
BlendEq alphaEq
 
Color4f color
 

Detailed Description

This class represents the state of the current color blending operations

This class is used for fine-tuned control of the color blending. For most application BlendMode should be adequate. Note that changing any of these values in Vulkans requires a pipeline swap.

Constructor & Destructor Documentation

◆ BlendState() [1/3]

cugl::graphics::BlendState::BlendState ( )

Creates default color blend.

◆ BlendState() [2/3]

cugl::graphics::BlendState::BlendState ( BlendMode  mode)

Creates a color blend for the given mode

Parameters
modeThe color blend mode

◆ BlendState() [3/3]

cugl::graphics::BlendState::BlendState ( const BlendState state)

Creates a copy of the given color blend

Parameters
stateThe color blend to copy

Member Function Documentation

◆ hash()

size_t cugl::graphics::BlendState::hash ( )

Returns a hash code for this object.

This hash is used to manage pipeline swaps in Vulkan. It has no use in OpenGL.

Returns
a hash code for this object.

◆ operator!=()

bool cugl::graphics::BlendState::operator!= ( const BlendState state) const
noexcept

Returns true if the given color blend is not equal to this object

Parameters
stateThe color blend to compare
Returns
true if the given color blend is not equal to this object

◆ operator=() [1/2]

BlendState & cugl::graphics::BlendState::operator= ( BlendMode  mode)

Assigns this object to be equivalent to the given color blend mode.

Parameters
modeThe color blend mode
Returns
a reference to this object for chaining

◆ operator=() [2/2]

BlendState & cugl::graphics::BlendState::operator= ( const BlendState state)

Assigns this object to be a copy of the given color blend

Parameters
stateThe color blend to copy
Returns
a reference to this object for chaining

◆ operator==()

bool cugl::graphics::BlendState::operator== ( const BlendState state) const
noexcept

Returns true if the given color blend is equal to this object

Parameters
stateThe color blend to compare
Returns
true if the given color blend is equal to this object

◆ set()

BlendState & cugl::graphics::BlendState::set ( BlendMode  mode)

Assigns this object to be equivalent to the given color blend mode.

Parameters
modeThe color blend mode
Returns
a reference to this object for chaining

Member Data Documentation

◆ alphaEq

BlendEq cugl::graphics::BlendState::alphaEq

The blend equation for the alpha value

◆ color

Color4f cugl::graphics::BlendState::color

The constant color for this blend mode

◆ colorEq

BlendEq cugl::graphics::BlendState::colorEq

The blend equation for the RGB color values

◆ dstAlphaFactor

BlendFactor cugl::graphics::BlendState::dstAlphaFactor

The blend factor for the destination alpha value

◆ dstFactor

BlendFactor cugl::graphics::BlendState::dstFactor

The blend factor for the destination RGB color

◆ srcAlphaFactor

BlendFactor cugl::graphics::BlendState::srcAlphaFactor

The blend factor for the source alpha value

◆ srcFactor

BlendFactor cugl::graphics::BlendState::srcFactor

The blend factor for the source RGB color


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