Magnum::Shaders::LineGL::Configuration class

Configuration.

Public functions

auto flags() const -> Flags
Flags.
auto setFlags(Flags flags) -> Configuration&
Set flags.
auto capStyle() const -> LineCapStyle
Cap style.
auto setCapStyle(LineCapStyle style) -> Configuration&
Set cap style.
auto joinStyle() const -> LineJoinStyle
Join style.
auto setJoinStyle(LineJoinStyle style) -> Configuration&
Set join style.
auto materialCount() const -> UnsignedInt
Material count.
auto setMaterialCount(UnsignedInt count) -> Configuration&
Set material count.
auto drawCount() const -> UnsignedInt
Draw count.
auto setDrawCount(UnsignedInt count) -> Configuration&
Set draw count.
auto extraSource() const -> Containers::StringView
Extra source to use for extending shader behavior.
auto setExtraSource(Containers::StringView source) -> Configuration&
Set an extra source to use for extending shader behavior.
auto setExtraSource(Containers::String&& source) -> Configuration&

Function documentation

Configuration& Magnum::Shaders::LineGL::Configuration::setFlags(Flags flags)

Set flags.

Returns Reference to self (for method chaining)

No flags are set by default.

Configuration& Magnum::Shaders::LineGL::Configuration::setCapStyle(LineCapStyle style)

Set cap style.

Returns Reference to self (for method chaining)

Unlike for example the SVG specification that uses LineCapStyle::Butt by default, the default value is LineCapStyle::Square, in order to make zero-length lines visible.

Configuration& Magnum::Shaders::LineGL::Configuration::setJoinStyle(LineJoinStyle style)

Set join style.

Returns Reference to self (for method chaining)

Default value is LineJoinStyle::Miter, consistently with the SVG specification.

Configuration& Magnum::Shaders::LineGL::Configuration::setMaterialCount(UnsignedInt count)

Set material count.

Returns Reference to self (for method chaining)

If Flag::UniformBuffers is set, describes size of a LineMaterialUniform buffer bound with bindMaterialBuffer(). Uniform buffers have a statically defined size and count*sizeof(LineMaterialUniform) has to be within GL::AbstractShaderProgram::maxUniformBlockSize(), if Flag::ShaderStorageBuffers is set as well, the buffer is unbounded and count is ignored. The per-draw materials are specified via LineDrawUniform::materialId. Default value is 1.

If Flag::UniformBuffers isn't set, this value is ignored.

Configuration& Magnum::Shaders::LineGL::Configuration::setDrawCount(UnsignedInt count)

Set draw count.

Returns Reference to self (for method chaining)

If Flag::UniformBuffers is set, describes size of a TransformationProjectionUniform2D / TransformationProjectionUniform3D / LineDrawUniform buffer bound with bindTransformationProjectionBuffer() and bindDrawBuffer(). Uniform buffers have a statically defined size and the maximum of count*sizeof(TransformationProjectionUniform2D) / count*sizeof(TransformationProjectionUniform3D) and count*sizeof(LineDrawUniform) has to be within GL::AbstractShaderProgram::maxUniformBlockSize(), if Flag::ShaderStorageBuffers is set as well, the buffers are unbounded and count is ignored. The draw offset is set via setDrawOffset(). Default value is 1.

If Flag::UniformBuffers isn't set, this value is ignored.

Containers::StringView Magnum::Shaders::LineGL::Configuration::extraSource() const

Extra source to use for extending shader behavior.

The returned view is Containers::StringViewFlag::NullTerminated, Containers::StringViewFlag::Global is set if a global null-terminated view was passed to setExtraSource().

Configuration& Magnum::Shaders::LineGL::Configuration::setExtraSource(Containers::StringView source)

Set an extra source to use for extending shader behavior.

Returns Reference to self (for method chaining)

If the string is not empty, uses it along with other builtin shader sources. Macros defined in the file are then used to modify or extend shader behavior, see Extending builtin shaders with custom code for an introduction and Extending with custom code for a list of extension points for the LineGL shader itself.

Calling this function multiple times replaces the previous source, doesn't add to it. Call the function with an empty string to remove any previously set extra source. By default there is no extra shader source added.

If the view is both Containers::StringViewFlag::Global and NullTerminated, it's directly referenced, otherwise a copy is made internally. For dynamic strings prefer to use the setExtraSource(Containers::String&&) overload to avoid copies.

Configuration& Magnum::Shaders::LineGL::Configuration::setExtraSource(Containers::String&& source)

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