13 #ifndef OGLPLUS_CONTEXT_BUFFER_CLEARING_1201040722_HPP
14 #define OGLPLUS_CONTEXT_BUFFER_CLEARING_1201040722_HPP
40 GLfloat
Red(
void)
const
82 GLbitfield _forward(
void)
84 GLbitfield res = _bits;
91 #if !OGLPLUS_NO_DELETED_FUNCTIONS
103 inline ClrBits _make(GLbitfield bit)
105 return ClrBits(_forward() | bit);
115 return _make(GL_COLOR_BUFFER_BIT);
125 return _make(GL_DEPTH_BUFFER_BIT);
135 return _make(GL_STENCIL_BUFFER_BIT);
139 : _bits(temp._forward())
142 void DoIt(
void)
const
146 OGLPLUS_GLFUNC(Clear)(_bits);
147 OGLPLUS_VERIFY_SIMPLE(Clear);
156 void operator()(
void)
const
161 void operator()(
bool dismiss)
164 if(dismiss) Dismiss();
193 static void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
199 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_0
215 OGLPLUS_GLFUNC(ClearDepthf)(d);
216 OGLPLUS_VERIFY_SIMPLE(ClearDepthf);
285 OGLPLUS_GLFUNC(
Clear)(GLbitfield(bits));
286 OGLPLUS_VERIFY_SIMPLE(
Clear);
305 OGLPLUS_GLFUNC(ClearBufferiv)(
332 OGLPLUS_GLFUNC(ClearBufferiv)(
360 OGLPLUS_GLFUNC(ClearBufferuiv)(
387 OGLPLUS_GLFUNC(ClearBufferuiv)(
415 OGLPLUS_GLFUNC(ClearBufferfv)(
442 OGLPLUS_GLFUNC(ClearBufferfv)(
467 OGLPLUS_GLFUNC(ClearBufferfv)(GL_DEPTH, 0, &value);
468 OGLPLUS_CHECK_SIMPLE(ClearBufferfv);
483 OGLPLUS_GLFUNC(ClearBufferiv)(GL_STENCIL, 0, &value);
484 OGLPLUS_CHECK_SIMPLE(ClearBufferiv);
499 OGLPLUS_GLFUNC(ClearBufferfi)(
505 OGLPLUS_CHECK_SIMPLE(ClearBufferfi);
519 OGLPLUS_GLFUNC(GetFloatv)(GL_COLOR_CLEAR_VALUE, result._v);
520 OGLPLUS_VERIFY_SIMPLE(GetFloatv);
535 OGLPLUS_GLFUNC(GetFloatv)(GL_DEPTH_CLEAR_VALUE, &result);
536 OGLPLUS_VERIFY_SIMPLE(GetFloatv);
551 OGLPLUS_GLFUNC(GetIntegerv)(GL_STENCIL_CLEAR_VALUE, &result);
552 OGLPLUS_VERIFY_SIMPLE(GetIntegerv);
560 #endif // include guard
OpenGL Color buffer enumeration.
OpenGL bitfield-related helpers.
GLfloat Green(void) const
The green component.
Definition: buffer_clearing.hpp:46
static void Clear(Bitfield< oglplus::ClearBit > bits)
Clears buffers specified by the bits parameter.
Definition: buffer_clearing.hpp:283
static GLint ClearStencilValue(void)
Returns the value used for clearing of the stencil buffer.
Definition: buffer_clearing.hpp:548
ClrBits DepthBuffer(void)
Calling this member function causes the depth buffer to be cleared.
Definition: buffer_clearing.hpp:123
static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLuint *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:381
static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLfloat *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:436
static void ClearDepthBuffer(GLfloat value)
Clears the depth buffer.
Definition: buffer_clearing.hpp:465
~ClrBits(void)
The destructor does the actual clearing of the buffers.
Definition: buffer_clearing.hpp:172
static void ClearColorBuffer(GLint draw_buffer, const GLint *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:300
static void ClearStencilBuffer(GLfloat depth_value, GLint stencil_value)
Clears the depth and the stencil buffer.
Definition: buffer_clearing.hpp:497
static ClrBits Clear(void)
Clears buffers specified by calling functions of the returned object.
Definition: buffer_clearing.hpp:256
static void ClearColorBuffer(GLint draw_buffer, const GLuint *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:355
static void ClearDepth(GLclampd d)
Sets the clear depth.
Definition: buffer_clearing.hpp:207
This template serves as a wrapper for OpenGL bitfields.
Definition: bitfield.hpp:56
GLfloat Alpha(void) const
The alpha component.
Definition: buffer_clearing.hpp:58
static void ClearStencil(GLint s)
Sets the clear stencil buffer value.
Definition: buffer_clearing.hpp:227
BufferSelectBit ClearBit
Draw buffer clear bit enumeration.
Definition: buffer_clearing.hpp:27
static void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
Sets the clear color.
Definition: buffer_clearing.hpp:193
static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLint *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:326
Helper macro for optional checking of availability of GL function.
static void ClearStencilBuffer(GLint value)
Clears the stencil buffer.
Definition: buffer_clearing.hpp:481
GLfloat Blue(void) const
The blue component.
Definition: buffer_clearing.hpp:52
Wrapper for the operations that are used to clear the draw buffers.
Definition: buffer_clearing.hpp:183
GLfloat Red(void) const
The red component.
Definition: buffer_clearing.hpp:40
static void ClearColorBuffer(GLint draw_buffer, const GLfloat *value)
Clears the specified color draw buffer.
Definition: buffer_clearing.hpp:410
Color, depth or stencil buffer selection bit enumeration.
Exception class for general OpenGL errors.
Definition: basic.hpp:43
Helper class used by BufferClearing::Clear()
Definition: buffer_clearing.hpp:77
static oglplus::context::RGBAValue ColorClearValue(void)
Returns the color value used for clearing of the color buffer.
Definition: buffer_clearing.hpp:516
ClrBits StencilBuffer(void)
Calling this member function causes the stencil buffer to be cleared.
Definition: buffer_clearing.hpp:133
static GLfloat DepthClearValue(void)
Returns the depth value used for clearing of the depth buffer.
Definition: buffer_clearing.hpp:532
ColorBuffer
Enumeration of color buffers for read/write operations.
Definition: color_buffer.hpp:28
ClrBits ColorBuffer(void)
Calling this member function causes the color buffer to be cleared.
Definition: buffer_clearing.hpp:113
BufferSelectBit
Buffer selection bit enumeration.
Definition: buffer_select_bit.hpp:29
Helper structure storing the clear color components.
Definition: buffer_clearing.hpp:34