Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoGLFormat Class Reference

VSG extension 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::DisplaygetDisplay () const
 Returns the display on which this format is attached.
 
const SbGlContextHelper::VisualInfogetVisualInfo () 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.
 
SoGLFormatoperator= (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.
 

Detailed Description

VSG extension OpenGL pixel format management class.

This class provides functions to manage OpenGL pixel formats.

Definition at line 54 of file SoGLFormat.h.

Constructor & Destructor Documentation

◆ SoGLFormat() [1/3]

SoGLFormat::SoGLFormat ( )

Default constructor -> we set the default format.

◆ SoGLFormat() [2/3]

SoGLFormat::SoGLFormat ( const SbGlContextHelper::Display display)

Constructor that uses the default format and stores the specified display.

◆ SoGLFormat() [3/3]

SoGLFormat::SoGLFormat ( const SoGLFormat refFormat)

Constructor that initializes the format from the specified one.

◆ ~SoGLFormat()

virtual SoGLFormat::~SoGLFormat ( )
virtual

Destructor.

Member Function Documentation

◆ activate()

bool SoGLFormat::activate ( )

Tries to activate the format for the current display.


The display must be valid (see the setDisplay() function).

◆ getAccumBufferBits()

int SoGLFormat::getAccumBufferBits ( ) const

Returns the accumulation buffer bits of this format.

◆ getAlphaBits()

int SoGLFormat::getAlphaBits ( ) const

◆ getBlueBits()

int SoGLFormat::getBlueBits ( ) const

◆ getDefaultFormat()

static SoGLFormat SoGLFormat::getDefaultFormat ( )
static

Returns the default format used.

◆ getDepthBits()

int SoGLFormat::getDepthBits ( ) const

Returns the depth buffer bits of this format.

◆ getDisplay()

const SbGlContextHelper::Display & SoGLFormat::getDisplay ( ) const

Returns the display on which this format is attached.

◆ getGreenBits()

int SoGLFormat::getGreenBits ( ) const

◆ getNearest()

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

◆ getRedBits()

int SoGLFormat::getRedBits ( ) const

◆ getSamplesCount()

int SoGLFormat::getSamplesCount ( ) const

Returns the samples count of this format.

◆ getStencilBufferBits()

int SoGLFormat::getStencilBufferBits ( ) const

Returns the stencil buffer bits of this format.

◆ getVisualInfo()

const SbGlContextHelper::VisualInfo & SoGLFormat::getVisualInfo ( ) const

Returns the visual info of the format.


Can be NULL if the format has never been activated.

◆ getVisualInfoId()

int SoGLFormat::getVisualInfoId ( ) const

Returns the PFD associated with this visualInfo.

◆ hasAccumBuffer()

bool SoGLFormat::hasAccumBuffer ( ) const

Returns true if this format has an accumulation buffer.

◆ hasAlpha()

bool SoGLFormat::hasAlpha ( ) const

Returns true if this format has an alpha channel.

◆ hasDepth()

bool SoGLFormat::hasDepth ( ) const

Returns true if this format has a depth buffer.

◆ hasDoubleBuffers()

bool SoGLFormat::hasDoubleBuffers ( ) const

Returns true if this format is double buffered.

◆ hasFloatColorBuffer()

bool SoGLFormat::hasFloatColorBuffer ( ) const

Returns true if this format has a float color buffer.

◆ hasRgb()

bool SoGLFormat::hasRgb ( ) const

Returns true if this format is RGB.

◆ hasSampleBuffers()

bool SoGLFormat::hasSampleBuffers ( ) const

Returns true if this format has sample buffers.

◆ hasStencilBuffer()

bool SoGLFormat::hasStencilBuffer ( ) const

Returns true if this format has a stencil buffer.

◆ hasStereo()

bool SoGLFormat::hasStereo ( ) const

Returns true if this format has stereo.

◆ isAccelerationRequired()

bool SoGLFormat::isAccelerationRequired ( ) const

Returns TRUE if hardware acceleration support is required for this pixel format.

◆ isAvailable()

bool SoGLFormat::isAvailable ( ) const

Returns true if this format is available on the system.


The display must be valid (see the setDisplay() function).

◆ isCompositionRequired()

bool SoGLFormat::isCompositionRequired ( ) const

Returns true if composition is required for this pixel format.

◆ isGDISupportRequired()

bool SoGLFormat::isGDISupportRequired ( ) const

Returns true if GDI support is required for this pixel format.

◆ isSoftwareRendererRequired()

bool SoGLFormat::isSoftwareRendererRequired ( ) const

Returns true if the software renderer is required for this format.

◆ operator=()

SoGLFormat & SoGLFormat::operator= ( const SoGLFormat ref)

Operator = to copy the data.

◆ setAccelerationRequired()

void SoGLFormat::setAccelerationRequired ( const bool  enable)

Sets the hardware acceleration support requirement of this pixel format.

◆ setAccumBufferBits()

void SoGLFormat::setAccumBufferBits ( const int  size)

Sets the accumulation buffer bits of this format.

◆ setAccumBufferEnabled()

void SoGLFormat::setAccumBufferEnabled ( const bool  enabled)

Sets the accumulation buffer state of this format.

◆ setAlphaBits()

void SoGLFormat::setAlphaBits ( int  bits)

◆ setAlphaEnabled()

void SoGLFormat::setAlphaEnabled ( const bool  enable)

Sets the alpha channel state of this format.

◆ setBlueBits()

void SoGLFormat::setBlueBits ( int  bits)

◆ setCompositionRequired()

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

◆ setDepthBits()

void SoGLFormat::setDepthBits ( const int  bits)

Sets the depth buffer bits of this format.

◆ setDepthEnabled()

void SoGLFormat::setDepthEnabled ( const bool  enable)

Sets the depth buffer state of this format.

◆ setDisplay()

void SoGLFormat::setDisplay ( const SbGlContextHelper::Display display)

Sets the display associated with this format.

◆ setDoubleBuffersEnabled()

void SoGLFormat::setDoubleBuffersEnabled ( const bool  enabled)

Sets the double buffering state of this format.

◆ setFloatColorBufferEnabled()

void SoGLFormat::setFloatColorBufferEnabled ( const bool  enable)

Sets the Float color buffer state of this format.

◆ setGDISupportRequired()

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.

◆ setGreenBits()

void SoGLFormat::setGreenBits ( int  bits)

◆ setOpenglAttributes()

void SoGLFormat::setOpenglAttributes ( const SbGlContextHelper::Display display,
int  pfd,
int *  attributes,
int *  results 
)

Sets the format according to the openGL attributes.

◆ setRedBits()

void SoGLFormat::setRedBits ( int  bits)

◆ setRgbEnabled()

void SoGLFormat::setRgbEnabled ( const bool  enabled)

Sets the RGB state of this format.

◆ setSampleBuffersEnabled()

void SoGLFormat::setSampleBuffersEnabled ( const bool  enable)

Sets the sample buffers state of this format.

◆ setSamplesCount()

void SoGLFormat::setSamplesCount ( const int  countSamples)

Sets the samples count of this format.

◆ setSoftwareRendererRequired()

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

◆ setStencilBufferBits()

void SoGLFormat::setStencilBufferBits ( const int  size)

Sets the stencil buffer bits of this format.

◆ setStencilBufferEnabled()

void SoGLFormat::setStencilBufferEnabled ( const bool  enabled)

Sets the stencil buffer state of this format.

◆ setStereoEnabled()

void SoGLFormat::setStereoEnabled ( const bool  enable)

Sets the stereo state of this format.

◆ setVisualInfo()

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.

◆ setVisualInfoId()

void SoGLFormat::setVisualInfoId ( const int  viId)

Sets the PFD id associated with this visualInfo.


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