CSFML 3.0.0
Loading...
Searching...
No Matches
StencilMode.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#pragma once
26
28// Headers
30#include <CSFML/Graphics/Export.h>
31
32
39 typedef enum
40{
41 sfStencilComparisonNever,
42 sfStencilComparisonLess,
43 sfStencilComparisonLessEqual,
44 sfStencilComparisonGreater,
45 sfStencilComparisonGreaterEqual,
46 sfStencilComparisonEqual,
47 sfStencilComparisonNotEqual,
48 sfStencilComparisonAlways
49} sfStencilComparison;
50
51
58 typedef enum
59{
60 sfStencilUpdateOperationKeep,
61 sfStencilUpdateOperationZero,
62 sfStencilUpdateOperationReplace,
63 sfStencilUpdateOperationIncrement,
64 sfStencilUpdateOperationDecrement,
65 sfStencilUpdateOperationInvert,
66} sfStencilUpdateOperation;
67
68
73 typedef struct
74{
75 unsigned int value;
76} sfStencilValue;
77
78
83 typedef struct
84{
85 sfStencilComparison stencilComparison;
86 sfStencilUpdateOperation stencilUpdateOperation;
87 sfStencilValue stencilReference;
88 sfStencilValue stencilMask;
89 bool stencilOnly;
90} sfStencilMode;
91
96 CSFML_GRAPHICS_API const sfStencilMode sfStencilMode_default;
Export.h
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition Graphics/Export.h:42
sfStencilComparison
sfStencilComparison
Enumeration of the stencil test comparisons that can be performed.
Definition StencilMode.h:40
sfStencilComparisonNotEqual
@ sfStencilComparisonNotEqual
The stencil test passes if the new value is strictly unequal to the value in the stencil buffer.
Definition StencilMode.h:47
sfStencilComparisonGreaterEqual
@ sfStencilComparisonGreaterEqual
The stencil test passes if the new value is greater than or equal to the value in the stencil buffer.
Definition StencilMode.h:45
sfStencilComparisonNever
@ sfStencilComparisonNever
The stencil test never passes.
Definition StencilMode.h:41
sfStencilComparisonEqual
@ sfStencilComparisonEqual
The stencil test passes if the new value is strictly equal to the value in the stencil buffer.
Definition StencilMode.h:46
sfStencilComparisonLess
@ sfStencilComparisonLess
The stencil test passes if the new value is less than the value in the stencil buffer.
Definition StencilMode.h:42
sfStencilComparisonGreater
@ sfStencilComparisonGreater
The stencil test passes if the new value is greater than the value in the stencil buffer.
Definition StencilMode.h:44
sfStencilComparisonLessEqual
@ sfStencilComparisonLessEqual
The stencil test passes if the new value is less than or equal to the value in the stencil buffer.
Definition StencilMode.h:43
sfStencilComparisonAlways
@ sfStencilComparisonAlways
The stencil test always passes.
Definition StencilMode.h:48
sfStencilUpdateOperation
sfStencilUpdateOperation
Enumeration of the stencil buffer update operations.
Definition StencilMode.h:59
sfStencilUpdateOperationReplace
@ sfStencilUpdateOperationReplace
If the stencil test passes, the value in the stencil buffer is set to the new value.
Definition StencilMode.h:62
sfStencilUpdateOperationZero
@ sfStencilUpdateOperationZero
If the stencil test passes, the value in the stencil buffer is set to zero.
Definition StencilMode.h:61
sfStencilUpdateOperationIncrement
@ sfStencilUpdateOperationIncrement
If the stencil test passes, the value in the stencil buffer is incremented and if required clamped.
Definition StencilMode.h:63
sfStencilUpdateOperationInvert
@ sfStencilUpdateOperationInvert
If the stencil test passes, the value in the stencil buffer is bitwise inverted.
Definition StencilMode.h:65
sfStencilUpdateOperationDecrement
@ sfStencilUpdateOperationDecrement
If the stencil test passes, the value in the stencil buffer is decremented and if required clamped.
Definition StencilMode.h:64
sfStencilUpdateOperationKeep
@ sfStencilUpdateOperationKeep
If the stencil test passes, the value in the stencil buffer is not modified.
Definition StencilMode.h:60
sfStencilMode_default
const sfStencilMode sfStencilMode_default
Define the default values for a StencilMode.
Definition StencilMode.h:96
sfStencilMode
Stencil modes for drawing.
Definition StencilMode.h:84
sfStencilMode::stencilReference
sfStencilValue stencilReference
The reference value we're performing the stencil test with.
Definition StencilMode.h:87
sfStencilMode::stencilMask
sfStencilValue stencilMask
The mask to apply to both the reference value and the value in the stencil buffer.
Definition StencilMode.h:88
sfStencilMode::stencilOnly
bool stencilOnly
Whether we should update the color buffer in addition to the stencil buffer.
Definition StencilMode.h:89
sfStencilMode::stencilUpdateOperation
sfStencilUpdateOperation stencilUpdateOperation
The update operation to perform if the stencil test passes.
Definition StencilMode.h:86
sfStencilMode::stencilComparison
sfStencilComparison stencilComparison
The comparison we're performing the stencil test with.
Definition StencilMode.h:85
sfStencilValue
Stencil value type (also used as a mask)
Definition StencilMode.h:74
sfStencilValue::value
unsigned int value
The stored stencil value.
Definition StencilMode.h:75