MCPcopy Create free account
hub / github.com/SFML/SFML / stencilOperationToGlConstant

Function stencilOperationToGlConstant

src/SFML/Graphics/RenderTarget.cpp:153–170  ·  view source on GitHub ↗

Convert an UpdateOperation constant to the corresponding OpenGL constant.

Source from the content-addressed store, hash-verified

151
152// Convert an UpdateOperation constant to the corresponding OpenGL constant.
153std::uint32_t stencilOperationToGlConstant(sf::StencilUpdateOperation operation)
154{
155 // clang-format off
156 switch (operation)
157 {
158 case sf::StencilUpdateOperation::Keep: return GL_KEEP;
159 case sf::StencilUpdateOperation::Zero: return GL_ZERO;
160 case sf::StencilUpdateOperation::Replace: return GL_REPLACE;
161 case sf::StencilUpdateOperation::Increment: return GL_INCR;
162 case sf::StencilUpdateOperation::Decrement: return GL_DECR;
163 case sf::StencilUpdateOperation::Invert: return GL_INVERT;
164 }
165 // clang-format on
166
167 sf::err() << "Invalid value for sf::StencilUpdateOperation! Fallback to sf::StencilMode::Keep." << std::endl;
168 assert(false);
169 return GL_KEEP;
170}
171
172
173// Convert a Comparison constant to the corresponding OpenGL constant.

Callers 1

applyStencilModeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected