59 if(current == value) {
63 if constexpr(
sizeof...(Ts) == 0) {
82 inline explicit operator bool()
const {
return *setter !=
nullptr && **setter !=
nullptr; }
119 if(current == value) {
123 if constexpr(
sizeof...(Ts) == 0) {
126 std::apply(setter, value);
142 inline explicit operator bool()
const {
return *setter !=
nullptr && **setter !=
nullptr; }
174 if(current == value) {
178 if constexpr(
sizeof...(Ts) == 0) {
181 std::apply(setter, value);
197 inline explicit operator bool()
const {
return setter !=
nullptr; }
239 : index(index), setter(setter), current(current) {}
245 if(current == value) {
249 if constexpr(
sizeof...(Ts) == 0) {
250 setter(index, value);
252 value.apply([&](
auto... args) { setter(index, args...); });
268 inline explicit operator bool()
const {
return setter !=
nullptr; }
308 if(current == value) {
312 setter(
object, value);
375 template<auto T>
static inline const constexpr auto bindBuffer = +[](
GLuint id)
constexpr {
return glBindBuffer(
T,
id); };
#define glSampleCoverage
Definition GLLoader.hpp:3236
ptrdiff_t GLintptr
Definition GLLoader.hpp:755
#define glBlendColor
Definition GLLoader.hpp:3573
#define glDebugMessageCallback
Definition GLLoader.hpp:15924
#define GL_CLIP_DISTANCE7
Definition GLLoader.hpp:1677
#define glLogicOp
Definition GLLoader.hpp:2142
#define glClearColor
Definition GLLoader.hpp:2108
#define GL_CLIP_DISTANCE3
Definition GLLoader.hpp:1673
#define GL_TEXTURE0
Definition GLLoader.hpp:1366
#define GL_POLYGON_OFFSET_LINE
Definition GLLoader.hpp:1224
#define glCullFace
Definition GLLoader.hpp:2052
#define glBlendFuncSeparate
Definition GLLoader.hpp:3420
#define glBindBufferRange
Definition GLLoader.hpp:4074
#define GL_SAMPLE_COVERAGE
Definition GLLoader.hpp:1402
#define GL_PRIMITIVE_RESTART_FIXED_INDEX
Definition GLLoader.hpp:4929
#define GL_PROGRAM_POINT_SIZE
Definition GLLoader.hpp:1973
#define glBindBuffer
Definition GLLoader.hpp:3610
#define GL_POLYGON_OFFSET_FILL
Definition GLLoader.hpp:1225
#define glBindVertexBuffer
Definition GLLoader.hpp:11921
#define GL_COLOR_LOGIC_OP
Definition GLLoader.hpp:1221
#define glEnable
Definition GLLoader.hpp:2130
#define glPolygonOffset
Definition GLLoader.hpp:3099
#define GL_POLYGON_SMOOTH
Definition GLLoader.hpp:854
#define GL_FRAMEBUFFER_SRGB
Definition GLLoader.hpp:1868
#define glBindVertexArray
Definition GLLoader.hpp:4361
#define GL_DEPTH_TEST
Definition GLLoader.hpp:859
#define GL_STENCIL_TEST
Definition GLLoader.hpp:863
#define GL_RASTERIZER_DISCARD
Definition GLLoader.hpp:1716
#define GL_CLIP_DISTANCE5
Definition GLLoader.hpp:1675
#define GL_SAMPLE_MASK
Definition GLLoader.hpp:2011
#define glDepthFunc
Definition GLLoader.hpp:2153
#define GL_TEXTURE_CUBE_MAP_SEAMLESS
Definition GLLoader.hpp:1994
#define glScissor
Definition GLLoader.hpp:2071
#define GL_SAMPLE_ALPHA_TO_ONE
Definition GLLoader.hpp:1401
#define glBindSampler
Definition GLLoader.hpp:4538
#define glStencilOp
Definition GLLoader.hpp:2150
#define glBindTextureUnit
Definition GLLoader.hpp:9615
#define glEnableVertexAttribArray
Definition GLLoader.hpp:3699
#define GL_CLIP_DISTANCE2
Definition GLLoader.hpp:1672
#define GL_ARRAY_BUFFER
Definition GLLoader.hpp:1518
#define GL_DITHER
Definition GLLoader.hpp:873
#define glBindFramebuffer
Definition GLLoader.hpp:4293
#define GL_DRAW_FRAMEBUFFER
Definition GLLoader.hpp:1799
unsigned int GLenum
Definition GLLoader.hpp:723
#define glPointSize
Definition GLLoader.hpp:2064
#define glPrimitiveRestartIndex
Definition GLLoader.hpp:4391
#define GL_CLIP_DISTANCE6
Definition GLLoader.hpp:1676
#define glStencilFunc
Definition GLLoader.hpp:2146
#define GL_CULL_FACE
Definition GLLoader.hpp:855
#define GL_CLIP_DISTANCE0
Definition GLLoader.hpp:1670
#define glDepthRangef
Definition GLLoader.hpp:9022
int GLsizei
Definition GLLoader.hpp:734
#define glDepthMask
Definition GLLoader.hpp:2124
#define GL_SAMPLE_ALPHA_TO_COVERAGE
Definition GLLoader.hpp:1400
#define glBindTexture
Definition GLLoader.hpp:3132
#define GL_FRAMEBUFFER
Definition GLLoader.hpp:1848
#define glFrontFace
Definition GLLoader.hpp:2055
#define GL_CLIP_DISTANCE1
Definition GLLoader.hpp:1671
#define GL_BLEND
Definition GLLoader.hpp:876
#define GL_MULTISAMPLE
Definition GLLoader.hpp:1399
unsigned int GLuint
Definition GLLoader.hpp:733
ptrdiff_t GLsizeiptr
Definition GLLoader.hpp:761
#define GL_POLYGON_OFFSET_POINT
Definition GLLoader.hpp:1223
#define GL_CLIP_DISTANCE4
Definition GLLoader.hpp:1674
#define glViewport
Definition GLLoader.hpp:2215
#define GL_READ_FRAMEBUFFER
Definition GLLoader.hpp:1798
#define GL_DEBUG_OUTPUT_SYNCHRONOUS
Definition GLLoader.hpp:7065
#define GL_SCISSOR_TEST
Definition GLLoader.hpp:881
#define glSampleMaski
Definition GLLoader.hpp:4513
#define glLineWidth
Definition GLLoader.hpp:2061
#define glPolygonMode
Definition GLLoader.hpp:2067
#define GL_PRIMITIVE_RESTART
Definition GLLoader.hpp:1930
#define glUseProgram
Definition GLLoader.hpp:3782
#define glDisable
Definition GLLoader.hpp:2127
#define GL_DEPTH_CLAMP
Definition GLLoader.hpp:1989
#define glBlendEquationSeparate
Definition GLLoader.hpp:3654
#define glActiveTexture
Definition GLLoader.hpp:3232
#define GL_LINE_SMOOTH
Definition GLLoader.hpp:849
#define GL_DEBUG_OUTPUT
Definition GLLoader.hpp:7099
#define CE_EXPLICIT(EXPR)
Definition Macros.hpp:413
Definition GLStateManager.hpp:921
Tuple is a fixed-size collection of heterogeneous values.
Definition Tuple.hpp:15
Definition Application.hpp:19
void GLThrowIfFailed(const char *info)
struct CeresEngine::GLState state
@ Object
Specifies that the normal map is in object space.
std::array< T, N > Array
Array is a container that encapsulates fixed size arrays.
Definition Array.hpp:17
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
A helper class that wraps a OpenGL capability.
Definition GLStateManager.hpp:332
GLenum capability
The OpenGL capability constant.
Definition GLStateManager.hpp:334
bool current
The current state.
Definition GLStateManager.hpp:337
GLCapability & operator=(const bool state)
Sets the capability state value.
Definition GLStateManager.hpp:350
std::conditional_t< sizeof...(Ts)==0, T, Tuple< T, Ts... > > Value
The operator= parameter type.
Definition GLStateManager.hpp:157
std::optional< Value > current
The currently set value.
Definition GLStateManager.hpp:163
F< void(T, Ts...)> Setter
The OpenGL setter function signature.
Definition GLStateManager.hpp:154
GLGlobalState & operator=(Value value)
Changes the OpenGL state variable to value.
Definition GLStateManager.hpp:173
const Setter setter
The setter function pointer.
Definition GLStateManager.hpp:160
const Setter * setter
The setter function pointer.
Definition GLStateManager.hpp:44
std::conditional_t< sizeof...(Ts)==0, T, Tuple< T, Ts... > > Value
The operator= parameter type.
Definition GLStateManager.hpp:41
void(*)(T, Ts...) Setter
The OpenGL setter function signature.
Definition GLStateManager.hpp:38
GLGlobalState & operator=(Value value)
Changes the OpenGL state variable to value.
Definition GLStateManager.hpp:58
std::optional< Value > current
The currently set value.
Definition GLStateManager.hpp:47
void(*)(T, Ts...) Setter
The OpenGL setter function signature.
Definition GLStateManager.hpp:92
GLGlobalState & operator=(Value value)
Changes the OpenGL state variable to value.
Definition GLStateManager.hpp:118
const Setter setter
The setter function pointer.
Definition GLStateManager.hpp:98
std::conditional_t< sizeof...(Ts)==0, T, Tuple< T, Ts... > > Value
The operator= parameter type.
Definition GLStateManager.hpp:95
std::optional< Value > current
The currently set value.
Definition GLStateManager.hpp:101
const Setter setter
The setter function pointer.
Definition GLStateManager.hpp:228
Entry & operator=(Value value)
Changes the OpenGL state variable to value.
Definition GLStateManager.hpp:244
const Index index
The entry index.
Definition GLStateManager.hpp:225
std::optional< Value > & current
The currently set value.
Definition GLStateManager.hpp:231
I Index
Definition GLStateManager.hpp:209
Entry operator[](Index index)
Definition GLStateManager.hpp:282
Array< std::optional< Value >, N > current
The current value.
Definition GLStateManager.hpp:221
void(*)(I, T, Ts...) Setter
The OpenGL setter function signature.
Definition GLStateManager.hpp:212
const Setter setter
The setter function pointer.
Definition GLStateManager.hpp:218
std::conditional_t< sizeof...(Ts)==0, T, Tuple< T, Ts... > > Value
The operator= parameter type.
Definition GLStateManager.hpp:215
Definition GLStateManager.hpp:200
A helper class that wraps an OpenGL state function.
Definition GLStateManager.hpp:27
GLObjectState & operator=(T value)
Changes the OpenGL state variable to value.
Definition GLStateManager.hpp:307
std::optional< T > current
The currently set value.
Definition GLStateManager.hpp:300
void(*)(Object, T) Setter
The OpenGL setter function signature.
Definition GLStateManager.hpp:291
GLObjectState(const Object object, const Setter setter)
Definition GLStateManager.hpp:302
const Object object
The OpenGL object handle.
Definition GLStateManager.hpp:294
const Setter setter
The setter function.
Definition GLStateManager.hpp:297
Definition GLStateManager.hpp:287
Definition GLStateManager.hpp:377
struct CeresEngine::GLState::@34::@46 buffer
GLGlobalState< decltype(glad_glPrimitiveRestartIndex)> index
Specify the primitive restart index index: Specifies the value to be interpreted as the primitive res...
Definition GLStateManager.hpp:821
GLCapability framebufferSRGB
If enabled and the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer attachment c...
Definition GLStateManager.hpp:708
GLCapability withFixedIndex
Enables primitive restarting with a fixed index.
Definition GLStateManager.hpp:816
struct CeresEngine::GLState::@34 bindings
GLCapability offset
If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to depth values of a p...
Definition GLStateManager.hpp:725
GLCapability textureCubeMapSeamless
If enabled, cubemap textures are sampled such that when linearly sampling from the border between two...
Definition GLStateManager.hpp:874
GLGlobalState< decltype(glad_glScissor)> box
Define the scissor box x, y: Specify the lower left corner of the scissor box.
Definition GLStateManager.hpp:659
GLGlobalState< decltype(glad_glDepthMask)> mask
Enable or disable writing into the depth buffer flag: Specifies whether the depth buffer is enabled f...
Definition GLStateManager.hpp:588
GLGlobalState< decltype(glad_glClearColor)> clearColor
Specify clear values for the color buffers.
Definition GLStateManager.hpp:427
GLGlobalState< decltype(glad_glSampleCoverage)> coverage
Specify multisample coverage parameters value: Specify a single floating-point sample coverage value.
Definition GLStateManager.hpp:798
struct CeresEngine::GLState::@38 scissor
GLCapability enableCoverage
If enabled, the fragment's coverage is ANDed with the temporary coverage value.
Definition GLStateManager.hpp:788
GLGlobalState< void(GLuint)> read
Bind a framebuffer to a framebuffer target to GL_READ_FRAMEBUFFER.
Definition GLStateManager.hpp:419
GLGlobalState< decltype(glad_glLineWidth)> width
Specify the width of rasterized lines.
Definition GLStateManager.hpp:762
GLGlobalState< decltype(glad_glBindTexture)> texture
Bind a named texture to a texturing target target: Specifies the target to which the texture is bound...
Definition GLStateManager.hpp:438
struct CeresEngine::GLState::@42 primitiveRestart
GLGlobalState< decltype(glad_glPolygonMode)> mode
Select a polygon rasterization mode face: Specifies the polygons that mode applies to.
Definition GLStateManager.hpp:718
GLGlobalState< void(GLuint)> dispatchIndirect
Bind a named buffer object as a GL_DISPATCH_INDIRECT_BUFFER buffer: Specifies the name of a buffer ob...
Definition GLStateManager.hpp:521
GLCapability dither
If enabled, dither color components or indices before they are written to the color buffer.
Definition GLStateManager.hpp:664
GLGlobalState< decltype(glad_glBlendColor)> color
Set the blend color red, green, blue, alpha: specify the components of GL_BLEND_COLOR
Definition GLStateManager.hpp:698
GLGlobalState< void(GLuint)> write
Bind a named buffer object as a GL_COPY_WRITE_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:511
GLGlobalState< void(GLuint)> shaderStorage
Bind a named buffer object as a GL_SHADER_STORAGE_BUFFER buffer: Specifies the name of a buffer objec...
Definition GLStateManager.hpp:541
GLGlobalState< decltype(glad_glBlendEquationSeparate)> equation
Set the RGB blend equation and the alpha blend equation separately buf: for glBlendEquationi,...
Definition GLStateManager.hpp:680
GLCapability clipDistance[8]
If enabled, clip geometry against user-defined half space i.
Definition GLStateManager.hpp:900
GLCapability clamping
If enabled, the -wc ≤ zc ≤ wc plane equation is ignored by view volume clipping (effectively,...
Definition GLStateManager.hpp:581
struct CeresEngine::GLState::@35 culling
struct CeresEngine::GLState::@44 sampleMask
GLGlobalState< void(GLuint)> transformFeedback
Bind a named buffer object as a GL_TRANSFORM_FEEDBACK_BUFFER buffer: Specifies the name of a buffer o...
Definition GLStateManager.hpp:550
GLGlobalState< void(GLuint)> atomicCounter
Bind a named buffer object as a GL_ATOMIC_COUNTER_BUFFER buffer: Specifies the name of a buffer objec...
Definition GLStateManager.hpp:502
GLGlobalState< decltype(glad_glViewport)> viewport
Set the viewport x, y: Specify the lower left corner of the viewport rectangle, in pixels.
Definition GLStateManager.hpp:385
GLGlobalState< decltype(glad_glPointSize)> size
Specify the diameter of rasterized points size: Specifies the diameter of rasterized points.
Definition GLStateManager.hpp:733
GLGlobalStateCollection< GLuint, void(GLuint), 96 > samplers
bind a named sampler to a texturing target.
Definition GLStateManager.hpp:473
GLGlobalState< decltype(glad_glDepthRangef)> range
Specify mapping of depth values from normalized device coordinates to window coordinates nearVal: Spe...
Definition GLStateManager.hpp:604
GLCapability sizeFromProgram
If enabled and a vertex or geometry shader is active, then the derived point size is taken from the (...
Definition GLStateManager.hpp:745
GLGlobalState< void(GLuint)> pixelUnpack
Bind a named buffer object as a GL_PIXEL_UNPACK_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:533
struct CeresEngine::GLState::@34::@46::@47 copy
struct CeresEngine::GLState::@41 multisample
GLGlobalState< decltype(glad_glBindVertexArray)> vertexArray
Bind a vertex array object array: Specifies the name of the vertex array to bind.
Definition GLStateManager.hpp:433
GLCapability smooth
If enabled, draw lines with correct filtering.
Definition GLStateManager.hpp:751
struct CeresEngine::GLState::@45 debugOutput
GLCapability point
If enabled, an offset is added to depth values of a polygon's fragments before the depth comparison i...
Definition GLStateManager.hpp:739
struct CeresEngine::GLState::@43 logicOp
GLGlobalState< void(GLuint)> drawIndirect
Bind a named buffer object as a GL_DRAW_INDIRECT_BUFFER buffer: Specifies the name of a buffer object...
Definition GLStateManager.hpp:516
GLCapability rasterizerDiscard
If enabled, all primitives are discarded before rasterization, but after any optional transform feedb...
Definition GLStateManager.hpp:844
GLGlobalStateCollection< GLenum, void(GLuint), 96 > textures
Definition GLStateManager.hpp:440
GLGlobalState< decltype(glad_glDepthFunc)> function
Specify the value used for depth buffer comparisons func: Specifies the depth comparison function.
Definition GLStateManager.hpp:596
struct CeresEngine::GLState::@37 stencil
struct CeresEngine::GLState::@36 depth
GLGlobalState< void(GLuint)> uniform
Bind a named buffer object as a GL_UNIFORM_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:554
struct CeresEngine::GLState::@39 blending
struct CeresEngine::GLState::@33 framebuffer
GLCapability sampleAlphaToCoverage
If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the...
Definition GLStateManager.hpp:850
GLGlobalState< decltype(glad_glFrontFace)> frontFace
Define front- and back-facing polygons mode: Specifies the orientation of front-facing polygons.
Definition GLStateManager.hpp:390
GLGlobalState< decltype(glad_glStencilOp)> operation
Set front and back stencil test actions sfail: Specifies the action to take when the stencil test fai...
Definition GLStateManager.hpp:642
GLGlobalStateCollection< GLuint, void(GLuint, GLintptr, GLsizei), 10 > vertexBuffer
Bind a buffer to a vertex buffer bind point.
Definition GLStateManager.hpp:484
GLGlobalState< void(GLuint)> global
Bind a framebuffer to a framebuffer target to GL_FRAMEBUFFER.
Definition GLStateManager.hpp:403
GLCapability sampleAlphaToOne
If enabled, each sample alpha value is replaced by the maximum representable alpha value.
Definition GLStateManager.hpp:854
GLCapability testingEnabled
If enabled, do depth comparisons and update the depth buffer.
Definition GLStateManager.hpp:576
GLGlobalState< void(GLuint)> pixelPack
Bind a named buffer object as a GL_PIXEL_PACK_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:529
GLCapability enabled
If enabled, cull polygons based on their winding in window coordinates.
Definition GLStateManager.hpp:561
struct CeresEngine::GLState::@40 polygon
GLGlobalState< decltype(glad_glDebugMessageCallback)> callback
Specify a callback to receive debugging messages from the GL.
Definition GLStateManager.hpp:896
GLGlobalState< void(GLuint)> query
Bind a named buffer object as a GL_QUERY_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:537
GLGlobalStateCollection< GLuint, void(GLenum, GLuint, GLintptr, GLsizeiptr), 96 > buffers
Bind a range within a buffer object to an indexed buffer target.
Definition GLStateManager.hpp:466
GLGlobalState< decltype(glad_glUseProgram)> program
Installs a program object as part of current rendering state program: Specifies the handle of the pro...
Definition GLStateManager.hpp:396
GLGlobalState< void(GLuint)> draw
Bind a framebuffer to a framebuffer target to GL_DRAW_FRAMEBUFFER.
Definition GLStateManager.hpp:411
struct CeresEngine::GLState::@40::@50 line
GLGlobalState< void(GLuint)> elementArray
Bind a named buffer object as a GL_ELEMENT_ARRAY_BUFFER buffer: Specifies the name of a buffer object...
Definition GLStateManager.hpp:525
struct CeresEngine::GLState::@40::@48 fill
GLCapability synchronous
If enabled, debug messages are produced synchronously by a debug context.
Definition GLStateManager.hpp:889
GLGlobalState< decltype(glad_glCullFace)> face
Specify whether front- or back-facing facets can be culled mode: Specifies whether front- or back-fac...
Definition GLStateManager.hpp:568
GLGlobalState< decltype(glad_glSampleMaski)> value
Set the value of a sub-word of the sample mask maskNumber: Specifies which 32-bit sub-word of the sam...
Definition GLStateManager.hpp:866
GLGlobalState< void(GLuint)> array
Bind a named buffer object as a GL_ARRAY_BUFFER buffer: Specifies the name of a buffer object.
Definition GLStateManager.hpp:498