SoGLFormat Class Reference
[GL device]

VSG extension OpenGL pixel format management class. More...

#include <Inventor/devices/SoGLFormat.h>

List of all members.

Public Member Functions

 SoGLFormat ()
 SoGLFormat (const SbGlContextHelper::Display &display)
 SoGLFormat (const SoGLFormat &refFormat)
virtual ~SoGLFormat ()
void setDoubleBuffersEnabled (const bool enabled)
bool hasDoubleBuffers () const
bool hasDepth () const
void setDepthEnabled (const bool enable)
void setDepthBits (const int bits)
int getDepthBits () const
bool hasAlpha () const
void setAlphaEnabled (const bool enable)
void setSampleBuffersEnabled (const bool enable)
bool hasSampleBuffers () const
void setSamplesCount (const int countSamples)
int getSamplesCount () const
void setStereoEnabled (const bool enable)
bool hasStereo () const
void setRgbEnabled (const bool enabled)
bool hasRgb () const
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)
bool hasFloatColorBuffer () const
void setStencilBufferEnabled (const bool enabled)
bool hasStencilBuffer () const
void setStencilBufferBits (const int size)
int getStencilBufferBits () const
void setAccumBufferEnabled (const bool enabled)
bool hasAccumBuffer () const
void setAccumBufferBits (const int size)
int getAccumBufferBits () const
bool isAvailable () const
SoGLFormat getNearest () const
bool activate ()
const SbGlContextHelper::DisplaygetDisplay () const
const
SbGlContextHelper::VisualInfo
getVisualInfo () const
void setCompositionRequired (const bool required)
bool isCompositionRequired () const
void setGDISupportRequired (const bool required)
bool isGDISupportRequired () const
void setAccelerationRequired (const bool enable)
bool isAccelerationRequired () const
void setDisplay (const SbGlContextHelper::Display &display)
void setVisualInfo (const SbGlContextHelper::VisualInfo &visualInfo)
void setVisualInfoId (const int viId)
int getVisualInfoId () const
void setOpenglAttributes (const SbGlContextHelper::Display &display, int pfd, int *attributes, int *results)
SoGLFormatoperator= (const SoGLFormat &ref)
void setSoftwareRendererRequired (const bool enable)
bool isSoftwareRendererRequired () const

Static Public Member Functions

static SoGLFormat getDefaultFormat ()

Detailed Description

VSG extension OpenGL pixel format management class.

This class provides functions to manage OpenGL pixel formats.


Constructor & Destructor Documentation

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 SoGLFormat::~SoGLFormat (  )  [virtual]

Destructor.


Member Function Documentation

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 SoGLFormat SoGLFormat::getDefaultFormat (  )  [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.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/