Gamp v0.0.8
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::render::gl::GLCapabilities Class Reference

Specifies a set of OpenGL capabilities. More...

#include <GLCapabilities.hpp>

Inheritance diagram for gamp::render::gl::GLCapabilities:
Collaboration diagram for gamp::render::gl::GLCapabilities:

Public Member Functions

constexpr GLCapabilities () noexcept=default
 
constexpr GLCapabilities (const GLCapabilities &) noexcept=default
 
constexpr GLCapabilities (GLCapabilities &&) noexcept=default
 
constexpr int accumAlphaBits () const noexcept
 Returns the number of bits for the accumulation buffer's alpha component.
 
constexpr int & accumAlphaBits () noexcept
 Sets number of bits requested for accumulation buffer's alpha component.
 
constexpr int accumBlueBits () const noexcept
 Returns the number of bits for the accumulation buffer's blue component.
 
constexpr int & accumBlueBits () noexcept
 Sets the number of bits requested for the accumulation buffer's blue component.
 
constexpr int accumGreenBits () const noexcept
 Returns the number of bits for the accumulation buffer's green component.
 
constexpr int & accumGreenBits () noexcept
 Sets the number of bits requested for the accumulation buffer's green component.
 
constexpr int accumRedBits () const noexcept
 Returns the number of bits for the accumulation buffer's red component.
 
constexpr int & accumRedBits () noexcept
 Sets the number of bits requested for the accumulation buffer's red component.
 
CapabilitiesPtr clone () const noexcept override
 
int compare (const Capabilities &rhs0) const noexcept override
 comparing hw/sw, stereo, multisample, stencil, RGBA and depth only
 
constexpr int depthBits () const noexcept
 Returns the number of depth buffer bits.
 
constexpr int & depthBits () noexcept
 Sets the number of bits requested for the depth buffer.
 
constexpr bool doubleBuffered () const noexcept
 Returns whether double-buffering is requested, available or chosen.
 
constexpr bool hardwareAccelerated () const noexcept
 Returns whether hardware acceleration is requested, available or chosen.
 
std::size_t hash_code () const noexcept override
 
constexpr bool hasMultiSamples () const noexcept
 Sets the desired extension for full-scene antialiasing (FSAA), default is DEFAULT_SAMPLE_EXTENSION.
 
constexpr bool isFBO () const noexcept
 Returns whether FBO offscreen mode is requested, available or chosen.
 
constexpr int multiSamplesCount () const noexcept
 Returns the number of sample buffers to be allocated if sample buffers are enabled, otherwise returns 0.
 
GLCapabilitiesoperator= (const GLCapabilities &) noexcept=default
 
bool operator== (const Capabilities &rhs0) const noexcept override
 
constexpr GLCapabilitiessetDoubleBuffered (bool enable) noexcept
 Enables or disables double buffering.
 
constexpr GLCapabilitiessetFBO (bool enable) noexcept
 Requesting offscreen FBO mode.
 
constexpr GLCapabilitiessetHardwareAccelerated (bool enable) noexcept
 Enables or disables hardware acceleration.
 
constexpr GLCapabilitiessetMultiSamplesCount (int v) noexcept
 Defaults to 0, i.e.
 
constexpr GLCapabilitiessetStereo (bool enable) noexcept
 Enables or disables stereo viewing.
 
const jau::type_infosignature () const noexcept override
 
constexpr int stencilBits () const noexcept
 Returns the number of stencil buffer bits.
 
constexpr int & stencilBits () noexcept
 Sets the number of bits requested for the stencil buffer.
 
constexpr bool stereo () const noexcept
 Returns whether stereo is requested, available or chosen.
 
std::string toString () const override
 Returns a textual representation of this GLCapabilities object.
 
- Public Member Functions inherited from gamp::wt::Capabilities
constexpr Capabilities () noexcept=default
 Creates a Capabilities object.
 
constexpr Capabilities (Capabilities &&) noexcept=default
 
constexpr Capabilities (const Capabilities &) noexcept=default
 
virtual ~Capabilities () noexcept=default
 
constexpr int alphaBits () const noexcept
 Returns the number of bits for the color buffer's alpha component.
 
constexpr int & alphaBits () noexcept
 Returns the reference to the number of bits for the color buffer's blue component.
 
constexpr int blueBits () const noexcept
 Returns the number of bits for the color buffer's blue component.
 
constexpr int & blueBits () noexcept
 Returns the reference to the number of bits for the color buffer's blue component.
 
constexpr int greenBits () const noexcept
 Returns the number of bits for the color buffer's green component.
 
constexpr int & greenBits () noexcept
 Returns the reference to the number of bits for the color buffer's green component.
 
constexpr bool isBackgroundOpaque () const noexcept
 Returns whether an opaque or translucent surface is requested, supported or chosen.
 
constexpr bool isBitmap () const noexcept
 Returns whether bitmap offscreen mode is requested, available or chosen.
 
constexpr bool isOnscreen () const noexcept
 Returns whether an on- or offscreen surface is requested, available or chosen.
 
std::strong_ordering operator<=> (const Capabilities &rhs) const noexcept
 
Capabilitiesoperator= (const Capabilities &) noexcept=default
 
constexpr int redBits () const noexcept
 Returns the number of bits for the color buffer's red component.
 
constexpr int & redBits () noexcept
 Returns the reference to the number of bits for the color buffer's red component.
 
constexpr void setBackgroundOpaque (bool opaque) noexcept
 Sets whether the surface shall be opaque or translucent.
 
constexpr void setBitmap (bool enable) noexcept
 Requesting offscreen bitmap mode.
 
constexpr void setOnscreen (bool v) noexcept
 Sets whether the surface shall be on- or offscreen.
 
constexpr int transparentAlphaValue () const noexcept
 Gets the transparent alpha value for the frame buffer configuration.
 
constexpr int & transparentAlphaValue () noexcept
 Allows setting the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha.
 
constexpr int transparentBlueValue () const noexcept
 Gets the transparent blue value for the frame buffer configuration.
 
constexpr int & transparentBlueValue () noexcept
 Allows setting the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue.
 
constexpr int transparentGreenValue () const noexcept
 Gets the transparent green value for the frame buffer configuration.
 
constexpr int & transparentGreenValue () noexcept
 Allows setting the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green.
 
constexpr int transparentRedValue () const noexcept
 Gets the transparent red value for the frame buffer configuration.
 
constexpr int & transparentRedValue () noexcept
 Allows setting the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red.
 
constexpr int visualID () const noexcept
 
constexpr int & visualID () noexcept
 

Static Public Member Functions

static const jau::type_infoGLSignature () noexcept
 

Protected Member Functions

std::string toString (std::string &sink) const
 
- Protected Member Functions inherited from gamp::wt::Capabilities
void toString (std::string &sink, bool withOnOffScreen) const
 

Additional Inherited Members

- Static Protected Attributes inherited from gamp::wt::Capabilities
static constexpr std::string_view CSEP = ", "
 Component separator.
 
static constexpr std::string_view ESEP = "/"
 Element separator.
 
static constexpr std::string_view na_str = "----"
 

Detailed Description

Specifies a set of OpenGL capabilities.

At creation time of a GLDrawable using GLDrawableFactory, an instance of this class is passed, describing the desired capabilities that a rendering context must support, such as the OpenGL profile, color depth and whether stereo is enabled.

The actual capabilites of created GLDrawables are then reflected by their own GLCapabilites instance, which can be queried with GLDrawable#getChosenGLCapabilities().

It currently contains the minimal number of routines which allow configuration on all supported window systems.

Default (bit-sizes):

  • bit sizes
    • red 8
    • green 8
    • blue 8
    • alpha 8
    • transparent off (zero)
    • depth 16
    • stencil 0
    • depth 16
    • stencil 0
    • accum 0 (rgba)
    • multi-samples-count 0
  • flags
    • onscreen true
    • bitmap false
    • fbo false
    • double-buffered true
    • stereo false
    • hardware-accelerated true
Examples
GraphShapes01.cpp, Primitives02.cpp, PrimitivesCobraMK3.cpp, and SolInSpace.cpp.

Definition at line 62 of file GLCapabilities.hpp.

Constructor & Destructor Documentation

◆ GLCapabilities() [1/3]

gamp::render::gl::GLCapabilities::GLCapabilities ( )
constexprdefaultnoexcept
Here is the caller graph for this function:

◆ GLCapabilities() [2/3]

gamp::render::gl::GLCapabilities::GLCapabilities ( const GLCapabilities & )
constexprdefaultnoexcept

◆ GLCapabilities() [3/3]

gamp::render::gl::GLCapabilities::GLCapabilities ( GLCapabilities && )
constexprdefaultnoexcept

Member Function Documentation

◆ operator=()

GLCapabilities & gamp::render::gl::GLCapabilities::operator= ( const GLCapabilities & )
defaultnoexcept

◆ GLSignature()

static const jau::type_info & gamp::render::gl::GLCapabilities::GLSignature ( )
inlinestaticnoexcept

Definition at line 85 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ signature()

const jau::type_info & gamp::render::gl::GLCapabilities::signature ( ) const
inlineoverridevirtualnoexcept

Reimplemented from gamp::wt::Capabilities.

Definition at line 86 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ clone()

CapabilitiesPtr gamp::render::gl::GLCapabilities::clone ( ) const
inlineoverridevirtualnoexcept

Reimplemented from gamp::wt::Capabilities.

Definition at line 88 of file GLCapabilities.hpp.

◆ hash_code()

std::size_t gamp::render::gl::GLCapabilities::hash_code ( ) const
inlineoverridevirtualnoexcept

Reimplemented from gamp::wt::Capabilities.

Definition at line 90 of file GLCapabilities.hpp.

◆ operator==()

bool gamp::render::gl::GLCapabilities::operator== ( const Capabilities & rhs0) const
inlineoverridevirtualnoexcept

Reimplemented from gamp::wt::Capabilities.

Definition at line 108 of file GLCapabilities.hpp.

◆ compare()

int gamp::render::gl::GLCapabilities::compare ( const Capabilities & rhs0) const
inlineoverridevirtualnoexcept

comparing hw/sw, stereo, multisample, stencil, RGBA and depth only

Reimplemented from gamp::wt::Capabilities.

Definition at line 134 of file GLCapabilities.hpp.

◆ isFBO()

bool gamp::render::gl::GLCapabilities::isFBO ( ) const
inlineconstexprnoexcept

Returns whether FBO offscreen mode is requested, available or chosen.

Default is false.

For chosen capabilities, only the selected offscreen surface is set to true.

Definition at line 199 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ setFBO()

GLCapabilities & gamp::render::gl::GLCapabilities::setFBO ( bool enable)
inlineconstexprnoexcept

Requesting offscreen FBO mode.

If enabled this method also invokes setOnscreen(false).

Defaults to false.

Requesting offscreen FBO mode disables the offscreen auto selection.

Definition at line 213 of file GLCapabilities.hpp.

◆ doubleBuffered()

bool gamp::render::gl::GLCapabilities::doubleBuffered ( ) const
inlineconstexprnoexcept

Returns whether double-buffering is requested, available or chosen.

Default is true.

Definition at line 227 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ setDoubleBuffered()

GLCapabilities & gamp::render::gl::GLCapabilities::setDoubleBuffered ( bool enable)
inlineconstexprnoexcept

Enables or disables double buffering.

Definition at line 230 of file GLCapabilities.hpp.

◆ stereo()

bool gamp::render::gl::GLCapabilities::stereo ( ) const
inlineconstexprnoexcept

Returns whether stereo is requested, available or chosen.

Default is false.

Definition at line 238 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ setStereo()

GLCapabilities & gamp::render::gl::GLCapabilities::setStereo ( bool enable)
inlineconstexprnoexcept

Enables or disables stereo viewing.

Definition at line 241 of file GLCapabilities.hpp.

◆ hardwareAccelerated()

bool gamp::render::gl::GLCapabilities::hardwareAccelerated ( ) const
inlineconstexprnoexcept

Returns whether hardware acceleration is requested, available or chosen.

Default is true.

Definition at line 249 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ setHardwareAccelerated()

GLCapabilities & gamp::render::gl::GLCapabilities::setHardwareAccelerated ( bool enable)
inlineconstexprnoexcept

Enables or disables hardware acceleration.

Definition at line 252 of file GLCapabilities.hpp.

◆ depthBits() [1/2]

int gamp::render::gl::GLCapabilities::depthBits ( ) const
inlineconstexprnoexcept

Returns the number of depth buffer bits.

Definition at line 257 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ depthBits() [2/2]

int & gamp::render::gl::GLCapabilities::depthBits ( )
inlineconstexprnoexcept

Sets the number of bits requested for the depth buffer.

Definition at line 260 of file GLCapabilities.hpp.

◆ stencilBits() [1/2]

int gamp::render::gl::GLCapabilities::stencilBits ( ) const
inlineconstexprnoexcept

Returns the number of stencil buffer bits.

Default is 0.

Definition at line 268 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ stencilBits() [2/2]

int & gamp::render::gl::GLCapabilities::stencilBits ( )
inlineconstexprnoexcept

Sets the number of bits requested for the stencil buffer.

Definition at line 271 of file GLCapabilities.hpp.

◆ accumRedBits() [1/2]

int gamp::render::gl::GLCapabilities::accumRedBits ( ) const
inlineconstexprnoexcept

Returns the number of bits for the accumulation buffer's red component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 279 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ accumRedBits() [2/2]

int & gamp::render::gl::GLCapabilities::accumRedBits ( )
inlineconstexprnoexcept

Sets the number of bits requested for the accumulation buffer's red component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 285 of file GLCapabilities.hpp.

◆ accumGreenBits() [1/2]

int gamp::render::gl::GLCapabilities::accumGreenBits ( ) const
inlineconstexprnoexcept

Returns the number of bits for the accumulation buffer's green component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 293 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ accumGreenBits() [2/2]

int & gamp::render::gl::GLCapabilities::accumGreenBits ( )
inlineconstexprnoexcept

Sets the number of bits requested for the accumulation buffer's green component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 299 of file GLCapabilities.hpp.

◆ accumBlueBits() [1/2]

int gamp::render::gl::GLCapabilities::accumBlueBits ( ) const
inlineconstexprnoexcept

Returns the number of bits for the accumulation buffer's blue component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 307 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ accumBlueBits() [2/2]

int & gamp::render::gl::GLCapabilities::accumBlueBits ( )
inlineconstexprnoexcept

Sets the number of bits requested for the accumulation buffer's blue component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 313 of file GLCapabilities.hpp.

◆ accumAlphaBits() [1/2]

int gamp::render::gl::GLCapabilities::accumAlphaBits ( ) const
inlineconstexprnoexcept

Returns the number of bits for the accumulation buffer's alpha component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 321 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ accumAlphaBits() [2/2]

int & gamp::render::gl::GLCapabilities::accumAlphaBits ( )
inlineconstexprnoexcept

Sets number of bits requested for accumulation buffer's alpha component.

On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.

Definition at line 327 of file GLCapabilities.hpp.

◆ hasMultiSamples()

bool gamp::render::gl::GLCapabilities::hasMultiSamples ( ) const
inlineconstexprnoexcept

Sets the desired extension for full-scene antialiasing (FSAA), default is DEFAULT_SAMPLE_EXTENSION.

Returns the extension for full-scene antialiasing (FSAA).

Default is DEFAULT_SAMPLE_EXTENSION.

Returns whether sample buffers for full-scene antialiasing (FSAA) is/shall-be used for this drawable.

Default is false.

Definition at line 349 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ setMultiSamplesCount()

GLCapabilities & gamp::render::gl::GLCapabilities::setMultiSamplesCount ( int v)
inlineconstexprnoexcept

Defaults to 0, i.e.

no full-scene antialiasing (FSAA).

Indicates whether sample buffers for full-scene antialiasing (FSAA) should is/shall-be used for this drawable.

If FSAA is enabled but alphaBits()==0, alphaBits() will be set to 1.

Examples
GraphShapes01.cpp.

Definition at line 359 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ multiSamplesCount()

int gamp::render::gl::GLCapabilities::multiSamplesCount ( ) const
inlineconstexprnoexcept

Returns the number of sample buffers to be allocated if sample buffers are enabled, otherwise returns 0.

Default is 0 due to disable sample buffers per default.

Definition at line 374 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ toString() [1/2]

std::string gamp::render::gl::GLCapabilities::toString ( ) const
inlineoverridevirtual

Returns a textual representation of this GLCapabilities object.

Reimplemented from gamp::wt::Capabilities.

Definition at line 378 of file GLCapabilities.hpp.

Here is the caller graph for this function:

◆ toString() [2/2]

std::string gamp::render::gl::GLCapabilities::toString ( std::string & sink) const
inlineprotected

Definition at line 386 of file GLCapabilities.hpp.


The documentation for this class was generated from the following file: