Represents an OpenGL graphics device. More...
#include <Inventor/components/SoGLGraphicDevice.h>
Public Types | |
enum | DeviceType { WINDOW = 0, PBUFFER, BITMAP } |
Public Member Functions | |
SoGLGraphicDevice (SbGlContextHelper::Display display, DeviceType dt=SoGLGraphicDevice::WINDOW) | |
virtual | ~SoGLGraphicDevice () |
SoGLGraphicDevice & | operator() (SbGlContextHelper::Display display) |
SoGraphicConfig * | getBestGraphicConfig (const SoGraphicConfigTemplate &temp) |
SoGraphicConfig * | getDefaultGraphicConfig () |
SoGLGraphicConfigTemplate | getGraphicConfigTemplate (SoGLGraphicConfig *graphicConfig) |
size_t | getNum () |
SoGraphicConfig * | getGraphicConfig (size_t n) |
size_t | getNum (const SoGraphicConfigTemplate &temp) |
SoGraphicConfig * | getGraphicConfig (const SoGraphicConfigTemplate &temp, size_t n) |
SbGlContextHelper::Display | getDisplay () |
This class is an encapsulation of a real graphics device for OpenGL. It could be:
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.
SoGraphicConfigTemplate, SoGLGraphicConfigTemplate, SoGraphicConfig, SoGraphicDevice, SoGLGraphicDevice.
SoGLGraphicDevice::SoGLGraphicDevice | ( | SbGlContextHelper::Display | display, | |
DeviceType | dt = SoGLGraphicDevice::WINDOW | |||
) |
Constructor.
virtual SoGLGraphicDevice::~SoGLGraphicDevice | ( | ) | [virtual] |
Destructor.
SoGraphicConfig* SoGLGraphicDevice::getBestGraphicConfig | ( | const SoGraphicConfigTemplate & | temp | ) | [virtual] |
Returns the best graphics configuration corresponding to the preferences in the specified template.
Implements SoGraphicDevice.
SoGraphicConfig* SoGLGraphicDevice::getDefaultGraphicConfig | ( | ) | [virtual] |
Returns the best graphics configuration corresponding to a graphics template containing the default preferences (see SoGLGraphicConfigTemplate).
Implements SoGraphicDevice.
SbGlContextHelper::Display SoGLGraphicDevice::getDisplay | ( | ) |
Returns the Display corresponding to this graphics device.
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.
SoGraphicConfig* SoGLGraphicDevice::getGraphicConfig | ( | size_t | n | ) | [virtual] |
Returns the n-th of all the graphics configurations supported by this device.
Implements SoGraphicDevice.
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);
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.
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.
size_t SoGLGraphicDevice::getNum | ( | ) | [virtual] |
Returns the number of the graphics configurations supported by this device.
Implements SoGraphicDevice.
SoGLGraphicDevice& SoGLGraphicDevice::operator() | ( | SbGlContextHelper::Display | display | ) |
Allows you to cast Display to SoGLGraphicDevice.