how to handle extionsens in a engine?
Hi... I am looking for a good way to handle extensins in a Class or to make an Extension-Manager. But was the best way?
Thanks, Austrian Coder
The extension manager is what I''m using right now and it''s working pretty well.
There is a method for querying if this or that extension is supported (which looks to what glGetString(GL_EXTENSIONS) returns of course) and this method initializes all pointers needed (call to wglGetProcAddress and glXGetProcAddress).
Then the manager wraps all functions.
You can encapsulate that in an extension factory for more flexibility.
I strongly recommend to query extension support at start if possible.
And as a final note, you should never take for granted that an extension is available for all cards. Always check before using an extension, which allows full compliance with OpenGL1.0 (actually, more than 99% graphics cards support OpenGL1.1). And if the extension is not supported :
1- try to simulate it with a different manner (for instance, multipass single-texturing can simulate most single-pass multitexturing effects),
2- deactivate the effect if there is no way (or no decent way) to simulate it,
3- if you have an ''options'' section, it would be nice to let the user choose if he wants the effect or not,
4- if the extension is really vital for the program, then exit (!) but please warn the user because it''s very frustrating to quit a program without knowing why.
There is a method for querying if this or that extension is supported (which looks to what glGetString(GL_EXTENSIONS) returns of course) and this method initializes all pointers needed (call to wglGetProcAddress and glXGetProcAddress).
Then the manager wraps all functions.
You can encapsulate that in an extension factory for more flexibility.
I strongly recommend to query extension support at start if possible.
And as a final note, you should never take for granted that an extension is available for all cards. Always check before using an extension, which allows full compliance with OpenGL1.0 (actually, more than 99% graphics cards support OpenGL1.1). And if the extension is not supported :
1- try to simulate it with a different manner (for instance, multipass single-texturing can simulate most single-pass multitexturing effects),
2- deactivate the effect if there is no way (or no decent way) to simulate it,
3- if you have an ''options'' section, it would be nice to let the user choose if he wants the effect or not,
4- if the extension is really vital for the program, then exit (!) but please warn the user because it''s very frustrating to quit a program without knowing why.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement