Open CASCADE Technology  7.5.0
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!
Standard_Boolean sRGBDisable
 Disables sRGB rendering (OFF by default) More...
 
Standard_Boolean compressedTexturesDisable
 Disables uploading of compressed texture formats native to GPU (OFF by default) More...
 
Standard_Boolean vboDisable
 disallow VBO usage for debugging purposes (OFF by default) More...
 
Standard_Boolean pntSpritesDisable
 flag permits Point Sprites usage, will significantly affect performance (OFF by default) More...
 
Standard_Boolean keepArrayData
 Disables freeing CPU memory after building VBOs (OFF by default) More...
 
Standard_Boolean ffpEnable
 Enables FFP (fixed-function pipeline), do not use built-in GLSL programs (OFF by default) More...
 
Standard_Boolean usePolygonMode
 Enables Polygon Mode instead of built-in GLSL programs (OFF by default; unsupported on OpenGL ES) More...
 
Standard_Boolean useSystemBuffer
 Enables usage of system backbuffer for blitting (OFF by default on desktop OpenGL and ON on OpenGL ES for testing) More...
 
Standard_Integer swapInterval
 controls swap interval - 0 for VSync off and 1 for VSync on, 1 by default More...
 
context creation parameters
Standard_Boolean buffersNoSwap
 
Standard_Boolean contextStereo
 
Standard_Boolean contextDebug
 
Standard_Boolean contextSyncDebug
 
Standard_Boolean contextNoAccel
 
Standard_Boolean contextCompatible
 
Standard_Boolean contextNoExtensions
 
Standard_Integer contextMajorVersionUpper
 
Standard_Integer contextMinorVersionUpper
 
Standard_Boolean isTopDownTextureUV
 
flags to activate verbose output
Standard_Boolean glslWarnings
 Print GLSL program compilation/linkage warnings, if any. OFF by default. More...
 
Standard_Boolean suppressExtraMsg
 Suppress redundant messages from debug GL context. ON by default. More...
 
OpenGl_ShaderProgramDumpLevel glslDumpLevel
 Print GLSL program source code. OFF by default. More...
 

class methods

 OpenGl_Caps ()
 Default constructor - initialize with most optimal values. More...
 
virtual ~OpenGl_Caps ()
 Destructor. More...
 
OpenGl_Capsoperator= (const OpenGl_Caps &theCopy)
 Copy maker. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

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 ( )

Default constructor - initialize with most optimal values.

◆ ~OpenGl_Caps()

virtual OpenGl_Caps::~OpenGl_Caps ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

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

Copy maker.

Field Documentation

◆ buffersNoSwap

Standard_Boolean 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.

◆ compressedTexturesDisable

Standard_Boolean OpenGl_Caps::compressedTexturesDisable

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

◆ contextCompatible

Standard_Boolean 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 provie FFP compatibility). Interacts with ffpEnable option, which should be disabled within core profile.

ON by default.

◆ contextDebug

Standard_Boolean 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

Standard_Integer 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

Standard_Integer 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

Standard_Boolean 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

Standard_Boolean OpenGl_Caps::contextNoExtensions

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

OFF by default.

◆ contextStereo

Standard_Boolean OpenGl_Caps::contextStereo

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

OFF by default.

◆ contextSyncDebug

Standard_Boolean 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

Standard_Boolean 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

Standard_Boolean OpenGl_Caps::glslWarnings

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

◆ isTopDownTextureUV

Standard_Boolean 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

Standard_Boolean OpenGl_Caps::keepArrayData

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

◆ pntSpritesDisable

Standard_Boolean OpenGl_Caps::pntSpritesDisable

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

◆ sRGBDisable

Standard_Boolean OpenGl_Caps::sRGBDisable

Disables sRGB rendering (OFF by default)

◆ suppressExtraMsg

Standard_Boolean OpenGl_Caps::suppressExtraMsg

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

◆ swapInterval

Standard_Integer OpenGl_Caps::swapInterval

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

◆ usePolygonMode

Standard_Boolean OpenGl_Caps::usePolygonMode

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

◆ useSystemBuffer

Standard_Boolean OpenGl_Caps::useSystemBuffer

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

◆ vboDisable

Standard_Boolean OpenGl_Caps::vboDisable

disallow VBO usage for debugging purposes (OFF by default)


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