Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
OpenGl_Caps Class Reference

Class to define graphic driver capabilities. Notice that these options will be ignored if particular functionality does not provided by GL driver. More...

#include <OpenGl_Caps.hxx>

Inheritance diagram for OpenGl_Caps:
Inheritance graph
[legend]

Data Fields

flags to disable particular functionality, should be used only for testing purposes!
bool sRGBDisable
 Disables sRGB rendering (OFF by default)
 
bool compressedTexturesDisable
 Disables uploading of compressed texture formats native to GPU (OFF by default)
 
bool vboDisable
 disallow VBO usage for debugging purposes (OFF by default)
 
bool pntSpritesDisable
 flag permits Point Sprites usage, will significantly affect performance (OFF by default)
 
bool keepArrayData
 Disables freeing CPU memory after building VBOs (OFF by default)
 
bool ffpEnable
 Enables FFP (fixed-function pipeline), do not use built-in GLSL programs (OFF by default)
 
bool usePolygonMode
 Enables Polygon Mode instead of built-in GLSL programs (OFF by default; unsupported on OpenGL ES)
 
bool useSystemBuffer
 Enables usage of system backbuffer for blitting (OFF by default on desktop OpenGL and ON on OpenGL ES for testing)
 
int swapInterval
 controls swap interval - 0 for VSync off and 1 for VSync on, 1 by default
 
bool useZeroToOneDepth
 use [0, 1] depth range instead of [-1, 1] range, when possible (OFF by default)
 
context creation parameters
bool buffersNoSwap
 
bool buffersOpaqueAlpha
 
bool buffersDeepColor
 
bool contextStereo
 
bool contextDebug
 
bool contextSyncDebug
 
bool contextNoAccel
 
bool contextCompatible
 
bool contextNoExtensions
 
int contextMajorVersionUpper
 
int contextMinorVersionUpper
 
bool isTopDownTextureUV
 
flags to activate verbose output

Print GLSL program compilation/linkage warnings, if any. OFF by default.

bool glslWarnings
 Suppress redundant messages from debug GL context. ON by default.
 
bool suppressExtraMsg
 Suppress redundant messages from debug GL context. ON by default.
 
OpenGl_ShaderProgramDumpLevel glslDumpLevel
 Print GLSL program source code. OFF by default.
 

class methods

Default constructor - initialize with most optimal values.

 OpenGl_Caps ()
 Destructor.
 
 ~OpenGl_Caps () override
 Destructor.
 
OpenGl_Capsoperator= (const OpenGl_Caps &theCopy)
 Copy maker.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

Class to define graphic driver capabilities. Notice that these options will be ignored if particular functionality does not provided by GL driver.

Constructor & Destructor Documentation

◆ OpenGl_Caps()

OpenGl_Caps::OpenGl_Caps ( )

Destructor.

◆ ~OpenGl_Caps()

OpenGl_Caps::~OpenGl_Caps ( )
override

Destructor.

Member Function Documentation

◆ operator=()

OpenGl_Caps & OpenGl_Caps::operator= ( const OpenGl_Caps & theCopy)

Copy maker.

Field Documentation

◆ buffersDeepColor

bool OpenGl_Caps::buffersDeepColor

Specify whether deep color format (10-bit per component / 30-bit RGB) should be used instead of standard color format (8-bit per component / 24-bit RGB) when available. Deep color provides higher accuracy within the same color range (sRGB) and doesn't enable wide color gamut / HDR support. Higher precision helps eliminating banding effect on smooth gradients.

Effect of the flag will vary depending on platform:

  • used as a hint on systems with 24-bit RGB color defined as preferred pixels format but with 30-bit RGB color being activated systemwide (e.g. Windows);
  • ignored on systems with deep color defined as preferred pixel format (e.g. Linux / X11), deep 30-bit RGB color will be used regardless of the flag value;
  • ignored on configurations not supporting deep color (incompatible display / system / GPU / driver), standard 24-bit RGB color will be used instead.

OFF by default.

◆ buffersNoSwap

bool OpenGl_Caps::buffersNoSwap

Specify that driver should not swap back/front buffers at the end of frame. Useful when OCCT Viewer is integrated into existing OpenGL rendering pipeline as part, thus swapping part is performed outside.

OFF by default.

◆ buffersOpaqueAlpha

bool OpenGl_Caps::buffersOpaqueAlpha

Specify whether alpha component within color buffer should be written or not. With alpha write enabled, background is considered transparent by default and overridden by alpha value of last drawn object (e.g. it could be opaque or not in case of transparent material). With alpha writes disabled, color buffer will be kept opaque.

ON by default.

◆ compressedTexturesDisable

bool OpenGl_Caps::compressedTexturesDisable

Disables uploading of compressed texture formats native to GPU (OFF by default)

◆ contextCompatible

bool OpenGl_Caps::contextCompatible

Request backward-compatible GL context. This flag requires support in OpenGL driver.

Backward-compatible profile includes deprecated functionality like FFP (fixed-function pipeline), and might be useful for compatibility with application OpenGL code.

Most drivers support all features within backward-compatibility profile, but some limit functionality to OpenGL 2.1 (e.g. OS X) when core profile is not explicitly requested.

Requires OpenGL 3.2+ drivers. Has no effect on OpenGL ES 2.0+ drivers (which do not provide FFP compatibility). Interacts with ffpEnable option, which should be disabled within core profile.

ON by default.

◆ contextDebug

bool OpenGl_Caps::contextDebug

Request debug GL context. This flag requires support in OpenGL driver.

When turned on OpenGL driver emits error and warning messages to provided callback (see OpenGl_Context - messages will be printed to standard output). Affects performance - thus should not be turned on by products in released state.

OFF by default.

◆ contextMajorVersionUpper

int OpenGl_Caps::contextMajorVersionUpper

Synthetically restrict upper version of OpenGL functionality to be used. Should be used for debugging purposes only!

(-1, -1) by default, which means no restriction.

◆ contextMinorVersionUpper

int OpenGl_Caps::contextMinorVersionUpper

Specify that driver should not swap back/front buffers at the end of frame. Useful when OCCT Viewer is integrated into existing OpenGL rendering pipeline as part, thus swapping part is performed outside.

OFF by default.

◆ contextNoAccel

bool OpenGl_Caps::contextNoAccel

Disable hardware acceleration.

This flag overrides default behavior, when accelerated context always preferred over software ones:

  • on Windows will force Microsoft software implementation;
  • on Mac OS X, forces Apple software implementation.

Software implementations are dramatically slower - should never be used.

OFF by default. Currently implemented only for Windows (WGL) and Mac OS X (Cocoa).

◆ contextNoExtensions

bool OpenGl_Caps::contextNoExtensions

Disallow using OpenGL extensions. Should be used for debugging purposes only!

OFF by default.

◆ contextStereo

bool OpenGl_Caps::contextStereo

Request stereoscopic context (with Quad Buffer). This flag requires support in OpenGL driver.

OFF by default.

◆ contextSyncDebug

bool OpenGl_Caps::contextSyncDebug

Request debug GL context to emit messages within main thread (when contextDebug is specified!).

Some implementations performs GL rendering within dedicated thread(s), in this case debug messages will be pushed from unknown thread making call stack useless, since it does not interconnected to application calls. This option asks GL driver to switch into synchronized implementation. Affects performance - thus should not be turned on by products in released state.

OFF by default.

◆ ffpEnable

bool OpenGl_Caps::ffpEnable

Enables FFP (fixed-function pipeline), do not use built-in GLSL programs (OFF by default)

◆ glslDumpLevel

OpenGl_ShaderProgramDumpLevel OpenGl_Caps::glslDumpLevel

Print GLSL program source code. OFF by default.

◆ glslWarnings

bool OpenGl_Caps::glslWarnings

Suppress redundant messages from debug GL context. ON by default.

◆ isTopDownTextureUV

bool OpenGl_Caps::isTopDownTextureUV

Define if 2D texture UV coordinates are defined top-down or bottom-up. FALSE by default.

Proper rendering requires image texture uploading and UV texture coordinates being consistent, otherwise texture mapping might appear vertically flipped. Historically, OCCT used image library loading images bottom-up, so that applications have to generate UV accordingly (flip V when necessary, V' = 1.0 - V).

Graphic driver now compares this flag with image layout reported by Image_PixMap::IsTopDown(), and in case of mismatch applies implicit texture coordinates conversion in GLSL program.

◆ keepArrayData

bool OpenGl_Caps::keepArrayData

Disables freeing CPU memory after building VBOs (OFF by default)

◆ pntSpritesDisable

bool OpenGl_Caps::pntSpritesDisable

flag permits Point Sprites usage, will significantly affect performance (OFF by default)

◆ sRGBDisable

bool OpenGl_Caps::sRGBDisable

Disables sRGB rendering (OFF by default)

◆ suppressExtraMsg

bool OpenGl_Caps::suppressExtraMsg

Suppress redundant messages from debug GL context. ON by default.

◆ swapInterval

int OpenGl_Caps::swapInterval

controls swap interval - 0 for VSync off and 1 for VSync on, 1 by default

◆ usePolygonMode

bool OpenGl_Caps::usePolygonMode

Enables Polygon Mode instead of built-in GLSL programs (OFF by default; unsupported on OpenGL ES)

◆ useSystemBuffer

bool OpenGl_Caps::useSystemBuffer

Enables usage of system backbuffer for blitting (OFF by default on desktop OpenGL and ON on OpenGL ES for testing)

◆ useZeroToOneDepth

bool OpenGl_Caps::useZeroToOneDepth

use [0, 1] depth range instead of [-1, 1] range, when possible (OFF by default)

◆ vboDisable

bool OpenGl_Caps::vboDisable

disallow VBO usage for debugging purposes (OFF by default)


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