VTK
Enumerations | Functions | Variables
vtkOpenGLExtensionManager.h File Reference

Go to the source code of this file.

Enumerations

enum  DriverGLVendorIdType {
  DRIVER_VENDOR_UNKNOWN =0, DRIVER_VENDOR_ATI, DRIVER_VENDOR_NVIDIA, DRIVER_VENDOR_INTEL,
  DRIVER_VENDOR_MESA, DRIVER_VENDOR_MICROSOFT
}
 

Functions

virtual void Update ()
 Updates the extensions string. More...
 
virtual int ExtensionSupported (const char *name)
 Returns true if the extension is supported, false otherwise. More...
 
virtual vtkOpenGLExtensionManagerFunctionPointer GetProcAddress (const char *fname)
 Returns a function pointer to the OpenGL extension function with the given name. More...
 
virtual void LoadExtension (const char *name)
 Loads all the functions associated with the given extension into the appropriate static members of vtkgl. More...
 
virtual int LoadSupportedExtension (const char *name)
 Returns true if the extension is supported and loaded successfully, false otherwise. More...
 
virtual void LoadCorePromotedExtension (const char *name)
 Loads all the functions associated with the given core-promoted extension into the appropriate static members of vtkgl associated with the OpenGL version that promoted the extension as a core feature. More...
 
virtual void LoadAsARBExtension (const char *name)
 Similar to LoadCorePromotedExtension(). More...
 
virtual int GetDriverVersionMajor ()
 Return the driver's version parts. More...
 
virtual int GetDriverVersionMinor ()
 
virtual int GetDriverVersionPatch ()
 
virtual int GetDriverGLVersionMajor ()
 Get GL API version that the driver provides. More...
 
virtual int GetDriverGLVersionMinor ()
 
virtual int GetDriverGLVersionPatch ()
 
virtual bool DriverGLRendererIsOSMesa ()
 Test for Mesa's offscreen renderer. More...
 
virtual const char * GetDriverGLVendor ()
 Get the OpenGL version, vendor and renderer strings. More...
 
virtual const char * GetDriverGLVersion ()
 
virtual const char * GetDriverGLRenderer ()
 
 vtkOpenGLExtensionManager ()
 
virtual ~vtkOpenGLExtensionManager ()
 
virtual void InitializeDriverInformation ()
 
virtual void ReadOpenGLExtensions ()
 
virtual int SafeLoadExtension (const char *name)
 Wrap around the generated vtkgl::LoadExtension to deal with OpenGL 1.2 and its optional part GL_ARB_imaging. More...
 
vtkRenderWindowGetRenderWindow ()
 
virtual void SetRenderWindow (vtkRenderWindow *renwin)
 
 vtkGetStringMacro (ExtensionsString)
 Returns a string listing all available extensions. More...
 
virtual bool DriverIsATI ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverIsNvidia ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverIsIntel ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverIsMesa ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverIsMicrosoft ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverVersionIs (int major)
 Test for a specific driver version. More...
 
virtual bool DriverVersionIs (int major, int minor)
 Test for a specific driver version. More...
 
virtual bool DriverVersionIs (int major, int minor, int patch)
 Test for a specific driver version. More...
 
virtual bool DriverVersionAtLeast (int major)
 Test for driver version greater than or equal to the named version. More...
 
virtual bool DriverVersionAtLeast (int major, int minor)
 Test for driver version greater than or equal to the named version. More...
 
virtual bool DriverVersionAtLeast (int major, int minor, int patch)
 Test for driver version greater than or equal to the named version. More...
 
virtual bool DriverGLVersionIs (int major, int minor, int patch)
 Test for the driver's GL version as reported in its GL_VERSION string. More...
 
virtual bool DriverGLVersionIs (int major, int minor)
 Test for the driver's GL version as reported in its GL_VERSION string. More...
 
virtual bool DriverGLRendererIs (const char *str)
 Test for a specific renderer. More...
 
virtual bool DriverGLRendererHas (const char *str)
 Test for a specific renderer. More...
 
virtual bool DriverGLRendererHasToken (const char *str)
 Test for a specific renderer. More...
 
bool GetIgnoreDriverBugs (const char *description)
 When set known driver bugs are ignored during driver feature detection. More...
 
 vtkSetMacro (IgnoreDriverBugs, bool)
 When set known driver bugs are ignored during driver feature detection. More...
 
 vtkBooleanMacro (IgnoreDriverBugs, bool)
 When set known driver bugs are ignored during driver feature detection. More...
 

Variables

int OwnRenderWindow
 
char * ExtensionsString
 
vtkTimeStamp BuildTime
 
std::string DriverGLVersion
 
int DriverGLVersionMajor
 
int DriverGLVersionMinor
 
int DriverGLVersionPatch
 
std::string DriverGLVendor
 
std::string DriverGLRenderer
 
int DriverVersionMajor
 
int DriverVersionMinor
 
int DriverVersionPatch
 
DriverGLVendorIdType DriverGLVendorId
 
bool IgnoreDriverBugs
 
vtkWeakPointer< vtkRenderWindowRenderWindow
 

Enumeration Type Documentation

enum DriverGLVendorIdType
protected
Enumerator
DRIVER_VENDOR_UNKNOWN 
DRIVER_VENDOR_ATI 
DRIVER_VENDOR_NVIDIA 
DRIVER_VENDOR_INTEL 
DRIVER_VENDOR_MESA 
DRIVER_VENDOR_MICROSOFT 

Definition at line 402 of file vtkOpenGLExtensionManager.h.

Function Documentation

vtkRenderWindow* GetRenderWindow ( )
virtual void SetRenderWindow ( vtkRenderWindow renwin)
virtual
virtual void Update ( )
virtual

Updates the extensions string.

vtkGetStringMacro ( ExtensionsString  )

Returns a string listing all available extensions.

Call Update first to validate this string.

virtual int ExtensionSupported ( const char *  name)
virtual

Returns true if the extension is supported, false otherwise.

virtual vtkOpenGLExtensionManagerFunctionPointer GetProcAddress ( const char *  fname)
virtual

Returns a function pointer to the OpenGL extension function with the given name.

Returns NULL if the function could not be retrieved.

virtual void LoadExtension ( const char *  name)
virtual

Loads all the functions associated with the given extension into the appropriate static members of vtkgl.

This method emits a warning if the requested extension is not supported. It emits an error if the extension does not load successfully.

virtual int LoadSupportedExtension ( const char *  name)
virtual

Returns true if the extension is supported and loaded successfully, false otherwise.

This method will "fail silently/gracefully" if the extension is not supported or does not load properly. It emits neither warnings nor errors. It is up to the caller to determine if the extension loaded properly by paying attention to the return value.

virtual void LoadCorePromotedExtension ( const char *  name)
virtual

Loads all the functions associated with the given core-promoted extension into the appropriate static members of vtkgl associated with the OpenGL version that promoted the extension as a core feature.

This method emits a warning if the requested extension is not supported. It emits an error if the extension does not load successfully.

For instance, extension GL_ARB_multitexture was promoted as a core feature into OpenGL 1.3. An implementation that uses this feature has to (IN THIS ORDER), check if OpenGL 1.3 is supported with ExtensionSupported("GL_VERSION_1_3"), if true, load the extension with LoadExtension("GL_VERSION_1_3"). If false, test for the extension with ExtensionSupported("GL_ARB_multitexture"),if true load the extension with this method LoadCorePromotedExtension("GL_ARB_multitexture"). If any of those loading stage succeeded, use vtgl::ActiveTexture() in any case, NOT vtgl::ActiveTextureARB(). This method avoids the use of if statements everywhere in implementations using core-promoted extensions. Without this method, the implementation code should look like:

1 int opengl_1_3=extensions->ExtensionSupported("GL_VERSION_1_3");
2 if(opengl_1_3)
3 {
4 extensions->LoadExtension("GL_VERSION_1_3");
5 }
6 else
7 {
8 if(extensions->ExtensionSupported("GL_ARB_multitexture"))
9 {
10 extensions->LoadCorePromotedExtension("GL_ARB_multitexture");
11 }
12 else
13 {
14 vtkErrorMacro("Required multitexture feature is not supported!");
15 }
16 }
17 ...
18 if(opengl_1_3)
19 {
20 vtkgl::ActiveTexture(vtkgl::TEXTURE0)
21 }
22 else
23 {
24 vtkgl::ActiveTextureARB(vtkgl::TEXTURE0_ARB)
25 }

Thanks to this method, the code looks like:

1 int opengl_1_3=extensions->ExtensionSupported("GL_VERSION_1_3");
2 if(opengl_1_3)
3 {
4 extensions->LoadExtension("GL_VERSION_1_3");
5 }
6 else
7 {
8 if(extensions->ExtensionSupported("GL_ARB_multitexture"))
9 {
10 extensions->LoadCorePromotedExtension("GL_ARB_multitexture");
11 }
12 else
13 {
14 vtkErrorMacro("Required multitexture feature is not supported!");
15 }
16 }
17 ...
18 vtkgl::ActiveTexture(vtkgl::TEXTURE0);
virtual void LoadAsARBExtension ( const char *  name)
virtual

Similar to LoadCorePromotedExtension().

It loads an EXT extension into the pointers of its ARB equivalent.

virtual int GetDriverVersionMajor ( )
virtual

Return the driver's version parts.

This may be used for fine grained feature testing.

Definition at line 286 of file vtkOpenGLExtensionManager.h.

virtual int GetDriverVersionMinor ( )
virtual

Definition at line 287 of file vtkOpenGLExtensionManager.h.

virtual int GetDriverVersionPatch ( )
virtual

Definition at line 288 of file vtkOpenGLExtensionManager.h.

virtual int GetDriverGLVersionMajor ( )
virtual

Get GL API version that the driver provides.

This is often different than the GL version that VTK recognizes so only use this for identifying a specific driver.

Definition at line 295 of file vtkOpenGLExtensionManager.h.

virtual int GetDriverGLVersionMinor ( )
virtual

Definition at line 296 of file vtkOpenGLExtensionManager.h.

virtual int GetDriverGLVersionPatch ( )
virtual

Definition at line 297 of file vtkOpenGLExtensionManager.h.

virtual bool DriverIsATI ( )
virtual

Test's for common implementors of rendering drivers.

This may be used for fine grained feature testing. Note: DriverIsMesa succeeds for OS Mesa, use DriverGLRendererIsOSMessa to differentiate.

virtual bool DriverIsNvidia ( )
virtual

Test's for common implementors of rendering drivers.

This may be used for fine grained feature testing. Note: DriverIsMesa succeeds for OS Mesa, use DriverGLRendererIsOSMessa to differentiate.

virtual bool DriverIsIntel ( )
virtual

Test's for common implementors of rendering drivers.

This may be used for fine grained feature testing. Note: DriverIsMesa succeeds for OS Mesa, use DriverGLRendererIsOSMessa to differentiate.

virtual bool DriverIsMesa ( )
virtual

Test's for common implementors of rendering drivers.

This may be used for fine grained feature testing. Note: DriverIsMesa succeeds for OS Mesa, use DriverGLRendererIsOSMessa to differentiate.

virtual bool DriverIsMicrosoft ( )
virtual

Test's for common implementors of rendering drivers.

This may be used for fine grained feature testing. Note: DriverIsMesa succeeds for OS Mesa, use DriverGLRendererIsOSMessa to differentiate.

virtual bool DriverVersionIs ( int  major)
virtual

Test for a specific driver version.

virtual bool DriverVersionIs ( int  major,
int  minor 
)
virtual

Test for a specific driver version.

virtual bool DriverVersionIs ( int  major,
int  minor,
int  patch 
)
virtual

Test for a specific driver version.

virtual bool DriverVersionAtLeast ( int  major)
virtual

Test for driver version greater than or equal to the named version.

virtual bool DriverVersionAtLeast ( int  major,
int  minor 
)
virtual

Test for driver version greater than or equal to the named version.

virtual bool DriverVersionAtLeast ( int  major,
int  minor,
int  patch 
)
virtual

Test for driver version greater than or equal to the named version.

virtual bool DriverGLVersionIs ( int  major,
int  minor,
int  patch 
)
virtual

Test for the driver's GL version as reported in its GL_VERSION string.

This is intended for driver identification only, use ExtensionSuppported to test for VTK support of a specific GL version.

virtual bool DriverGLVersionIs ( int  major,
int  minor 
)
virtual

Test for the driver's GL version as reported in its GL_VERSION string.

This is intended for driver identification only, use ExtensionSuppported to test for VTK support of a specific GL version.

virtual bool DriverGLRendererIs ( const char *  str)
virtual

Test for a specific renderer.

This could be used in some cases to identify the graphics card or specific driver. Use HasToken to prevent false matches eg. avoid GeForce4 matching GeForce400

virtual bool DriverGLRendererHas ( const char *  str)
virtual

Test for a specific renderer.

This could be used in some cases to identify the graphics card or specific driver. Use HasToken to prevent false matches eg. avoid GeForce4 matching GeForce400

virtual bool DriverGLRendererHasToken ( const char *  str)
virtual

Test for a specific renderer.

This could be used in some cases to identify the graphics card or specific driver. Use HasToken to prevent false matches eg. avoid GeForce4 matching GeForce400

virtual bool DriverGLRendererIsOSMesa ( )
virtual

Test for Mesa's offscreen renderer.

virtual const char* GetDriverGLVendor ( )
virtual

Get the OpenGL version, vendor and renderer strings.

These can be used to idnetify a specific driver.

Definition at line 363 of file vtkOpenGLExtensionManager.h.

virtual const char* GetDriverGLVersion ( )
virtual

Definition at line 364 of file vtkOpenGLExtensionManager.h.

virtual const char* GetDriverGLRenderer ( )
virtual

Definition at line 365 of file vtkOpenGLExtensionManager.h.

bool GetIgnoreDriverBugs ( const char *  description)

When set known driver bugs are ignored during driver feature detection.

This is used to evaluate the status of a new driver release to see if the bugs have been fixed. The function takes a description argument which, is sent to VTK's warning stream when the ignore flag is set. This makes the test output searchable for tests which have problems with certain drivers. The CMakeLists variable VTK_IGNORE_GLDRIVER_BUGS can be used to set this at build time. Default OFF.

vtkSetMacro ( IgnoreDriverBugs  ,
bool   
)

When set known driver bugs are ignored during driver feature detection.

This is used to evaluate the status of a new driver release to see if the bugs have been fixed. The function takes a description argument which, is sent to VTK's warning stream when the ignore flag is set. This makes the test output searchable for tests which have problems with certain drivers. The CMakeLists variable VTK_IGNORE_GLDRIVER_BUGS can be used to set this at build time. Default OFF.

vtkBooleanMacro ( IgnoreDriverBugs  ,
bool   
)

When set known driver bugs are ignored during driver feature detection.

This is used to evaluate the status of a new driver release to see if the bugs have been fixed. The function takes a description argument which, is sent to VTK's warning stream when the ignore flag is set. This makes the test output searchable for tests which have problems with certain drivers. The CMakeLists variable VTK_IGNORE_GLDRIVER_BUGS can be used to set this at build time. Default OFF.

virtual ~vtkOpenGLExtensionManager ( )
protectedvirtual
virtual void InitializeDriverInformation ( )
protectedvirtual
virtual void ReadOpenGLExtensions ( )
protectedvirtual
virtual int SafeLoadExtension ( const char *  name)
protectedvirtual

Wrap around the generated vtkgl::LoadExtension to deal with OpenGL 1.2 and its optional part GL_ARB_imaging.

Also functions like glBlendEquation() or glBlendColor() are optional in OpenGL 1.2 or 1.3 and provided by the GL_ARB_imaging but there are core features in OpenGL 1.4.

Variable Documentation

int OwnRenderWindow

Definition at line 387 of file vtkOpenGLExtensionManager.h.

char* ExtensionsString

Definition at line 388 of file vtkOpenGLExtensionManager.h.

vtkTimeStamp BuildTime

Definition at line 390 of file vtkOpenGLExtensionManager.h.

std::string DriverGLVersion

Definition at line 393 of file vtkOpenGLExtensionManager.h.

int DriverGLVersionMajor

Definition at line 394 of file vtkOpenGLExtensionManager.h.

int DriverGLVersionMinor

Definition at line 395 of file vtkOpenGLExtensionManager.h.

int DriverGLVersionPatch

Definition at line 396 of file vtkOpenGLExtensionManager.h.

std::string DriverGLVendor

Definition at line 397 of file vtkOpenGLExtensionManager.h.

std::string DriverGLRenderer

Definition at line 398 of file vtkOpenGLExtensionManager.h.

int DriverVersionMajor

Definition at line 399 of file vtkOpenGLExtensionManager.h.

int DriverVersionMinor

Definition at line 400 of file vtkOpenGLExtensionManager.h.

int DriverVersionPatch

Definition at line 401 of file vtkOpenGLExtensionManager.h.

DriverGLVendorIdType DriverGLVendorId

Definition at line 411 of file vtkOpenGLExtensionManager.h.

bool IgnoreDriverBugs

Definition at line 412 of file vtkOpenGLExtensionManager.h.

Definition at line 430 of file vtkOpenGLExtensionManager.h.