VTK
vtkOpenGLExtensionManager.h File Reference

Go to the source code of this file.

enum  DriverGLVendorIdType {
  DRIVER_VENDOR_UNKNOWN =0 , DRIVER_VENDOR_ATI , DRIVER_VENDOR_NVIDIA , DRIVER_VENDOR_INTEL ,
  DRIVER_VENDOR_MESA , DRIVER_VENDOR_MICROSOFT
}
 Updates the extensions string. More...
 
int OwnRenderWindow
 Updates the extensions string. More...
 
char * ExtensionsString
 Updates the extensions string. More...
 
vtkTimeStamp BuildTime
 Updates the extensions string. More...
 
std::string DriverGLVersion
 Updates the extensions string. More...
 
int DriverGLVersionMajor
 Updates the extensions string. More...
 
int DriverGLVersionMinor
 Updates the extensions string. More...
 
int DriverGLVersionPatch
 Updates the extensions string. More...
 
std::string DriverGLVendor
 Updates the extensions string. More...
 
std::string DriverGLRenderer
 Updates the extensions string. More...
 
int DriverVersionMajor
 Updates the extensions string. More...
 
int DriverVersionMinor
 Updates the extensions string. More...
 
int DriverVersionPatch
 Updates the extensions string. More...
 
DriverGLVendorIdType DriverGLVendorId
 Updates the extensions string. More...
 
bool IgnoreDriverBugs
 Updates the extensions string. More...
 
vtkRenderWindowGetRenderWindow ()
 Updates the extensions string. More...
 
virtual void SetRenderWindow (vtkRenderWindow *renwin)
 Updates the extensions string. More...
 
virtual void Update ()
 Updates the extensions string. More...
 
 vtkGetStringMacro (ExtensionsString)
 Returns a string listing all available extensions. 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 ()
 Updates the extensions string. More...
 
virtual int GetDriverVersionPatch ()
 Updates the extensions string. More...
 
virtual int GetDriverGLVersionMajor ()
 Get GL API version that the driver provides. More...
 
virtual int GetDriverGLVersionMinor ()
 Updates the extensions string. More...
 
virtual int GetDriverGLVersionPatch ()
 Updates the extensions string. More...
 
virtual bool DriverIsATI ()
 Test's for common implementors of rendering drivers. More...
 
virtual bool DriverIsNvidia ()
 Updates the extensions string. More...
 
virtual bool DriverIsIntel ()
 Updates the extensions string. More...
 
virtual bool DriverIsMesa ()
 Updates the extensions string. More...
 
virtual bool DriverIsMicrosoft ()
 Updates the extensions string. More...
 
virtual bool DriverVersionIs (int major)
 Test for a specific driver version. More...
 
virtual bool DriverVersionIs (int major, int minor)
 Updates the extensions string. More...
 
virtual bool DriverVersionIs (int major, int minor, int patch)
 Updates the extensions string. 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)
 Updates the extensions string. More...
 
virtual bool DriverVersionAtLeast (int major, int minor, int patch)
 Updates the extensions string. 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)
 Updates the extensions string. More...
 
virtual bool DriverGLRendererIs (const char *str)
 Test for a specific renderer. More...
 
virtual bool DriverGLRendererHas (const char *str)
 Updates the extensions string. More...
 
virtual bool DriverGLRendererHasToken (const char *str)
 Updates the extensions string. More...
 
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 ()
 Updates the extensions string. More...
 
virtual const char * GetDriverGLRenderer ()
 Updates the extensions string. More...
 
bool GetIgnoreDriverBugs (const char *description)
 When set known driver bugs are ignored during driver feature detection. More...
 
 vtkSetMacro (IgnoreDriverBugs, bool)
 Updates the extensions string. More...
 
 vtkBooleanMacro (IgnoreDriverBugs, bool)
 Updates the extensions string. More...
 
 vtkOpenGLExtensionManager ()
 Updates the extensions string. More...
 
virtual ~vtkOpenGLExtensionManager ()
 Updates the extensions string. More...
 
virtual void InitializeDriverInformation ()
 Updates the extensions string. More...
 
virtual void ReadOpenGLExtensions ()
 Updates the extensions string. More...
 
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...
 

Enumeration Type Documentation

◆ DriverGLVendorIdType

enum DriverGLVendorIdType
protected

Updates the extensions string.

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

◆ GetRenderWindow()

vtkRenderWindow* GetRenderWindow ( )

Updates the extensions string.

◆ SetRenderWindow()

virtual void SetRenderWindow ( vtkRenderWindow renwin)
virtual

Updates the extensions string.

◆ Update()

virtual void Update ( )
virtual

Updates the extensions string.

◆ vtkGetStringMacro()

vtkGetStringMacro ( ExtensionsString  )

Returns a string listing all available extensions.

Call Update first to validate this string.

◆ ExtensionSupported()

virtual int ExtensionSupported ( const char *  name)
virtual

Returns true if the extension is supported, false otherwise.

◆ GetProcAddress()

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.

◆ LoadExtension()

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.

◆ LoadSupportedExtension()

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.

◆ LoadCorePromotedExtension()

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:

int opengl_1_3=extensions->ExtensionSupported("GL_VERSION_1_3");
if(opengl_1_3)
{
extensions->LoadExtension("GL_VERSION_1_3");
}
else
{
if(extensions->ExtensionSupported("GL_ARB_multitexture"))
{
extensions->LoadCorePromotedExtension("GL_ARB_multitexture");
}
else
{
vtkErrorMacro("Required multitexture feature is not supported!");
}
}
...
if(opengl_1_3)
{
vtkgl::ActiveTexture(vtkgl::TEXTURE0)
}
else
{
vtkgl::ActiveTextureARB(vtkgl::TEXTURE0_ARB)
}

Thanks to this method, the code looks like:

int opengl_1_3=extensions->ExtensionSupported("GL_VERSION_1_3");
if(opengl_1_3)
{
extensions->LoadExtension("GL_VERSION_1_3");
}
else
{
if(extensions->ExtensionSupported("GL_ARB_multitexture"))
{
extensions->LoadCorePromotedExtension("GL_ARB_multitexture");
}
else
{
vtkErrorMacro("Required multitexture feature is not supported!");
}
}
...
vtkgl::ActiveTexture(vtkgl::TEXTURE0);

◆ LoadAsARBExtension()

virtual void LoadAsARBExtension ( const char *  name)
virtual

Similar to LoadCorePromotedExtension().

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

◆ GetDriverVersionMajor()

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.

◆ GetDriverVersionMinor()

virtual int GetDriverVersionMinor ( )
virtual

Updates the extensions string.

Definition at line 287 of file vtkOpenGLExtensionManager.h.

◆ GetDriverVersionPatch()

virtual int GetDriverVersionPatch ( )
virtual

Updates the extensions string.

Definition at line 288 of file vtkOpenGLExtensionManager.h.

◆ GetDriverGLVersionMajor()

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.

◆ GetDriverGLVersionMinor()

virtual int GetDriverGLVersionMinor ( )
virtual

Updates the extensions string.

Definition at line 296 of file vtkOpenGLExtensionManager.h.

◆ GetDriverGLVersionPatch()

virtual int GetDriverGLVersionPatch ( )
virtual

Updates the extensions string.

Definition at line 297 of file vtkOpenGLExtensionManager.h.

◆ DriverIsATI()

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.

◆ DriverIsNvidia()

virtual bool DriverIsNvidia ( )
virtual

Updates the extensions string.

◆ DriverIsIntel()

virtual bool DriverIsIntel ( )
virtual

Updates the extensions string.

◆ DriverIsMesa()

virtual bool DriverIsMesa ( )
virtual

Updates the extensions string.

◆ DriverIsMicrosoft()

virtual bool DriverIsMicrosoft ( )
virtual

Updates the extensions string.

◆ DriverVersionIs() [1/3]

virtual bool DriverVersionIs ( int  major)
virtual

Test for a specific driver version.

◆ DriverVersionIs() [2/3]

virtual bool DriverVersionIs ( int  major,
int  minor 
)
virtual

Updates the extensions string.

◆ DriverVersionIs() [3/3]

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

Updates the extensions string.

◆ DriverVersionAtLeast() [1/3]

virtual bool DriverVersionAtLeast ( int  major)
virtual

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

◆ DriverVersionAtLeast() [2/3]

virtual bool DriverVersionAtLeast ( int  major,
int  minor 
)
virtual

Updates the extensions string.

◆ DriverVersionAtLeast() [3/3]

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

Updates the extensions string.

◆ DriverGLVersionIs() [1/2]

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.

◆ DriverGLVersionIs() [2/2]

virtual bool DriverGLVersionIs ( int  major,
int  minor 
)
virtual

Updates the extensions string.

◆ DriverGLRendererIs()

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

◆ DriverGLRendererHas()

virtual bool DriverGLRendererHas ( const char *  str)
virtual

Updates the extensions string.

◆ DriverGLRendererHasToken()

virtual bool DriverGLRendererHasToken ( const char *  str)
virtual

Updates the extensions string.

◆ DriverGLRendererIsOSMesa()

virtual bool DriverGLRendererIsOSMesa ( )
virtual

Test for Mesa's offscreen renderer.

◆ GetDriverGLVendor()

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.

◆ GetDriverGLVersion()

virtual const char* GetDriverGLVersion ( )
virtual

Updates the extensions string.

Definition at line 364 of file vtkOpenGLExtensionManager.h.

◆ GetDriverGLRenderer()

virtual const char* GetDriverGLRenderer ( )
virtual

Updates the extensions string.

Definition at line 365 of file vtkOpenGLExtensionManager.h.

◆ GetIgnoreDriverBugs()

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

vtkSetMacro ( IgnoreDriverBugs  ,
bool   
)

Updates the extensions string.

◆ vtkBooleanMacro()

vtkBooleanMacro ( IgnoreDriverBugs  ,
bool   
)

Updates the extensions string.

◆ vtkOpenGLExtensionManager()

Updates the extensions string.

◆ ~vtkOpenGLExtensionManager()

virtual ~vtkOpenGLExtensionManager ( )
protectedvirtual

Updates the extensions string.

◆ InitializeDriverInformation()

virtual void InitializeDriverInformation ( )
protectedvirtual

Updates the extensions string.

◆ ReadOpenGLExtensions()

virtual void ReadOpenGLExtensions ( )
protectedvirtual

Updates the extensions string.

◆ SafeLoadExtension()

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

◆ OwnRenderWindow

int OwnRenderWindow
protected

Updates the extensions string.

Definition at line 387 of file vtkOpenGLExtensionManager.h.

◆ ExtensionsString

char* ExtensionsString
protected

Updates the extensions string.

Definition at line 388 of file vtkOpenGLExtensionManager.h.

◆ BuildTime

vtkTimeStamp BuildTime
protected

Updates the extensions string.

Definition at line 390 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVersion

std::string DriverGLVersion
protected

Updates the extensions string.

Definition at line 393 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVersionMajor

int DriverGLVersionMajor
protected

Updates the extensions string.

Definition at line 394 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVersionMinor

int DriverGLVersionMinor
protected

Updates the extensions string.

Definition at line 395 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVersionPatch

int DriverGLVersionPatch
protected

Updates the extensions string.

Definition at line 396 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVendor

std::string DriverGLVendor
protected

Updates the extensions string.

Definition at line 397 of file vtkOpenGLExtensionManager.h.

◆ DriverGLRenderer

std::string DriverGLRenderer
protected

Updates the extensions string.

Definition at line 398 of file vtkOpenGLExtensionManager.h.

◆ DriverVersionMajor

int DriverVersionMajor
protected

Updates the extensions string.

Definition at line 399 of file vtkOpenGLExtensionManager.h.

◆ DriverVersionMinor

int DriverVersionMinor
protected

Updates the extensions string.

Definition at line 400 of file vtkOpenGLExtensionManager.h.

◆ DriverVersionPatch

int DriverVersionPatch
protected

Updates the extensions string.

Definition at line 401 of file vtkOpenGLExtensionManager.h.

◆ DriverGLVendorId

DriverGLVendorIdType DriverGLVendorId
protected

Updates the extensions string.

Definition at line 411 of file vtkOpenGLExtensionManager.h.

◆ IgnoreDriverBugs

bool IgnoreDriverBugs
protected

Updates the extensions string.

Definition at line 412 of file vtkOpenGLExtensionManager.h.