OpenGL pixel format management class.
More...
#include <Inventor/devices/SoGLFormat.h>
Public Member Functions | |
| SoGLFormat () | |
| Default constructor -> we set the default format. | |
| SoGLFormat (const SbGlContextHelper::Display &display) | |
| Constructor that uses the default format and stores the specified display. | |
| SoGLFormat (const SoGLFormat &refFormat) | |
| Constructor that initializes the format from the specified one. | |
| virtual | ~SoGLFormat () |
| Destructor. | |
| void | setDoubleBuffersEnabled (const bool enabled) |
| Sets the double buffering state of this format. | |
| bool | hasDoubleBuffers () const |
| Returns true if this format is double buffered. | |
| bool | hasDepth () const |
| Returns true if this format has a depth buffer. | |
| void | setDepthEnabled (const bool enable) |
| Sets the depth buffer state of this format. | |
| void | setDepthBits (const int bits) |
| Sets the depth buffer bits of this format. | |
| int | getDepthBits () const |
| Returns the depth buffer bits of this format. | |
| bool | hasAlpha () const |
| Returns true if this format has an alpha channel. | |
| void | setAlphaEnabled (const bool enable) |
| Sets the alpha channel state of this format. | |
| void | setSampleBuffersEnabled (const bool enable) |
| Sets the sample buffers state of this format. | |
| bool | hasSampleBuffers () const |
| Returns true if this format has sample buffers. | |
| void | setSamplesCount (const int countSamples) |
| Sets the samples count of this format. | |
| int | getSamplesCount () const |
| Returns the samples count of this format. | |
| void | setStereoEnabled (const bool enable) |
| Sets the stereo state of this format. | |
| bool | hasStereo () const |
| Returns true if this format has stereo. | |
| void | setRgbEnabled (const bool enabled) |
| Sets the RGB state of this format. | |
| bool | hasRgb () const |
| Returns true if this format is RGB. | |
| void | setRedBits (int bits) |
| int | getRedBits () const |
| void | setGreenBits (int bits) |
| int | getGreenBits () const |
| void | setBlueBits (int bits) |
| int | getBlueBits () const |
| void | setAlphaBits (int bits) |
| int | getAlphaBits () const |
| void | setFloatColorBufferEnabled (const bool enable) |
| Sets the Float color buffer state of this format. | |
| bool | hasFloatColorBuffer () const |
| Returns true if this format has a float color buffer. | |
| void | setStencilBufferEnabled (const bool enabled) |
| Sets the stencil buffer state of this format. | |
| bool | hasStencilBuffer () const |
| Returns true if this format has a stencil buffer. | |
| void | setStencilBufferBits (const int size) |
| Sets the stencil buffer bits of this format. | |
| int | getStencilBufferBits () const |
| Returns the stencil buffer bits of this format. | |
| void | setAccumBufferEnabled (const bool enabled) |
| Sets the accumulation buffer state of this format. | |
| bool | hasAccumBuffer () const |
| Returns true if this format has an accumulation buffer. | |
| void | setAccumBufferBits (const int size) |
| Sets the accumulation buffer bits of this format. | |
| int | getAccumBufferBits () const |
| Returns the accumulation buffer bits of this format. | |
| bool | isAvailable () const |
| Returns true if this format is available on the system. | |
| SoGLFormat | getNearest () const |
| Returns the supported format which is the nearest available on this system. | |
| bool | activate () |
| Tries to activate the format for the current display. | |
| const SbGlContextHelper::Display & | getDisplay () const |
| Returns the display on which this format is attached. | |
| const SbGlContextHelper::VisualInfo & | getVisualInfo () const |
| Returns the visual info of the format. | |
| void | setCompositionRequired (const bool required) |
| Sets the composition requirement of the pixel format. | |
| bool | isCompositionRequired () const |
| Returns true if composition is required for this pixel format. | |
| void | setGDISupportRequired (const bool required) |
| Sets the GDI support requirement of the pixel format. | |
| bool | isGDISupportRequired () const |
| Returns true if GDI support is required for this pixel format. | |
| void | setAccelerationRequired (const bool enable) |
| Sets the hardware acceleration support requirement of this pixel format. | |
| bool | isAccelerationRequired () const |
| Returns TRUE if hardware acceleration support is required for this pixel format. | |
| void | setDisplay (const SbGlContextHelper::Display &display) |
| Sets the display associated with this format. | |
| void | setVisualInfo (const SbGlContextHelper::VisualInfo &visualInfo) |
| Sets the visual info associated with this format. | |
| void | setVisualInfoId (const int viId) |
| Sets the PFD id associated with this visualInfo. | |
| int | getVisualInfoId () const |
| Returns the PFD associated with this visualInfo. | |
| void | setOpenglAttributes (const SbGlContextHelper::Display &display, int pfd, int *attributes, int *results) |
| Sets the format according to the openGL attributes. | |
| SoGLFormat & | operator= (const SoGLFormat &ref) |
| Operator = to copy the data. | |
| void | setSoftwareRendererRequired (const bool enable) |
| Specified that a software renderer is required for this format. | |
| bool | isSoftwareRendererRequired () const |
| Returns true if the software renderer is required for this format. | |
Static Public Member Functions | |
| static SoGLFormat | getDefaultFormat () |
| Returns the default format used. | |
OpenGL pixel format management class.
This class provides functions to manage OpenGL pixel formats.
Definition at line 54 of file SoGLFormat.h.
| SoGLFormat::SoGLFormat | ( | ) |
Default constructor -> we set the default format.
| SoGLFormat::SoGLFormat | ( | const SbGlContextHelper::Display & | display | ) |
Constructor that uses the default format and stores the specified display.
| SoGLFormat::SoGLFormat | ( | const SoGLFormat & | refFormat | ) |
Constructor that initializes the format from the specified one.
|
virtual |
Destructor.
| bool SoGLFormat::activate | ( | ) |
Tries to activate the format for the current display.
The display must be valid (see the setDisplay() function).
| int SoGLFormat::getAccumBufferBits | ( | ) | const |
Returns the accumulation buffer bits of this format.
| int SoGLFormat::getAlphaBits | ( | ) | const |
| int SoGLFormat::getBlueBits | ( | ) | const |
|
static |
Returns the default format used.
| int SoGLFormat::getDepthBits | ( | ) | const |
Returns the depth buffer bits of this format.
| const SbGlContextHelper::Display & SoGLFormat::getDisplay | ( | ) | const |
Returns the display on which this format is attached.
| int SoGLFormat::getGreenBits | ( | ) | const |
| SoGLFormat SoGLFormat::getNearest | ( | ) | const |
Returns the supported format which is the nearest available on this system.
The display must be valid (see the setDisplay() function).
| int SoGLFormat::getRedBits | ( | ) | const |
| int SoGLFormat::getSamplesCount | ( | ) | const |
Returns the samples count of this format.
| int SoGLFormat::getStencilBufferBits | ( | ) | const |
Returns the stencil buffer bits of this format.
| const SbGlContextHelper::VisualInfo & SoGLFormat::getVisualInfo | ( | ) | const |
Returns the visual info of the format.
Can be NULL if the format has never been activated.
| int SoGLFormat::getVisualInfoId | ( | ) | const |
Returns the PFD associated with this visualInfo.
| bool SoGLFormat::hasAccumBuffer | ( | ) | const |
Returns true if this format has an accumulation buffer.
| bool SoGLFormat::hasAlpha | ( | ) | const |
Returns true if this format has an alpha channel.
| bool SoGLFormat::hasDepth | ( | ) | const |
Returns true if this format has a depth buffer.
| bool SoGLFormat::hasDoubleBuffers | ( | ) | const |
Returns true if this format is double buffered.
| bool SoGLFormat::hasFloatColorBuffer | ( | ) | const |
Returns true if this format has a float color buffer.
| bool SoGLFormat::hasRgb | ( | ) | const |
Returns true if this format is RGB.
| bool SoGLFormat::hasSampleBuffers | ( | ) | const |
Returns true if this format has sample buffers.
| bool SoGLFormat::hasStencilBuffer | ( | ) | const |
Returns true if this format has a stencil buffer.
| bool SoGLFormat::hasStereo | ( | ) | const |
Returns true if this format has stereo.
| bool SoGLFormat::isAccelerationRequired | ( | ) | const |
Returns TRUE if hardware acceleration support is required for this pixel format.
| bool SoGLFormat::isAvailable | ( | ) | const |
Returns true if this format is available on the system.
The display must be valid (see the setDisplay() function).
| bool SoGLFormat::isCompositionRequired | ( | ) | const |
Returns true if composition is required for this pixel format.
| bool SoGLFormat::isGDISupportRequired | ( | ) | const |
Returns true if GDI support is required for this pixel format.
| bool SoGLFormat::isSoftwareRendererRequired | ( | ) | const |
Returns true if the software renderer is required for this format.
| SoGLFormat & SoGLFormat::operator= | ( | const SoGLFormat & | ref | ) |
Operator = to copy the data.
| void SoGLFormat::setAccelerationRequired | ( | const bool | enable | ) |
Sets the hardware acceleration support requirement of this pixel format.
| void SoGLFormat::setAccumBufferBits | ( | const int | size | ) |
Sets the accumulation buffer bits of this format.
| void SoGLFormat::setAccumBufferEnabled | ( | const bool | enabled | ) |
Sets the accumulation buffer state of this format.
| void SoGLFormat::setAlphaBits | ( | int | bits | ) |
| void SoGLFormat::setAlphaEnabled | ( | const bool | enable | ) |
Sets the alpha channel state of this format.
| void SoGLFormat::setBlueBits | ( | int | bits | ) |
| void SoGLFormat::setCompositionRequired | ( | const bool | required | ) |
Sets the composition requirement of the pixel format.
This requirement is ignored on non-Microsoft platforms and on Windows platforms before Windows Vista. Requiring composition will automatically disable GDI support for this format (this is a Microsoft limitation).
Note: If both setCompositionRequired() and setGDISupportRequired() are set OpenInventor will try to choose a pixel format with composition support.
The default value is false but can be overridden using the OIV_PFD_SUPPORT_COMPOSITION preference (see SoPreferences).
| void SoGLFormat::setDepthBits | ( | const int | bits | ) |
Sets the depth buffer bits of this format.
| void SoGLFormat::setDepthEnabled | ( | const bool | enable | ) |
Sets the depth buffer state of this format.
| void SoGLFormat::setDisplay | ( | const SbGlContextHelper::Display & | display | ) |
Sets the display associated with this format.
| void SoGLFormat::setDoubleBuffersEnabled | ( | const bool | enabled | ) |
Sets the double buffering state of this format.
| void SoGLFormat::setFloatColorBufferEnabled | ( | const bool | enable | ) |
Sets the Float color buffer state of this format.
| void SoGLFormat::setGDISupportRequired | ( | const bool | required | ) |
Sets the GDI support requirement of the pixel format.
This requirement is ignored on non-Microsoft platforms.
Note: If both setCompositionRequired() and setGDISupportRequired() are set OpenInventor will try to choose a pixel format with composition support.
The default value is true but setting composition required to true automatically disables GDI support.
| void SoGLFormat::setGreenBits | ( | int | bits | ) |
| void SoGLFormat::setOpenglAttributes | ( | const SbGlContextHelper::Display & | display, |
| int | pfd, | ||
| int * | attributes, | ||
| int * | results ) |
Sets the format according to the openGL attributes.
| void SoGLFormat::setRedBits | ( | int | bits | ) |
| void SoGLFormat::setRgbEnabled | ( | const bool | enabled | ) |
Sets the RGB state of this format.
| void SoGLFormat::setSampleBuffersEnabled | ( | const bool | enable | ) |
Sets the sample buffers state of this format.
| void SoGLFormat::setSamplesCount | ( | const int | countSamples | ) |
Sets the samples count of this format.
| void SoGLFormat::setSoftwareRendererRequired | ( | const bool | enable | ) |
Specified that a software renderer is required for this format.
This option is set to false by default. If this option is set to true it overrides setAccelerationRequired().
Note: This method is only implemented on Microsoft platforms in order to use the generic renderer provided by Microsoft.
Note: This option is currently checked only by the QtViewer classes (to switch on or off direct rendering).
| void SoGLFormat::setStencilBufferBits | ( | const int | size | ) |
Sets the stencil buffer bits of this format.
| void SoGLFormat::setStencilBufferEnabled | ( | const bool | enabled | ) |
Sets the stencil buffer state of this format.
| void SoGLFormat::setStereoEnabled | ( | const bool | enable | ) |
Sets the stereo state of this format.
| void SoGLFormat::setVisualInfo | ( | const SbGlContextHelper::VisualInfo & | visualInfo | ) |
Sets the visual info associated with this format.
Note: A valid Display must be set using the function setDisplay() before calling this function. On some platforms the display is needed in order to parse the options stored in the visualInfo.
| void SoGLFormat::setVisualInfoId | ( | const int | viId | ) |
Sets the PFD id associated with this visualInfo.