Magnum::GL::Renderer class

Global renderer configuration.

Public types

enum class PolygonFacing: GLenum { Front = GL_FRONT, Back = GL_BACK, FrontAndBack = GL_FRONT_AND_BACK }
Affected polygon facing for culling, stencil operations and masks.

Renderer features

enum class Feature: GLenum { BlendAdvancedCoherent = GL_BLEND_ADVANCED_COHERENT_KHR, Blending = GL_BLEND, DebugOutput = GL_DEBUG_OUTPUT, DebugOutputSynchronous = GL_DEBUG_OUTPUT_SYNCHRONOUS, DepthClamp = GL_DEPTH_CLAMP, DepthTest = GL_DEPTH_TEST, Dithering = GL_DITHER, FaceCulling = GL_CULL_FACE, FramebufferSrgb = GL_FRAMEBUFFER_SRGB, FramebufferSRGB = FramebufferSrgb deprecated, LogicOperation = GL_COLOR_LOGIC_OP, Multisampling = GL_MULTISAMPLE, PolygonOffsetFill = GL_POLYGON_OFFSET_FILL, PolygonOffsetLine = GL_POLYGON_OFFSET_LINE, PolygonOffsetPoint = GL_POLYGON_OFFSET_POINT, ProgramPointSize = GL_PROGRAM_POINT_SIZE, RasterizerDiscard = GL_RASTERIZER_DISCARD, SampleShading = GL_SAMPLE_SHADING, SeamlessCubeMapTexture = GL_TEXTURE_CUBE_MAP_SEAMLESS, ScissorTest = GL_SCISSOR_TEST, StencilTest = GL_STENCIL_TEST }
Features.
enum class Hint: GLenum { FragmentShaderDerivative = GL_FRAGMENT_SHADER_DERIVATIVE_HINT, TextureCompression = GL_TEXTURE_COMPRESSION_HINT }
Hint.
enum class HintMode: GLenum { Fastest = GL_FASTEST, Nicest = GL_NICEST, DontCare = GL_DONT_CARE }
Hint mode.
static auto lineWidthRange() -> Range1D
Line width range.
static void enable(Feature feature)
Enable feature.
static void disable(Feature feature)
Disable feature.
static void setFeature(Feature feature, bool enabled)
Enable or disable feature.
static void setHint(Hint target, HintMode mode)
Set hint.

Clearing values

static void setClearColor(const Color4& color)
Set clear color.
static void setClearDepth(Double depth)
Set clear depth.
static void setClearDepth(Float depth)
static void setClearStencil(Int stencil)
Set clear stencil.

Polygon drawing settings

enum class FrontFace: GLenum { CounterClockWise = GL_CCW, ClockWise = GL_CW }
Front facing polygon winding.
enum class ProvokingVertex: GLenum { FirstVertexConvention = GL_FIRST_VERTEX_CONVENTION, LastVertexConvention = GL_LAST_VERTEX_CONVENTION }
Provoking vertex.
enum class PolygonMode: GLenum { Fill = GL_FILL, Line = GL_LINE, Point = GL_POINT }
Polygon mode.
static void setFrontFace(FrontFace mode)
Set front-facing polygon winding.
static void setFaceCullingMode(PolygonFacing mode)
Which polygon facing to cull.
static void setProvokingVertex(ProvokingVertex mode)
Set provoking vertex.
static void setPolygonMode(PolygonMode mode)
Set polygon drawing mode.
static void setPolygonOffset(Float factor, Float units)
Set polygon offset.
static void setLineWidth(Float width)
Set line width.
static void setPointSize(Float size)
Set point size.
static void setMinSampleShading(Float value)
Set min sample shading value.

Scissor operations

static void setScissor(const Range2Di& rectangle)
Set scissor rectangle.

Stencil operations

enum class StencilFunction: GLenum { Never = GL_NEVER, Always = GL_ALWAYS, Less = GL_LESS, LessOrEqual = GL_LEQUAL, Equal = GL_EQUAL, NotEqual = GL_NOTEQUAL, GreaterOrEqual = GL_GEQUAL, Greater = GL_GREATER }
Stencil function.
enum class StencilOperation: GLenum { Keep = GL_KEEP, Zero = GL_ZERO, Replace = GL_REPLACE, Increment = GL_INCR, IncrementWrap = GL_INCR_WRAP, Decrement = GL_DECR, DecrementWrap = GL_DECR_WRAP, Invert = GL_INVERT }
Stencil operation.
static void setStencilFunction(PolygonFacing facing, StencilFunction function, Int referenceValue, UnsignedInt mask)
Set stencil function.
static void setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask)
Set stencil function.
static void setStencilOperation(PolygonFacing facing, StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass)
Set stencil operation.
static void setStencilOperation(StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass)
Set stencil operation.

Depth testing

using DepthFunction = StencilFunction
Depth function.
static void setDepthFunction(DepthFunction function)
Set depth function.

Masking writes

static void setColorMask(GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha)
Mask color writes.
static void setDepthMask(GLboolean allow)
Mask depth writes.
static void setStencilMask(PolygonFacing facing, UnsignedInt allowBits)
Mask stencil writes.
static void setStencilMask(UnsignedInt allowBits)
Mask stencil writes.

Blending

You have to enable blending with enable() first.

enum class BlendEquation: GLenum { Add = GL_FUNC_ADD, Subtract = GL_FUNC_SUBTRACT, ReverseSubtract = GL_FUNC_REVERSE_SUBTRACT, Min = GL_MIN, Max = GL_MAX, Multiply = GL_MULTIPLY_KHR, Screen = GL_SCREEN_KHR, Overlay = GL_OVERLAY_KHR, Darken = GL_DARKEN_KHR, Lighten = GL_LIGHTEN_KHR, ColorDodge = GL_COLORDODGE_KHR, ColorBurn = GL_COLORBURN_KHR, HardLight = GL_HARDLIGHT_KHR, SoftLight = GL_SOFTLIGHT_KHR, Difference = GL_DIFFERENCE_KHR, Exclusion = GL_EXCLUSION_KHR, HslHue = GL_HSL_HUE_KHR, HslSaturation = GL_HSL_SATURATION_KHR, HslColor = GL_HSL_COLOR_KHR, HslLuminosity = GL_HSL_LUMINOSITY_KHR }
Blend equation.
enum class BlendFunction: GLenum { Zero = GL_ZERO, One = GL_ONE, ConstantColor = GL_CONSTANT_COLOR, OneMinusConstantColor = GL_ONE_MINUS_CONSTANT_COLOR, ConstantAlpha = GL_CONSTANT_ALPHA, OneMinusConstantAlpha = GL_ONE_MINUS_CONSTANT_ALPHA, SourceColor = GL_SRC_COLOR, SecondSourceColor = GL_SRC1_COLOR, OneMinusSourceColor = GL_ONE_MINUS_SRC_COLOR, OneMinusSecondSourceColor = GL_ONE_MINUS_SRC1_COLOR, SourceAlpha = GL_SRC_ALPHA, SourceAlphaSaturate = GL_SRC_ALPHA_SATURATE, SecondSourceAlpha = GL_SRC1_ALPHA, OneMinusSourceAlpha = GL_ONE_MINUS_SRC_ALPHA, OneMinusSecondSourceAlpha = GL_ONE_MINUS_SRC1_ALPHA, DestinationColor = GL_DST_COLOR, OneMinusDestinationColor = GL_ONE_MINUS_DST_COLOR, DestinationAlpha = GL_DST_ALPHA, OneMinusDestinationAlpha = GL_ONE_MINUS_DST_ALPHA }
Blend function.
static void setBlendEquation(BlendEquation equation)
Set blend equation.
static void setBlendEquation(BlendEquation rgb, BlendEquation alpha)
Set blend equation separately for RGB and alpha components.
static void setBlendFunction(BlendFunction source, BlendFunction destination)
Set blend function.
static void setBlendFunction(BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha)
Set blend function separately for RGB and alpha components.
static void setBlendColor(const Color4& color)
Set blend color.
static void blendBarrier()
Blend barrier.

Logical operation

enum class LogicOperation: GLenum { Clear = GL_CLEAR, Set = GL_SET, Copy = GL_COPY, CopyInverted = GL_COPY_INVERTED, Noop = GL_NOOP, Invert = GL_INVERT, And = GL_AND, AndReverse = GL_AND_REVERSE, AndInverted = GL_AND_INVERTED, Nand = GL_NAND, Or = GL_OR, OrReverse = GL_OR_REVERSE, OrInverted = GL_OR_INVERTED, Nor = GL_NOR, Xor = GL_XOR, Equivalence = GL_EQUIV }
Logical operation.
static void setLogicOperation(LogicOperation operation)
Set logical operation.

Renderer synchronization

enum class MemoryBarrier: GLbitfield { VertexAttributeArray = GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT, ElementArray = GL_ELEMENT_ARRAY_BARRIER_BIT, Uniform = GL_UNIFORM_BARRIER_BIT, TextureFetch = GL_TEXTURE_FETCH_BARRIER_BIT, ShaderImageAccess = GL_SHADER_IMAGE_ACCESS_BARRIER_BIT, Command = GL_COMMAND_BARRIER_BIT, PixelBuffer = GL_PIXEL_BUFFER_BARRIER_BIT, TextureUpdate = GL_TEXTURE_UPDATE_BARRIER_BIT, BufferUpdate = GL_BUFFER_UPDATE_BARRIER_BIT, Framebuffer = GL_FRAMEBUFFER_BARRIER_BIT, TransformFeedback = GL_TRANSFORM_FEEDBACK_BARRIER_BIT, AtomicCounter = GL_ATOMIC_COUNTER_BARRIER_BIT, ShaderStorage = GL_ATOMIC_COUNTER_BARRIER_BIT }
Memory barrier.
using MemoryBarriers = Containers::EnumSet<MemoryBarrier>
Memory barriers.
static void flush()
Flush the pipeline.
static void finish()
Finish the pipeline.
static void setMemoryBarrier(MemoryBarriers barriers)
Set memory barrier.
static void setMemoryBarrierByRegion(MemoryBarriers barriers)
Set memory barrier by region.
static void setTextureBarrier()
Set texture barrier.

Renderer management

enum class Error: GLenum { NoError = GL_NO_ERROR, InvalidEnum = GL_INVALID_ENUM, InvalidValue = GL_INVALID_VALUE, InvalidOperation = GL_INVALID_OPERATION, InvalidFramebufferOperation = GL_INVALID_FRAMEBUFFER_OPERATION, OutOfMemory = GL_OUT_OF_MEMORY, StackUnderflow = GL_STACK_UNDERFLOW, StackOverflow = GL_STACK_OVERFLOW }
Error status.
enum class ResetNotificationStrategy: GLint { NoResetNotification = GL_NO_RESET_NOTIFICATION_ARB, LoseContextOnReset = GL_LOSE_CONTEXT_ON_RESET_ARB }
Graphics reset notification strategy.
enum class GraphicsResetStatus: GLenum { NoError = GL_NO_ERROR, GuiltyContextReset = GL_GUILTY_CONTEXT_RESET_ARB, InnocentContextReset = GL_INNOCENT_CONTEXT_RESET_ARB, UnknownContextReset = GL_UNKNOWN_CONTEXT_RESET_ARB }
Graphics reset status.
static auto error() -> Error
Error status.
static auto resetNotificationStrategy() -> ResetNotificationStrategy
Graphics reset notification strategy.
static auto graphicsResetStatus() -> GraphicsResetStatus
Check graphics reset status.

Enum documentation

enum class Magnum::GL::Renderer::PolygonFacing: GLenum

Affected polygon facing for culling, stencil operations and masks.

Enumerators
Front

Front-facing polygons

Back

Back-facing polygons

FrontAndBack

Front- and back-facing polygons

enum class Magnum::GL::Renderer::Feature: GLenum

Features.

All features are disabled by default unless specified otherwise.

Enumerators
BlendAdvancedCoherent

Coherent advanced blending. Enabled by default if desktop/ES extension KHR_blend_equation_advanced_coherent is available. See blendBarrier() for more information.

Blending

Blending

DebugOutput

Debug output. Disabled by default unless the GL context was created with debug output enabled.

DebugOutputSynchronous

Synchronous debug output. Has effect only if Feature::DebugOutput is enabled.

DepthClamp

Depth clamping. If enabled, ignores near and far clipping plane.

DepthTest

Depth test

Dithering

Dithering. Enabled by default.

FaceCulling

Back face culling

FramebufferSrgb

Perform sRGB conversion of values written to sRGB framebuffers. Disabled by default on desktop GL, enabled by default on OpenGL ES.

FramebufferSRGB

Perform sRGB conversion of values written to sRGB framebuffers.

LogicOperation

Logical operation

Multisampling

Multisampling. Enabled by default. Note that the actual presence of this feature in default framebuffer depends on context configuration, see for example Platform::Sdl2Application::GLConfiguration::setSampleCount().

PolygonOffsetFill

Offset filled polygons

PolygonOffsetLine

Offset lines

PolygonOffsetPoint

Offset points

ProgramPointSize

Programmable point size. If enabled, the point size is taken from vertex/geometry shader builtin gl_PointSize.

RasterizerDiscard

Discard primitives before rasterization.

SampleShading

Sample shading.

SeamlessCubeMapTexture

Seamless cube map texture.

ScissorTest

Scissor test

StencilTest

Stencil test

enum class Magnum::GL::Renderer::Hint: GLenum

Hint.

Enumerators
FragmentShaderDerivative

Accuracy of derivative calculation in fragment shader.

TextureCompression

Quality and performance of texture image compression.

enum class Magnum::GL::Renderer::HintMode: GLenum

Hint mode.

Enumerators
Fastest

Most efficient option.

Nicest

Most correct or highest quality option.

DontCare

No preference.

enum class Magnum::GL::Renderer::FrontFace: GLenum

Front facing polygon winding.

Enumerators
CounterClockWise

Counterclockwise polygons are front facing (default).

ClockWise

Clockwise polygons are front facing.

enum class Magnum::GL::Renderer::ProvokingVertex: GLenum

Provoking vertex.

Enumerators
FirstVertexConvention

Use first vertex of each polygon.

LastVertexConvention

Use last vertex of each polygon (default).

enum class Magnum::GL::Renderer::PolygonMode: GLenum

Polygon mode.

Enumerators
Fill

Interior of the polygon is filled (default).

Line

Boundary edges are filled. See also setLineWidth().

Point

Starts of boundary edges are drawn as points. See also setPointSize().

enum class Magnum::GL::Renderer::StencilFunction: GLenum

Stencil function.

Enumerators
Never

Never pass the test.

Always

Always pass the test.

Less

Pass when reference value is less than buffer value.

LessOrEqual

Pass when reference value is less than or equal to buffer value.

Equal

Pass when reference value is equal to buffer value.

NotEqual

Pass when reference value is not equal to buffer value.

GreaterOrEqual

Pass when reference value is greater than or equal to buffer value.

Greater

Pass when reference value is greater than buffer value.

enum class Magnum::GL::Renderer::StencilOperation: GLenum

Stencil operation.

Enumerators
Keep

Keep the current value.

Zero

Set the stencil buffer value to 0.

Replace

Set the stencil value to reference value specified by setStencilFunction().

Increment

Increment the current stencil buffer value, clamp to maximum possible value on overflow.

IncrementWrap

Increment the current stencil buffer value, wrap to zero on overflow.

Decrement

Increment the current stencil buffer value, clamp to minimum possible value on underflow.

DecrementWrap

Decrement the current stencil buffer value, wrap to maximum possible value on underflow.

Invert

Bitwise invert the current stencil buffer value.

enum class Magnum::GL::Renderer::BlendEquation: GLenum

Blend equation.

Enumerators
Add

source + destination

Subtract

source - destination

ReverseSubtract

destination - source

Min

min(source, destination)

Max

max(source, destination)

Multiply

Multiply. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Screen

Screen. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Overlay

Overlay. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Darken

Darken. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Lighten

Lighten. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

ColorDodge

Color dodge. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

ColorBurn

Color burn. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

HardLight

Hard light. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

SoftLight

Soft light. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Difference

Difference. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

Exclusion

Exclusion. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

HslHue

HSL hue. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

HslSaturation

HSL saturation. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

HslColor

HSL color. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

HslLuminosity

HSL luminosity. Not accepted as separate parameters in setBlendEquation(BlendEquation, BlendEquation), only in setBlendEquation(BlendEquation).

enum class Magnum::GL::Renderer::BlendFunction: GLenum

Blend function.

Enumerators
Zero

Zero ( $ RGB = (0.0, 0.0, 0.0); A = 0.0 $ )

One

One ( $ RGB = (1.0, 1.0, 1.0); A = 1.0 $ )

ConstantColor

Constant color ( $ RGB = (R_c, G_c, B_c); A = A_c $ )

OneMinusConstantColor

One minus constant color ( $ RGB = (1.0 - R_c, 1.0 - G_c, 1.0 - B_c); A = 1.0 - A_c $ )

ConstantAlpha

Constant alpha ( $ RGB = (A_c, A_c, A_c); A = A_c $ )

OneMinusConstantAlpha

One minus constant alpha ( $ RGB = (1.0 - A_c, 1.0 - A_c, 1.0 - A_c); A = 1.0 - A_c $ )

SourceColor

Source color ( $ RGB = (R_{s0}, G_{s0}, B_{s0}); A = A_{s0} $ )

SecondSourceColor

Second source color ( $ RGB = (R_{s1}, G_{s1}, B_{s1}); A = A_{s1} $ )

OneMinusSourceColor

One minus source color ( $ RGB = (1.0 - R_{s0}, 1.0 - G_{s0}, 1.0 - B_{s0}); A = 1.0 - A_{s0} $ )

OneMinusSecondSourceColor

One minus second source color ( $ RGB = (1.0 - R_{s1}, 1.0 - G_{s1}, 1.0 - B_{s1}); A = 1.0 - A_{s1} $ )

SourceAlpha

Source alpha ( $ RGB = (A_{s0}, A_{s0}, A_{s0}); A = A_{s0} $ )

SourceAlphaSaturate

Saturate source alpha ( $ RGB = (f, f, f); A = 1.0; f = min(A_s, 1.0 - A_d) $ )

Can be used only in source parameter of setBlendFunction().

SecondSourceAlpha

Second source alpha ( $ RGB = (A_{s1}, A_{s1}, A_{s1}); A = A_{s1} $ )

OneMinusSourceAlpha

One minus source alpha ( $ RGB = (1.0 - A_{s0}, 1.0 - A_{s0}, 1.0 - A_{s0}); A = 1.0 - A_{s0} $ )

OneMinusSecondSourceAlpha

One minus second source alpha ( $ RGB = (1.0 - A_{s1}, 1.0 - A_{s1}, 1.0 - A_{s1}); A = 1.0 - A_{s1} $ )

DestinationColor

Destination color ( $ RGB = (R_d, G_d, B_d); A = A_d $ )

OneMinusDestinationColor

One minus source color ( $ RGB = (1.0 - R_d, 1.0 - G_d, 1.0 - B_d); A = 1.0 - A_d $ )

DestinationAlpha

Destination alpha ( $ RGB = (A_d, A_d, A_d); A = A_d $ )

OneMinusDestinationAlpha

One minus source alpha ( $ RGB = (1.0 - A_d, 1.0 - A_d, 1.0 - A_d); A = 1.0 - A_d $ )

enum class Magnum::GL::Renderer::LogicOperation: GLenum

Logical operation.

Enumerators
Clear

0

Set

1

Copy

source

CopyInverted

~source

Noop

destination

Invert

~destination

And

source & destination

AndReverse

source & ~destination

AndInverted

~source & destination

Nand

~(source & destination)

Or

source | destination

OrReverse

source | ~destination

OrInverted

~source | destination

Nor

~(source | destination)

Xor

source ^ destination

Equivalence

~(source ^ destination)

enum class Magnum::GL::Renderer::MemoryBarrier: GLbitfield

Memory barrier.

Enumerators
VertexAttributeArray

Vertex data

ElementArray

Vertex indices

Uniform

Uniforms

TextureFetch

Texture fetches

ShaderImageAccess

Shader image access

Command

Indirect command data

PixelBuffer

Pixel buffer data

TextureUpdate

Texture updates

BufferUpdate

Buffer updates

Framebuffer

Framebuffer operations

TransformFeedback

Transform feedback data

AtomicCounter

Atomic counters

ShaderStorage

Shader storage data

enum class Magnum::GL::Renderer::Error: GLenum

Error status.

Enumerators
NoError

No error has been recorded

InvalidEnum

An unacceptable value specified for enumerated argument

InvalidValue

A numeric argument is out of range

InvalidOperation

The specified operation is not allowed in the current state

InvalidFramebufferOperation

The framebuffer object is not complete.

OutOfMemory

There is not enough memory left to execute the command.

StackUnderflow

Given operation would cause an internal stack to underflow.

StackOverflow

Given operation would cause an internal stack to overflow.

enum class Magnum::GL::Renderer::ResetNotificationStrategy: GLint

Graphics reset notification strategy.

Enumerators
NoResetNotification

No reset notification, thus graphicsResetStatus() will always return GraphicsResetStatus::NoError. However this doesn't mean that the context cannot be lost.

LoseContextOnReset

Graphics reset will result in context loss, cause of the reset can be queried with graphicsResetStatus().

enum class Magnum::GL::Renderer::GraphicsResetStatus: GLenum

Graphics reset status.

Enumerators
NoError

No reset occured since last call.

GuiltyContextReset

Reset attributable to the current context has been detected.

InnocentContextReset

Reset not attributable to the current context has been detected.

UnknownContextReset

Reset with unknown cause has been detected.

Typedef documentation

typedef StencilFunction Magnum::GL::Renderer::DepthFunction

Depth function.

typedef Containers::EnumSet<MemoryBarrier> Magnum::GL::Renderer::MemoryBarriers

Memory barriers.

Function documentation

static Range1D Magnum::GL::Renderer::lineWidthRange()

Line width range.

The result is cached, repeated queries don't result in repeated OpenGL calls. Note that lines wider than 1.0f are supported only when the context is not forward-compatible. Smooth lines are not supported by design.

static void Magnum::GL::Renderer::enable(Feature feature)

Enable feature.

static void Magnum::GL::Renderer::disable(Feature feature)

Disable feature.

static void Magnum::GL::Renderer::setFeature(Feature feature, bool enabled)

Enable or disable feature.

Convenience equivalent to the following:

enabled ? Renderer::enable(feature) : Renderer::disable(feature)

Prefer to use enable() and disable() directly to avoid unnecessary branching.

static void Magnum::GL::Renderer::setHint(Hint target, HintMode mode)

Set hint.

Initial value is HintMode::DontCare for all targets.

static void Magnum::GL::Renderer::setClearColor(const Color4& color)

Set clear color.

Initial value is 0x1f1f1f_rgbf.

static void Magnum::GL::Renderer::setClearDepth(Double depth)

Set clear depth.

Initial value is 1.0.

static void Magnum::GL::Renderer::setClearDepth(Float depth)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

If OpenGL ES, OpenGL 4.1 or extension ARB_ES2_compatibility is not available, this function behaves exactly as setClearDepth(Double).

static void Magnum::GL::Renderer::setFrontFace(FrontFace mode)

Set front-facing polygon winding.

Initial value is FrontFace::CounterClockWise.

static void Magnum::GL::Renderer::setFaceCullingMode(PolygonFacing mode)

Which polygon facing to cull.

Initial value is PolygonFacing::Back. If set to both front and back, only points and lines are drawn.

static void Magnum::GL::Renderer::setProvokingVertex(ProvokingVertex mode)

Set provoking vertex.

Initial value is ProvokingVertex::LastVertexConvention.

static void Magnum::GL::Renderer::setPolygonMode(PolygonMode mode)

Set polygon drawing mode.

Initial value is PolygonMode::Fill.

static void Magnum::GL::Renderer::setPolygonOffset(Float factor, Float units)

Set polygon offset.

Parameters
factor Scale factor
units Offset units

static void Magnum::GL::Renderer::setLineWidth(Float width)

Set line width.

Initial value is 1.0f. Note that on contexts that are Context::Flag::ForwardCompatible the max supported value is 1.0f — request a non-forward-compatible context to get wide lines on supported hardware.

static void Magnum::GL::Renderer::setPointSize(Float size)

Set point size.

Initial value is 1.0f.

static void Magnum::GL::Renderer::setMinSampleShading(Float value)

Set min sample shading value.

static void Magnum::GL::Renderer::setScissor(const Range2Di& rectangle)

Set scissor rectangle.

Initial value is set to cover whole window.

static void Magnum::GL::Renderer::setStencilFunction(PolygonFacing facing, StencilFunction function, Int referenceValue, UnsignedInt mask)

Set stencil function.

Parameters
facing Affected polygon facing
function Stencil function. Initial value is StencilFunction::Always.
referenceValue Reference value. Initial value is 0.
mask Mask for both reference and buffer value. Initial value is all 1 s.

static void Magnum::GL::Renderer::setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask)

Set stencil function.

The same as setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt) with facing set to PolygonFacing::FrontAndBack.

static void Magnum::GL::Renderer::setStencilOperation(PolygonFacing facing, StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass)

Set stencil operation.

Parameters
facing Affected polygon facing
stencilFail Action when stencil test fails
depthFail Action when stencil test passes, but depth test fails
depthPass Action when both stencil and depth test pass

Initial value for all fields is StencilOperation::Keep.

static void Magnum::GL::Renderer::setDepthFunction(DepthFunction function)

Set depth function.

Initial value is DepthFunction::Less.

static void Magnum::GL::Renderer::setColorMask(GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha)

Mask color writes.

Set to false to disallow writing to given color channel. Initial values are all true.

static void Magnum::GL::Renderer::setDepthMask(GLboolean allow)

Mask depth writes.

Set to false to disallow writing to depth buffer. Initial value is true.

static void Magnum::GL::Renderer::setStencilMask(PolygonFacing facing, UnsignedInt allowBits)

Mask stencil writes.

Set given bit to 0 to disallow writing stencil value for given faces to it. Initial value is all 1 s.

static void Magnum::GL::Renderer::setStencilMask(UnsignedInt allowBits)

Mask stencil writes.

The same as calling setStencilMask(PolygonFacing, UnsignedInt) with facing set to PolygonFacing::FrontAndBack.

static void Magnum::GL::Renderer::setBlendEquation(BlendEquation equation)

Set blend equation.

How to combine source color (pixel value) with destination color (framebuffer). Initial value is BlendEquation::Add.

static void Magnum::GL::Renderer::setBlendEquation(BlendEquation rgb, BlendEquation alpha)

Set blend equation separately for RGB and alpha components.

See setBlendEquation(BlendEquation) for more information.

static void Magnum::GL::Renderer::setBlendFunction(BlendFunction source, BlendFunction destination)

Set blend function.

Parameters
source How the source blending factor is computed from pixel value. Initial value is BlendFunction::One.
destination How the destination blending factor is computed from framebuffer. Initial value is BlendFunction::Zero.

static void Magnum::GL::Renderer::setBlendFunction(BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha)

Set blend function separately for RGB and alpha components.

See setBlendFunction(BlendFunction, BlendFunction) for more information.

static void Magnum::GL::Renderer::blendBarrier()

Blend barrier.

Specifies a boundary between passes when using advanced blend equations to ensure that each sample in the framebuffer is not touched more than once.

This is needed either when desktop/ES extension KHR_blend_equation_advanced_coherent is not available or when KHR_blend_equation_advanced_coherent is available and Feature::BlendAdvancedCoherent is turned off.

static void Magnum::GL::Renderer::setLogicOperation(LogicOperation operation)

Set logical operation.

static void Magnum::GL::Renderer::flush()

Flush the pipeline.

static void Magnum::GL::Renderer::finish()

Finish the pipeline.

Blocks until all commands in the pipeline are finished.

static void Magnum::GL::Renderer::setMemoryBarrier(MemoryBarriers barriers)

Set memory barrier.

Calling the function ensures that operations on particular data after the barrier will reflect all data modifications before the barrier.

static void Magnum::GL::Renderer::setMemoryBarrierByRegion(MemoryBarriers barriers)

Set memory barrier by region.

Behaves as setMemoryBarrier(), except that the region is narrowed around area affected by particular fragment shader, thus only the fragment shader-related barries are supported:

static void Magnum::GL::Renderer::setTextureBarrier()

Set texture barrier.

Calling the function ensures that texel fetches in drawing operations after the barrier will reflect texel writes before the barrier.

static Error Magnum::GL::Renderer::error()

Error status.

Returns error flag, if any set. If there aren't any more error flags, returns Error::NoError. Thus this function should be always called in a loop until it returns Error::NoError.

static ResetNotificationStrategy Magnum::GL::Renderer::resetNotificationStrategy()

Graphics reset notification strategy.

The result is cached, repeated queries don't result in repeated OpenGL calls. If OpenGL extension ARB_robustness or ES extension EXT_robustness is not available, this function always returns ResetNotificationStrategy::NoResetNotification.

For the reset notification to work, additionally to the extension support the context must be created with Platform::*Application::GLConfiguration::Flag::RobustAccess flag.

static GraphicsResetStatus Magnum::GL::Renderer::graphicsResetStatus()

Check graphics reset status.

Reset causes all context state to be lost. If OpenGL extension ARB_robustness or ES extension EXT_robustness is not available, this function always returns GraphicsResetStatus::NoError.

For the reset notification to work, additionally to the extension support the context must be created with Platform::*Application::GLConfiguration::Flag::RobustAccess flag.

If the reset occurs, ARB_robustness_isolation extension is supported and context is created with Platform::*Application::GLConfiguration::Flag::ResetIsolation, advertised support for ARB_robustness_application_isolation indicates that no other application on the system will be affected by the graphics reset. Advertised support for ARB_robustness_share_group_isolation indicates that no other share group will be affected by the graphics reset.

Debug& operator<<(Debug& debug, Renderer::Error value)

Debug output operator.