This section describes classes and functions wrapping operations on the current OpenGL context, which are not related to any explicitly allocated object or resource, i.e. operations like enabling and disabling various OpenGL capabilities and changing the state values of the current context.
Context
#include
<oglplus/context.hpp>
Context
is a stateless class wrapping all current GL
context operations. The actual functionality is implemented by subclasses
in the context
namespace, but the library end-users
should rarely need to use them directly.
class Context : public context::Errors , public context::Capabilities , public context::ClipControlState , public context::ViewportState , public context::ViewportOps , public context::BufferSelection , public context::BufferMaskingState , public context::BufferClearingState , public context::BufferClearingOps , public context::RasterizationState , public context::RasterizationOps , public context::DrawingState , public context::DrawingOps , public context::ComputingOps , public context::DepthTest , public context::StencilTest , public context::ScissorTest , public context::LogicOpState , public context::PixelState , public context::PixelOps , public context::BlendingOps , public context::BlendingState , public context::Synchronization , public context::Hints , public context::LimitQueries , public context::NumericQueries , public context::StringQueries , public context::ObjectBinding , public context::ObjectDSA { };
Context gl; std::cout << "Vendor: " << gl.Vendor() << std::endl; std::cout << "Version: " << gl.Version() << std::endl; std::cout << "Major version: " << gl.MajorVersion() << std::endl; std::cout << "Minor version: " << gl.MinorVersion() << std::endl; std::cout << "GLSL Version: " << gl.ShadingLanguageVersion() << std::endl; std::cout << "Renderer: " << gl.Renderer() << std::endl; std::cout << "Extensions:" << std::endl; for(auto r=gl.Extensions(); !r.Empty(); r.Next()) { std::cout << '\t' << r.Front() << std::endl; } std::cout << "Limits:" << std::endl; for(auto r=EnumValueRange<LimitQuery>(); !r.Empty(); r.Next()) { auto ev = r.Front(); std::cout << EnumValueName(ev).c_str() << ": "; try { std::cout << gl.FloatLimit(ev); } catch(...){ std::cout << "N/A"; } std::cout << std::endl; } gl.ClearColor(0.3f, 0.3f, 0.3f, 0.0f); gl.ClearDepth(1.0f); gl.Disable(Capability::DepthTest); gl.Enable(Capability::Blend); gl.BlendFunc(BlendFunction::SrcAlpha, BlendFunction::OneMinusSrcAlpha); gl.LineWidth(1.5f); gl.Viewport(800, 600); gl.Clear().ColorBuffer().DepthBuffer().StencilBuffer(); Program prog; VertexArray vao; /* ... */ gl.Use(prog); gl.Bind(vao); gl.DrawArrays(PrimitiveType::TriangleStrip, 0, n); gl.DrawElements(PrimitiveType::TriangleStrip, m, DataType::UnsignedInt);
#include
<oglplus/context/errors.hpp>
namespace context { class Errors { public: static ErrorCode GetError(void); }; } // namespace context
Returns the currently set ErrorCode.
See |
#include
<oglplus/context/capabilities.hpp>
namespace context { class Capabilities { public: static void Enable(Capability capability); static void Enable(Functionality functionality, GLuint number); static void Disable(Capability capability); static void Disable(Functionality functionality, GLuint number); static Boolean IsEnabled(Capability capability); static Boolean IsEnabled(Functionality functionality, GLuint number); #if GL_VERSION_3_0 static void Enable(Capability capability, GLuint index); static void Disable(Capability capability, GLuint index); static Boolean IsEnabled(Capability capability, GLuint index); #endif }; } // namespace context
Enables the specified |
|
Enables the specified |
|
Disables the specified |
|
Disables the specified |
|
Checks is the specified |
|
Checks is the specified |
|
Enables the specified |
|
Disables the specified |
|
Checks if the specified |
#include
<oglplus/context/clip_control.hpp>
namespace context { struct ClipControlParams { ClipControlParams(void) noexcept; ClipControlParams(ClipOrigin origin, ClipDepthMode depth) noexcept; ClipOrigin Origin(void) const noexcept; ClipDepthMode DepthMode(void) const noexcept; };
class ClipControlState { public: #if GL_VERSION_4_5 || GL_ARB_clip_control static void ClipControl(ClipOrigin origin, ClipDepthMode depth); static ClipOrigin ClipOrigin(void); static ClipDepthMode ClipDepthMode(void); static void ClipControl(const context::ClipControlParams& params); static context::ClipControlParams ClipControl(void); #endif }; } // namespace context
Sets the clipping mode. See |
|
Queries the current clip origin setting. See |
|
Queries the current clip depth mode setting. See |
|
Sets the clipping control parameters. |
|
Returns the clipping control parameters. |
#include
<oglplus/context/viewport.hpp>
namespace context { struct ViewportPosition { GLfloat X(void) const noexcept; GLfloat Y(void) const noexcept; }; struct ViewportSize { GLfloat Width(void) const noexcept; GLfloat Height(void) const noexcept; }; struct ViewportExtents { GLfloat X(void) const noexcept; GLfloat Y(void) const noexcept; GLfloat Width(void) const noexcept; GLfloat Height(void) const noexcept; }; struct BoundsRange { GLfloat Min(void) const noexcept; GLfloat Max(void) const noexcept; }; struct ViewportDepthRange { GLfloat Near(void) const noexcept; GLfloat Far(void) const noexcept; };
Helper structure storing position in a 2D viewport. |
|
Helper structure storing the dimensions of a 2D viewport. |
|
Helper structure storing the extents of a 2D viewport. |
|
Helper structure storing the min/max bounds range. |
|
Helper structure storing the near/far depth range. |
class ViewportState { public: static void Viewport(GLint x, GLint y, SizeType w, SizeType h); static void Viewport(SizeType w, SizeType h); static void Viewport(const context::ViewportExtents& vp); static context::ViewportExtents Viewport(void); static void DepthRange(GLclampf near, GLclampf far); static void DepthRange(const context::ViewportDepthRange&); static context::ViewportDepthRange DepthRange(void); #if GL_VERSION_4_1 || GL_ARB_viewport_array static void Viewport( ViewportIndex viewport, const GLfloat* extents ); static void Viewport( ViewportIndex viewport, GLfloat x, GLfloat y, GLfloat width, GLfloat height ); static void Viewport( ViewportIndex viewport, const context::ViewportExtents& ); static void ViewportArray( GLuint first, SizeType count, const GLfloat* extents ); static context::ViewportExtents Viewport(ViewportIndex viewport); static void DepthRange( ViewportIndex viewport, GLclampd near, GLclampd far ); static void DepthRange( ViewportIndex viewport, const context::ViewportDepthRange& ); static void DepthRangeArray(GLuint first, SizeType count, const GLclampd *v); static context::ViewportDepthRange DepthRange(ViewportIndex viewport); #endif };
Sets the extents of the current viewport. See |
|
Sets the size of the current viewport starting at (0,0). See |
|
Returns the extents of the current viewport. See |
|
Sets the |
|
Returns the depth range values of the current viewport. See |
|
Sets the |
|
Sets the extents of the specified |
|
Sets |
|
Returns the extents of the specified |
|
Sets the |
|
Sets depth ranges of viewports specified by |
|
Returns the depth range of the specified |
class ViewportOps { public: static ViewportSize MaxViewportDims(void); #if GL_VERSION_4_1 || GL_ARB_viewport_array static GLuint MaxViewports(void); static BoundsRange ViewportBoundsRange(void); #endif }; } // namespace context
#include
<oglplus/context/buffer_selection.hpp>
namespace context { class BufferSelection { public: typedef OneOf< oglplus::ColorBuffer, oglplus::FramebufferColorAttachment > ColorBuffer; static void DrawBuffer(ColorBuffer buffer); static void DrawBuffers(const EnumArray<ColorBuffer>& buffers); static void DrawBuffers(SizeType count, const ColorBuffer* buffers); static void ReadBuffer(ColorBuffer buffer); }; } // namespace context
Color buffer specification type. |
|
Sets the destination color buffer for draw operations. See |
|
Sets the destination color buffers for draw operations. See |
|
Sets the source color buffer for read operations. See |
#include
<oglplus/context/buffer_masking.hpp>
namespace context { class BufferMaskingState { public: static void ColorMask( Boolean r, Boolean g, Boolean b, Boolean a ); static void ColorMask(const context::RGBAMask&); static context::RGBAMask ColorWriteMask(void); #if GL_VERSION_3_0 static void ColorMask( DrawBufferIndex buffer, Boolean r, Boolean g, Boolean b, Boolean a ); static void ColorMask(DrawBufferIndex buffer, const context::RGBAMask&); static context::RGBAMask ColorWriteMask(DrawBufferIndex buffer); #endif static void DepthMask(Boolean mask); static Boolean DepthWriteMask(void); static void StencilMask(GLuint mask); static void StencilMaskSeparate(Face face, GLuint mask); static void StencilMaskSeparateSingle(SingleFace face, GLuint mask); static GLuint StencilWriteMask(bool backface = false); static GLuint StencilWriteMask(Face face); static GLuint StencilWriteMaskSingle(SingleFace face); }; } // namespace context
Sets the color mask for the default color buffer. See |
|
Returns the value of color buffer write mask. See |
|
Sets the color mask for the specified color |
|
Returns the value of color buffer write mask. See |
|
Sets the depth buffer |
|
Returns the value of depth buffer write mask. See |
|
Sets the stencil buffer |
|
Sets the stencil mask separately for front and back faces. See |
|
Returns the value of stencil buffer write mask. See |
#include
<oglplus/context/buffer_clearing.hpp>
typedef BufferSelectBit ClearBit; namespace context { class ClrBits { public: ClrBits ColorBuffer(void); ClrBits DepthBuffer(void); ClrBits StencilBuffer(void); ~ClrBits(void); };
Helper class used by |
|
Calling this member function causes the color buffer to be marked
for clearing. See |
|
Calling this member function causes the depth buffer to be marked
for clearing. See |
|
Calling this member function causes the stencil buffer to be marked
for clearing. See |
|
The destructor does the actual clearing of the buffers. See |
The BufferClearing
class is a wrapper for the operations,
which are used to clear the draw buffers.
class BufferClearingState { public: static void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a); static void ClearColor(const context::RGBAValue&); static context::RGBAValue ColorClearValue(void); static void ClearDepth(GLclampd d); static GLfloat DepthClearValue(void); static void ClearStencil(GLint s); static GLint ClearStencilValue(void); };
Sets the clear color components. See |
|
Returns the value used for clearing of the color buffer. See |
|
Sets the clear depth value. See |
|
Returns the value used for clearing of the depth buffer. See |
|
Sets the clear stencil buffer value. See |
|
Returns the value used for clearing of the depth buffer. See |
class BufferClearingOps { public: static void Clear(Bitfield<ClearBit> bits); static ClrBits Clear(void); static void ClearColorBuffer(GLint draw_buffer, const GLint* value); static void ClearColorBuffer(GLint draw_buffer, const GLuint* value); static void ClearColorBuffer(GLint draw_buffer, const GLfloat* value); static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLint* value); static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLuint* value); static void ClearColorBuffer(ColorBuffer buffer, GLint draw_buffer, const GLfloat* value); static void ClearDepthBuffer(GLfloat value); static void ClearStencilBuffer(GLint value); static void ClearStencilBuffer(GLfloat depth_value, GLint stencil_value); }; } // namespace context
Clears buffers specified by the bits parameter. |
|
Clears buffers specified by calling functions of the returned object
This function returns an object that allows to specify which buffers
to clear by calling its |
|
Clears the color draw buffer of the currently bound framebuffer with
the specified |
|
Clears the specified color draw buffer of the currently bound framebuffer
with the specified |
|
Clears the depth buffer of the currently bound framebuffer with the
specified |
|
Clears the stencil buffer of the currently bound framebuffer with
the specified |
|
Clears the depth and the stencil buffer of the currently bound framebuffer
with the specified values. See |
#include
<oglplus/context/rasterization.hpp>
namespace context { class PolygonModes { public: PolygonModes(void) noexcept; PolygonModes(PolygonMode mode) noexcept; PolygonModes(PolygonMode front, PolygonMode back) noexcept; PolygonMode Front(void) const noexcept; PolygonMode Back(void) const noexcept; }; struct PolygonOffsPara { PolygonOffsPara(void) noexcept; PolygonOffsPara(GLfloat factor, GLfloat units) noexcept; GLfloat Factor(void) const noexcept; GLfloat Units(void) const noexcept; };
class RasterizationState { public: static void FrontFace(FaceOrientation orientation); static FaceOrientation FrontFace(void); static void CullFace(Face mode); static Face CullFaceMode(void); #if GL_VERSION_3_0 static void PolygonMode(Face face, PolygonMode mode); static void PolygonMode(PolygonMode mode); static void PolygonMode(const context::PolygonModes&); static PolygonMode PolygonModeFront(void); static PolygonMode PolygonModeBack(void); static context::PolygonModes PolygonMode(void); #endif static void PolygonOffset(GLfloat factor, GLfloat units); static void PolygonOffset(const context::PolygonOffsPara&); static GLfloat PolygonOffsetFactor(void); static GLfloat PolygonOffsetUnits(void); static context::PolygonOffsPara PolygonOffset(void); static void LineWidth(GLfloat width); static GLfloat LineWidth(void); #if GL_VERSION_3_0 static void PointSize(GLfloat size); static GLfloat PointSize(void); static void PointFadeThresholdSize(GLfloat size); static GLfloat PointFadeThresholdSize(void); #endif
Sets the polygon facing mode. See |
|
Sets the face culling mode. See |
|
Sets the polygon rasterization mode. See |
|
Sets the polygon rasterization mode. See |
|
Returns the face culling mode. See |
|
Sets the polygon depth offset. See |
|
Returns the current polygon offset factor. See |
|
Returns the current polygon offset units. See |
|
Sets the line current width. See |
|
Returns the line width. See |
|
Sets the point size. See |
|
Returns the current point size. See |
|
Sets the point fade threshold size. See |
|
Returns the current point fade threshold size. See |
class RasterizationOps { public: static GLint SampleBuffers(void); static GLint Samples(void); #if GL_VERSION_3_2 static Vec2f SamplePosition(GLuint index); #endif }; } // namespace context
#include
<oglplus/context/drawing.hpp>
namespace context { class DrawingState { public: #if GL_VERSION_3_1 static void PrimitiveRestartIndex(GLuint index); static GLuint PrimitiveRestartIndex(void); #endif #if GL_ARB_tessellation_shader || GL_VERSION_4_0 static void PatchParameter( PatchParameter parameter, GLint value ); #endif };
Sets the primitive restart index. See |
|
Sets a patch parameter value. See |
class DrawingOps { public: static void DrawArrays( PrimitiveType primitive, GLint first, SizeType count ); #if GL_VERSION_3_1 static void DrawArraysInstanced( PrimitiveType primitive, GLint first, SizeType count, SizeType inst_count ); #endif #if GL_VERSION_4_2 static void DrawArraysInstancedBaseInstance( PrimitiveType primitive, GLint first, SizeType count, SizeType inst_count, SizeType base_instance ); #endif #if GL_VERSION_4_0 || GL_ARB_draw_indirect static void DrawArraysIndirect( PrimitiveType primitive, const void* indirect =nullptr
); #endif #if GL_VERSION_3_0 static void MultiDrawArrays( PrimitiveType primitive, const GLint* first, const GLsizei* count, SizeType primcount ); #endif #if GL_VERSION_4_3 || GL_ARB_multi_draw_indirect static void MultiDrawArraysIndirect( PrimitiveType primitive, SizeType draw_count, SizeType stride = 0, const void* indirect =nullptr
); #endif static void DrawElements( PrimitiveType primitive, SizeType count, DataType data_type ); template <typename T> static void DrawElements( PrimitiveType primitive, SizeType count, const T* indices ); static void DrawElementsInstanced( PrimitiveType primitive, SizeType count, DataType data_type, SizeType instance_count );
Draws a range of primitives of the specified type from the bound
array buffers. See |
|
Draws multiple instances of a range of elements. See |
|
Draws multiple instances of a range of elements with offset applied
to instanced attributes. See |
|
Draws primitives from an indirect buffer. See |
|
Draws multiple primcount ranges of primitives from the bound array
buffers. See |
|
See |
|
template <typename T> static void DrawElementsInstanced( PrimitiveType primitive, SizeType count, const T* indices, SizeType instance_count ); #if GL_VERSION_4_2 static void DrawElementsInstancedBaseInstance( PrimitiveType primitive, SizeType count, DataType data_type, SizeType inst_count, GLuint base_instance ); template <typename T> static void DrawElementsInstancedBaseInstance( PrimitiveType primitive, SizeType count, const T* indices, SizeType inst_count, GLuint base_instance ); #endif static void MultiDrawElements( PrimitiveType primitive, const GLsizei* count, DataType data_type, SizeType draw_count ); template <typename T> static void MultiDrawElements( PrimitiveType primitive, const GLsizei* count, T* const * indices, SizeType draw_count ); static void DrawRangeElements( PrimitiveType primitive, GLuint start, GLuint end, SizeType count, DataType data_type ); template <typename T> static void DrawRangeElements( PrimitiveType primitive, GLuint start, GLuint end, SizeType count, const T* indices ); #if GL_VERSION_4_0 || GL_ARB_draw_indirect static void DrawElementsIndirect( PrimitiveType primitive, DataType data_type, const void* indirect =nullptr
); #endif #if GL_VERSION_4_3 static void MultiDrawElementsIndirect( PrimitiveType primitive, DataType data_type, SizeType draw_count, SizeType stride = 0, const void* indirect =nullptr
); #endif #if GL_VERSION_3_2 || GL_ARB_draw_elements_base_vertex static void DrawElementsBaseVertex( PrimitiveType primitive, SizeType count, DataType data_type, GLint base_vertex ); template <typename T> static void DrawElementsBaseVertex( PrimitiveType primitive, SizeType count, const T* indices, GLint base_vertex ); static void DrawRangeElementsBaseVertex( PrimitiveType primitive, GLuint start, GLuint end, SizeType count, DataType data_type, GLint base_vertex ); template <typename T> static void DrawRangeElementsBaseVertex( PrimitiveType primitive, GLuint start, GLuint end, SizeType count, const T* indices, GLint base_vertex ); static void DrawElementsInstancedBaseVertex( PrimitiveType primitive, SizeType count, DataType data_type, SizeType inst_count, GLint base_vertex ); template <typename T> static void DrawElementsInstancedBaseVertex( PrimitiveType primitive, SizeType count, const T* indices, SizeType inst_count, GLint base_vertex ); static void MultiDrawElementsBaseVertex( PrimitiveType primitive, const GLsizei* count, DataType data_type, SizeType draw_count, const GLint* base_vertex ); template <typename T> static void MultiDrawElementsBaseVertex( PrimitiveType primitive, const GLsizei* count, T* const * indices, SizeType draw_count, const GLint* base_vertex ); #endif #if GL_VERSION_4_2 static void DrawElementsInstancedBaseVertexBaseInstance( PrimitiveType primitive, SizeType count, DataType data_type, SizeType inst_count, GLint base_vertex, GLuint base_instance ); template <typename T> static void DrawElementsInstancedBaseVertexBaseInstance( PrimitiveType primitive, SizeType count, const T* indices, SizeType inst_count, GLint base_vertex, GLuint base_instance ); #endif #if GL_VERSION_4_0 || GL_ARB_transform_feedback2 static void DrawTransformFeedback( PrimitiveType primitive, TransformFeedbackName xfb ); #endif #if GL_NV_draw_texture static void DrawTexture( TextureName texture, SamplerName sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1 ); #endif }; } // namespace context
See |
|
See |
|
See |
#include
<oglplus/context/computing.hpp>
namespace context { class ComputingOps { public: #if GL_VERSION_4_3 static void DispatchCompute( GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z ); static void DispatchComputeIndirect(GLintptr indirect); #endif }; } // namespace context
Launches the specified number of compute work groups. See |
|
Launches indirectly several compute work groups. See |
#include
<oglplus/context/depth_test.hpp>
namespace context { class DepthTest { public: static void DepthFunc(CompareFunction function); static CompareFunction DepthFunc(void); }; } // namespace context
Sets the depth comparison |
|
Returns the currently set depth comparison function. See |
#include
<oglplus/context/stencil_test.hpp>
namespace context { struct StencilFuncArgs { StencilFuncArgs(void) noexcept; StencilFuncArgs( CompareFunction func, GLint refv = GLint(0), GLuint mask = ~GLuint(0) ) noexcept; CompareFunction Func(void) const noexcept; GLint Ref(void) const noexcept; GLuint ValueMask(void) const noexcept; friend bool operator == (const StencilFuncArgs& a, const StencilFuncArgs& b) noexcept; friend bool operator != (const StencilFuncArgs& a, const StencilFuncArgs& b) noexcept; };
struct StencilOperations { StencilOperations(void) noexcept; StencilOperations( StencilOperation sfail, StencilOperation dfail, StencilOperation dpass ) noexcept; StencilOperation StencilFail(void) const noexcept; StencilOperation DepthFail(void) const noexcept; StencilOperation DepthPass(void) const noexcept; friend bool operator == (const StencilOperations& a, const StencilOperations& b) noexcept; friend bool operator != (const StencilOperations& a, const StencilOperations& b) noexcept; };
class StencilTest { public: static void StencilFunc( CompareFunction function, GLint ref = GLint(0), GLuint mask = ~GLuint(0) ); static void StencilFunc(const StencilFuncArgs& fa); static void StencilFuncSeparate( Face face, CompareFunction function, GLint ref = GLint(0), GLuint mask = ~GLuint(0) ); static void StencilFuncSeparate( Face face, const StencilFuncArgs& fa ); static void StencilFuncSeparateSingle( SingleFace face, CompareFunction function, GLint ref = GLint(0), GLuint mask = ~GLuint(0) ); static void StencilFuncSeparateSingle( SingleFace face, const StencilFuncArgs& fa ); static void StencilOp( StencilOperation sfail, StencilOperation dfail, StencilOperation dpass ); static void StencilOpSeparate( Face face, StencilOperation sfail, StencilOperation dfail, StencilOperation dpass ); static void StencilOpSeparateSingle( SingleFace face, StencilOperation sfail, StencilOperation dfail, StencilOperation dpass ); static CompareFunction StencilFunc(bool backface = false); static CompareFunction StencilFunc(Face face); static GLuint StencilValueMask(bool backface = false); static GLuint StencilValueMask(Face face); static GLuint StencilRef(bool backface = false); static GLuint StencilRef(Face face); static StencilFuncArgs StencilFuncArgs(Face face); static StencilFuncArgs StencilFuncArgsSingle(SingleFace face); static StencilOperation StencilFail(bool backface = false); static StencilOperation StencilFail(Face face); static StencilOperation StencilPassDepthFail(bool backface = false); static StencilOperation StencilPassDepthFail(Face face); static StencilOperation StencilPassDepthPass(bool backface = false); static StencilOperation StencilPassDepthPass(Face face) static StencilOperations StencilOps(bool backface = false); static StencilOperations StencilOps(Face face); static StencilOperations StencilOpsSingle(SingleFace face); }; } // namespace context
Sets the stencil |
|
Sets the stencil |
|
Sets the stencil operations. See |
|
Sets the stencil operations separately for front and back |
|
Returns the currently set stencil function. See |
|
Returns the currently set value of stencil mask. See |
|
Returns the currently set stencil reference value. See |
|
Returns the currently set stencil function arguments. |
|
Returns the stencil-fail action. See |
|
Returns the stencil-pass depth-fail action. See |
|
Returns the stencil-pass depth-fail action. See |
#include
<oglplus/context/scissor_test.hpp>
namespace context { struct ScissorRectangle { GLint X(void) const noexcept; GLint Y(void) const noexcept; GLint Left(void) const noexcept; GLint Bottom(void) const noexcept; GLint Width(void) const noexcept; GLint Height(void) const noexcept; }; class ScissorTest { public: static void Scissor( GLint left, GLint bottom, SizeType width, SizeType height ); #if GL_VERSION_4_1 || GL_ARB_viewport_array static void Scissor( ViewportIndex viewport, GLint left, GLint bottom, SizeType width, SizeType height ); static void Scissor(ViewportIndex viewport, GLint* v); static void ScissorArray(GLuint first, SizeType count, GLint* v); static context::ScissorRectangle ScissorBox(ViewportIndex viewport); #endif }; } // namespace context
Defines the scissor rectangle for the first viewport. See |
|
Defines the scissor rectangle for the specified |
|
Defines scissor rectangles for viewports specified by |
|
Returns the extents of scissor box of the specified |
#include
<oglplus/context/logic_ops.hpp>
namespace context { class LogicOpState { public: #if GL_VERSION_3_0 static void LogicOp(ColorLogicOperation op); static ColorLogicOperation LogicOpMode(void); #endif }; } // namespace context
#include
<oglplus/context/pixel_ops.hpp>
namespace context { class PixelState { public: static void PixelStore(PixelParameter parameter, GLfloat value); static void PixelStore(PixelParameter parameter, GLint value); template <PixelParameter Parameter> static void PixelStore(<Unspecified> value); static GLfloat PixelStoreValue( PixelParameter parameter, TypeTag<float> ); static GLint PixelStoreValue( PixelParameter parameter, TypeTag<int> ); static Boolean PixelStoreValue( PixelParameter parameter, TypeTag<bool> ); template <PixelParameter Parameter> static <Unspecified> PixelStoreValue(void); };
Sets the |
|
Sets the |
|
Gets the |
|
Gets the |
class PixelOps { public: static void ReadPixels( GLint x, GLint y, SizeType width, SizeType height, PixelDataFormat format, PixelDataType type, void* data ); static void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, Bitfield<BufferSelectBit> mask, BlitFilter filter ); }; } // namespace context
Reads a block of pixels from the current framebuffer. See |
|
Transfers a rectangle of pixels from the read buffer the draw buffer.
See |
#include
<oglplus/context/blending.hpp>
namespace context { struct BlendEquationSeparate { BlendEquationSeparate(void) noexcept; BlendEquationSeparate(BlendEquation rgb, BlendEquation alpha) noexcept; BlendEquation RGB(void) const noexcept; BlendEquation Alpha(void) const noexcept; }; struct BlendFunctionSeparate { BlendFunctionSeparate(void) noexcept; BlendFunctionSeparate( BlendFunction src_rgb, BlendFunction src_alpha, BlendFunction dst_rgb, BlendFunction dst_alpha ) noexcept; BlendFunction SrcRGB(void) const noexcept; BlendFunction SrcAlpha(void) const noexcept; BlendFunction DstRGB(void) const noexcept; BlendFunction DstAlpha(void) const noexcept; };
class BlendingOps { public: #if GL_KHR_blend_equation_advanced static void BlendBarrier(void); #endif };
class BlendingState { public: static void BlendEquation(OneOf<BlendEquation, BlendEquationAdvanced> eq); static void BlendEquationSeparate( BlendEquation eq_rgb, BlendEquation eq_alpha ); static void BlendEquationSeparate(const context::BlendEquationSeparate&); static context::BlendEquationSeparate BlendEquationSeparate(void); static BlendEquation BlendEquationRGB(void); static BlendEquation BlendEquationAlpha(void); #if GL_VERSION_4_0 static void BlendEquation( DrawBufferIndex buffer, OneOf<BlendEquation, BlendEquationAdvanced> eq ); static void BlendEquationSeparate( DrawBufferIndex buffer, BlendEquation eq_rgb, BlendEquation eq_alpha ); static void BlendEquationSeparate( DrawBufferIndex buffer, const context::BlendEquationSeparate& ); static context::BlendEquationSeparate BlendEquationSeparate(DrawBufferIndex buffer); static BlendEquation BlendEquationRGB(DrawBufferIndex buffer); static BlendEquation BlendEquationAlpha(DrawBufferIndex buffer); #endif static void BlendFunc(BlendFunction src, BlendFunction dst); static void BlendFuncSeparate( BlendFunction src_rgb, BlendFunction dst_rgb, BlendFunction src_alpha, BlendFunction dst_alpha ); static void BlendFuncSeparate(const context::BlendFunctionSeparate&); static context::BlendFunctionSeparate BlendFuncSeparate(void); static BlendFunction BlendFuncSrcRGB(void); static BlendFunction BlendFuncSrcAlpha(void); static BlendFunction BlendFuncDstRGB(void); static BlendFunction BlendFuncDstAlpha(void); #if GL_VERSION_4_0 static void BlendFunc( DrawBufferIndex buffer, BlendFunction src, BlendFunction dst ); static void BlendFuncSeparate( DrawBufferIndex buffer, BlendFunction src_rgb, BlendFunction dst_rgb, BlendFunction src_alpha, BlendFunction dst_alpha ); static void BlendFuncSeparate( DrawBufferIndex buffer, const context::BlendFunctionSeparate& ); static context::BlendFunctionSeparate BlendFuncSeparate(DrawBufferIndex buffer); static BlendFunction BlendFuncSrcRGB(DrawBufferIndex buffer); static BlendFunction BlendFuncSrcAlpha(DrawBufferIndex buffer); static BlendFunction BlendFuncDstRGB(DrawBufferIndex buffer); static BlendFunction BlendFuncDstAlpha(DrawBufferIndex buffer); #endif static void BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a); static void BlendColor(const context::RGBAValue&); static context::RGBAValue BlendColor(void); }; } // namespace context
Sets the blending equation. See |
|
Sets the blend equation separately for RGB and alpha. See |
|
Sets the blend equation for a particular draw |
|
Sets the blend equation separate for RGB and alpha for the specified
draw |
|
Sets the blend function. See |
|
Sets the blend function separately for RGB and alpha. See |
|
Sets the blend function for a particular draw |
|
Sets the blend function separately for RGB and alpha for a particular
draw |
#include
<oglplus/context/synchronization.hpp>
namespace context { class Synchronization { public: #if GL_VERSION_4_2 || GL_ARB_shader_image_load_store static void MemoryBarrier(Bitfield<MemoryBarrierBit> bits); #endif static void Flush(void); static void Finish(void); }; } // namespace context
Defines a barrier ordering memory transactions. See |
|
Requests that all previous GL commands finish in finite time. See
|
|
Forces all previous GL commands to complete before returning. See
|
#include
<oglplus/context/hints.hpp>
namespace context { class Hints { public: static void Hint(HintTarget target, HintOption option); static HintOption Hint(HintTarget target); }; } // namespace context
Sets a hint |
|
Queries the currently set hint option for a hint |
#include
<oglplus/context/limit_queries.hpp>
namespace context { class LimitQueries { public: static GLint IntLimit(LimitQuery query); static GLint IntLimit(LimitQuery query, GLuint index); static GLfloat FloatLimit(LimitQuery query); #if GL_VERSION_4_1 || GL_ARB_viewport_array static GLfloat FloatLimit(LimitQuery query, GLuint index); #endif template <LimitQuery Query> static <Unspecified> Limit(void); template <LimitQuery Query> static <Unspecified> Limit(GLuint index); static void RequireAtLeast(LimitQuery limit, GLint value); static void RequireAtLeast(LimitQuery limit, GLuint index, GLint value); }; } // namespace context
Gets the implementation-dependent integer limit value. See |
|
Gets the implementation-dependent integer indexed limit value. See
|
|
Gets the implementation-dependent floating-point limit value. See
|
|
Gets the implementation-dependent floating-point indexed limit value.
See |
|
Gets the implementation-dependent numeric/boolean limit value. The
return value has an appropriate type to hold the value of the parameter
being retrieved. See |
|
Gets the implementation-dependent numeric/boolean indexed limit value.
The return value has an appropriate type to hold the value of the
parameter being retrieved. See |
|
Raises a LimitError
if |
#include
<oglplus/context/numeric_queries.hpp>
namespace context { class NumericQueries { public: static GLint MajorVersion(void); static GLint MinorVersion(void); #if GL_VERSION_3_3 || GL_ARB_timer_query static GLint64 Timestamp(void); #endif #if GL_VERSION_3_2 static Bitfield<ContextProfileBit> ProfileMask(void); static Bitfield<ContextFlagBit> Flags(void); #endif #if GL_VERSION_4_5 || GL_KHR_context_flush_control static ContextReleaseBehavior ReleaseBehavior(void); #endif #if GL_VERSION_4_5 static ResetNotificationStrategy ResetNotificationStrategy(void); static GraphicsResetStatus GraphicsResetStatus(void); #endif }; } // namespace context
Returns the GL major version. See |
|
Returns the GL minor version. See |
|
Queries the current GL timestamp. See |
|
Returns the GL context profile mask. See |
|
Returns the current context flags. See |
|
Returns the current context flush control reset behavior. See |
|
Returns the currently active context reset notification strategy.
See |
|
Returns the current GL context reset status. See |
#include
<oglplus/context/string_queries.hpp>
namespace context { class StringQueries { public: static const GLubyte* GetString(StringQuery query); static const char* Vendor(void); static const char* Renderer(void); static const char* Version(void); static const char* ShadingLanguageVersion(void); #if GL_VERSION_4_3 static GLuint NumShadingLanguageVersions(void); static const GLubyte* ShadingLanguageVersion(GLuint index); static Range<StrCRef> ShadingLanguageVersions(void); #endif static GLuint NumExtensions(void); static const GLubyte* Extensions(GLuint index); static Range<StrCRef> Extensions(void); }; } // namespace context
Queries a string describing GL properties. See |
|
Returns the name of the GL implementation vendor. See |
|
Returns the renderer name string. See |
|
Returns the version string of the GL implementation. See |
|
Returns the shading language version string of the GL implementation.
See |
|
Queries the number of supported shading language versions. See |
|
Returns the name of |
|
Returns a range of supported GLSL version strings. See |
|
Queries the number of extension strings. See |
|
Returns the name of the |
|
Returns a range of extension name strings. See |
#include
<oglplus/context/object_binding.hpp>
namespace context { class ObjectBinding { public: template <typename Object> static void Bind(typename Object::Target target, const Object& object); template <typename Object> static void Bind( typename Object::IndexedTarget target, GLuint index, const Object& object ); template <typename Object> static void Bind(const Object& object); template <typename Object> static void Use(const Object& object); template <typename Object> static Reference<ObjectOps< tag::CurrentBound, ObjTag >> Current(void); template <typename ObjectTarget> static Reference<ObjectOps< tag::CurrentBound, ObjTag >> Current(ObjectTarget target); template <typename Object> static Reference<ObjectOps< tag::CurrentBound, ObjTag >> Bound(typename Object::Target target, const Object& object); }; } // namespace context
Binds the specified |
|
Binds the specified |
|
Binds the specified object to the appropriate binding point. Equivalent
to |
|
Uses (makes current) the specified |
|
Returns the currently bound (active) instance of the specified |
|
Returns the object currently bound to the specified object |
|
Binds an |
#include
<oglplus/context/object_dsa.hpp>
namespace context { class ObjectDSA { public: // TODO }; } // namespace context
namespace context { struct RGBAValue { RGBAValue(void) noexcept; RGBAValue(GLfloat r, GLfloat g, GLfloat b, GLfloat a) noexcept; GLfloat Red(void) const noexcept; GLfloat Green(void) const noexcept; GLfloat Blue(void) const noexcept; GLfloat Alpha(void) const noexcept; };
struct RGBAMask { RGBAMask(void) noexcept; RGBAMask(Boolean r, Boolean g, Boolean b, Boolean a) noexcept; Boolean Red(void) const noexcept; Boolean Green(void) const noexcept; Boolean Blue(void) const noexcept; Boolean Alpha(void) const noexcept; }; } // namespace context