Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoGLGraphicDevice Class Reference

VSG extension Represents an OpenGL graphics device. More...

#include <Inventor/components/SoGLGraphicDevice.h>

+ Inheritance diagram for SoGLGraphicDevice:

Public Types

enum  DeviceType {
  WINDOW = 0 ,
  PBUFFER ,
  BITMAP
}
 Device types. More...
 

Public Member Functions

 SoGLGraphicDevice (SbGlContextHelper::Display display, DeviceType dt=SoGLGraphicDevice::WINDOW)
 Constructor.
 
virtual ~SoGLGraphicDevice ()
 Destructor.
 
SoGLGraphicDeviceoperator() (SbGlContextHelper::Display display)
 Allows you to cast Display to SoGLGraphicDevice.
 
SoGraphicConfiggetBestGraphicConfig (const SoGraphicConfigTemplate &temp)
 Returns the best graphics configuration corresponding to the preferences in the specified template.
 
SoGraphicConfiggetDefaultGraphicConfig ()
 Returns the best graphics configuration corresponding to a graphics template containing the default preferences (see SoGLGraphicConfigTemplate).
 
SoGLGraphicConfigTemplate getGraphicConfigTemplate (SoGLGraphicConfig *graphicConfig)
 Returns a template corresponding to the given graphics configuration.
 
size_t getNum ()
 Returns the number of the graphics configurations supported by this device.
 
SoGraphicConfiggetGraphicConfig (size_t n)
 Returns the n-th of all the graphics configurations supported by this device.
 
size_t getNum (const SoGraphicConfigTemplate &temp)
 Returns the number of the graphics configurations supported by this device and the given template.
 
SoGraphicConfiggetGraphicConfig (const SoGraphicConfigTemplate &temp, size_t n)
 Returns the best nth of all the graphics configurations supported by this device and sorted according to the given template.
 
SbGlContextHelper::Display getDisplay ()
 Returns the Display corresponding to this graphics device.
 
- Public Member Functions inherited from SoGraphicDevice
virtual ~SoGraphicDevice ()
 Destructor.
 

Detailed Description

VSG extension Represents an OpenGL graphics device.

This class is an encapsulation of a real graphics device for OpenGL. It could be:

  • a Microsoft Windows device context (HDC)
  • an X Windows graphics display (Display *)

This class provides convenience methods to get the system-dependent identifier, i.e., the HDC or the Display *. It provides methods to query the supported OpenGL graphics configurations and to sort them according to the preferences specified in a graphics template.

SEE ALSO

SoGraphicConfigTemplate, SoGLGraphicConfigTemplate, SoGraphicConfig, SoGraphicDevice, SoGLGraphicDevice.

Definition at line 69 of file SoGLGraphicDevice.h.

Member Enumeration Documentation

◆ DeviceType

Device types.

Enumerator
WINDOW 

Window.

PBUFFER 

PBuffer.

BITMAP 

Bitmap.

Definition at line 74 of file SoGLGraphicDevice.h.

Constructor & Destructor Documentation

◆ SoGLGraphicDevice()

SoGLGraphicDevice::SoGLGraphicDevice ( SbGlContextHelper::Display  display,
DeviceType  dt = SoGLGraphicDevice::WINDOW 
)

Constructor.

◆ ~SoGLGraphicDevice()

virtual SoGLGraphicDevice::~SoGLGraphicDevice ( )
virtual

Destructor.

Member Function Documentation

◆ getBestGraphicConfig()

SoGraphicConfig * SoGLGraphicDevice::getBestGraphicConfig ( const SoGraphicConfigTemplate temp)
virtual

Returns the best graphics configuration corresponding to the preferences in the specified template.

Implements SoGraphicDevice.

◆ getDefaultGraphicConfig()

SoGraphicConfig * SoGLGraphicDevice::getDefaultGraphicConfig ( )
virtual

Returns the best graphics configuration corresponding to a graphics template containing the default preferences (see SoGLGraphicConfigTemplate).

Implements SoGraphicDevice.

◆ getDisplay()

SbGlContextHelper::Display SoGLGraphicDevice::getDisplay ( )

Returns the Display corresponding to this graphics device.

◆ getGraphicConfig() [1/2]

SoGraphicConfig * SoGLGraphicDevice::getGraphicConfig ( const SoGraphicConfigTemplate temp,
size_t  n 
)
virtual

Returns the best nth of all the graphics configurations supported by this device and sorted according to the given template.

Implements SoGraphicDevice.

◆ getGraphicConfig() [2/2]

SoGraphicConfig * SoGLGraphicDevice::getGraphicConfig ( size_t  n)
virtual

Returns the n-th of all the graphics configurations supported by this device.

Implements SoGraphicDevice.

◆ getGraphicConfigTemplate()

SoGLGraphicConfigTemplate SoGLGraphicDevice::getGraphicConfigTemplate ( SoGLGraphicConfig graphicConfig)

Returns a template corresponding to the given graphics configuration.

The returned template, if passed to SoGLGraphicDevice::getBestGraphicConfig, would return the originally specified (or a functionally equivalent) graphicConfig as the best graphic configuration.

For example, if graphicConfig supports an accumulation buffer and its R/G/B/A sizes are respectively 24,24,24,16, then the returned template is set as if you had called:

temp.setAccum(SoGraphicConfigTemplate::REQUIRED, 24, 24, 24, 16, 24, 24, 24, 16);
@ REQUIRED
Means crucial and absolutely required.

If graphicConfig does not support an accumulation buffer, then the returned template is set as if you had called:

temp.setAccum(SoGraphicConfigTemplate::REQUIRED, 0, 0, 0, 0, 0, 0, 0, 0);

It is not guaranteed that the template returned by this method will select exactly the same graphics configuration as was passed to this method. However, it will select a graphics configuration with the same OpenGL capabilities and values.

◆ getNum() [1/2]

size_t SoGLGraphicDevice::getNum ( )
virtual

Returns the number of the graphics configurations supported by this device.

Implements SoGraphicDevice.

◆ getNum() [2/2]

size_t SoGLGraphicDevice::getNum ( const SoGraphicConfigTemplate temp)
virtual

Returns the number of the graphics configurations supported by this device and the given template.

Implements SoGraphicDevice.

◆ operator()()

SoGLGraphicDevice & SoGLGraphicDevice::operator() ( SbGlContextHelper::Display  display)

Allows you to cast Display to SoGLGraphicDevice.


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