#include
<oglplus/capability.hpp>
Capability
This enumeration lists GL capabilities i.e. features that can be enabled,
disabled or queried by the Enable
,
Disable
and IsEnabled
member functions of the Context
class.
enum class Capability : GLenum { PrimitiveRestart = GL_PRIMITIVE_RESTART, DepthTest = GL_DEPTH_TEST, StencilTest = GL_STENCIL_TEST, ScissorTest = GL_SCISSOR_TEST, CullFace = GL_CULL_FACE, RasterizerDiscard = GL_RASTERIZER_DISCARD, PolygonOffsetPoint = GL_POLYGON_OFFSET_POINT, PolygonOffsetLine = GL_POLYGON_OFFSET_LINE, PolygonOffsetFill = GL_POLYGON_OFFSET_FILL, Blend = GL_BLEND, ColorLogicOp = GL_COLOR_LOGIC_OP, Dither = GL_DITHER, Multisample = GL_MULTISAMPLE, SampleShading = GL_SAMPLE_SHADING, LineSmooth = GL_LINE_SMOOTH, PolygonSmooth = GL_POLYGON_SMOOTH, ProgramPointSize = GL_PROGRAM_POINT_SIZE, TextureCubeMapSeamless = GL_TEXTURE_CUBE_MAP_SEAMLESS, SampleAlphaToCoverage = GL_SAMPLE_ALPHA_TO_COVERAGE, SampleAlphaToOne = GL_SAMPLE_ALPHA_TO_ONE, SampleCoverage = GL_SAMPLE_COVERAGE, SampleMask = GL_SAMPLE_MASK, FramebufferSRGB = GL_FRAMEBUFFER_SRGB, DebugOutputSynchronous = GL_DEBUG_OUTPUT_SYNCHRONOUS, StreamRasterization = GL_STREAM_RASTERIZATION_AMD, BlendAdvancedCoherent = GL_BLEND_ADVANCED_COHERENT_KHR }; template <> Range<Capability> EnumValueRange<Capability>(void); StrCRef EnumValueName(Capability);
Functionality
Functionalities are similar to capabilities in that they can be enabled,
disabled or queried by the Enable
,
Disable
and IsEnabled
member functions of the Context
class.
The difference between them is that functionalities have multiple 0-based-indexed
'slots' that can be enabled or disabled. One example of a Functionality
is ClipDistance
where the i-th 'slot' enables the i-th
clipping plane.
enum class Functionality : GLenum { ClipDistance = GL_CLIP_DISTANCE0 }; template <> Range<Functionality> EnumValueRange<Functionality>(void); StrCRef EnumValueName(Functionality);
The Capability
and Functionality
enumerations have several syntax-sugar operators allowing less verbose
use.
void operator << (Capability capability, bool enable);void operator + (Capability capability);
void operator - (Capability capability);
struct FunctionalityAndNumber { };
FunctionalityAndNumber operator | (Functionality func, GLuint number);
void operator << (FunctionalityAndNumber func_and_num, bool enable);
void operator + (FunctionalityAndNumber func_and_num);
void operator - (FunctionalityAndNumber func_and_num);
![]()
Enables or disables the specified |
|
Enables the specified |
|
Disables the specified |
|
An opaque helper type used by the |
|
Creates an instance of |
|
Enables or disables the specified functionality. |
|
Enables the specified functionality. |
|
Disables the specified functionality. |
For example:
Capability::DepthTest << true;Capability::StencilTest << false;
+Capability::CullFace;
-Capability::Blend;
for(int i=0; i<4; ++i) { (Functionality::ClipDistance | i) << true;
}