VTK
|
Go to the source code of this file.
Functions | |
virtual void | Update () |
virtual int | ExtensionSupported (const char *name) |
virtual void | LoadExtension (const char *name) |
virtual int | LoadSupportedExtension (const char *name) |
virtual void | LoadCorePromotedExtension (const char *name) |
virtual void | ReadOpenGLExtensions () |
virtual int | SafeLoadExtension (const char *name) |
vtkRenderWindow * | GetRenderWindow () |
virtual void | SetRenderWindow (vtkRenderWindow *renwin) |
vtkGetStringMacro (ExtensionsString) | |
virtual vtkOpenGLExtensionManagerFunctionPointer | GetProcAddress (const char *fname) |
virtual void | LoadAsARBExtension (const char *name) |
vtkOpenGLExtensionManager () | |
virtual | ~vtkOpenGLExtensionManager () |
Variables | |
int | OwnRenderWindow |
char * | ExtensionsString |
vtkTimeStamp | BuildTime |
vtkWeakPointer< vtkRenderWindow > | RenderWindow |
virtual void SetRenderWindow | ( | vtkRenderWindow * | renwin | ) | [virtual] |
virtual void Update | ( | ) | [virtual] |
Updates the extensions string.
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:
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);
virtual void LoadAsARBExtension | ( | const char * | name | ) | [virtual] |
Similar to LoadCorePromotedExtension(). It loads an EXT extension into the pointers of its ARB equivalent.
vtkOpenGLExtensionManager | ( | ) | [protected] |
Similar to LoadCorePromotedExtension(). It loads an EXT extension into the pointers of its ARB equivalent.
virtual ~vtkOpenGLExtensionManager | ( | ) | [protected, virtual] |
Similar to LoadCorePromotedExtension(). It loads an EXT extension into the pointers of its ARB equivalent.
virtual void ReadOpenGLExtensions | ( | ) | [protected, virtual] |
virtual int SafeLoadExtension | ( | const char * | name | ) | [protected, virtual] |
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.
Definition at line 241 of file vtkOpenGLExtensionManager.h.
char* ExtensionsString |
Definition at line 242 of file vtkOpenGLExtensionManager.h.
Definition at line 244 of file vtkOpenGLExtensionManager.h.
Definition at line 259 of file vtkOpenGLExtensionManager.h.