Cogs.Core
BlendState.h
1#pragma once
2
3namespace Cogs
4{
8 struct BlendState
9 {
13 enum struct Blend : uint8_t
14 {
15 Zero = 0,
16 One,
17 SourceColor,
18 InverseSourceColor,
19 SourceAlpha,
20 InverseSourceAlpha,
21 DestinationAlpha,
22 InverseDestinationAlpha,
23 DestinationColor,
24 InverseDestinationColor,
25 SourceAlphaSaturate,
26 BlendFactor,
27 InverseBlendFactor,
28 Count
29 };
30
31 enum struct BlendOperation : uint8_t {
32 Add = 0,
33 Subtract,
34 ReverseSubtract,
35 Min,
36 Max,
37 Count
38 };
39
41 uint8_t enabled = 0;
42
44 Blend sourceBlend = Blend::One;
45
47 Blend destinationBlend = Blend::Zero;
48
50 BlendOperation operation = BlendOperation::Add;
51
56 {
57 BlendState blendState = {
58 0,
59 Blend::One, Blend::Zero, BlendOperation::Add,
60 };
61 return blendState;
62 }
63 };
64}
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Encapsulates blend state for the graphics pipeline in a state object.
Definition: BlendState.h:9
uint8_t enabled
If blending is enabled.
Definition: BlendState.h:41
Blend destinationBlend
Blend option for the blend destination data.
Definition: BlendState.h:47
static BlendState DefaultState()
Creates a blend state object initialized with the default settings.
Definition: BlendState.h:55
BlendOperation operation
How the two blend values are combined.
Definition: BlendState.h:50
Blend sourceBlend
Blend option for the blend source data.
Definition: BlendState.h:44
Blend
Options for blend functions.
Definition: BlendState.h:14