shaders extensions... the points i couldn't get from tutorials...
hi all!
i want to use shaders, and after reading the tutorials here and on openGL.org i still have a bunch of questions (i'm really not on the ball for a while... ;) )
so, as shaders are available through 4 extensions, i need to "link" those extensions with the program, that is check if they are available, and get function pointers (those i'm going to use). now my gl.h file contains no shader extensions, and actually it doesn't have to, so after reading some manuals i decided to go to nvidia.com and download the newest gl.h (is it a good idea?). But on nvidia.com i found glext.h - which i beleive has to be included to the program... but i'm not sure if i do everything right... so my (general) question is how to use shaders?. more specific question is: how to use necessary extensions? what is standard easiest and most popular mechanism for it?
imho, if i have the latest glext.h included - i have only to check if the videocard supports the certain extension (with functions prototyped in glext.h - there is no serious problem at compile-time) for the program not to crash at run-time. after that i can use usual function calls... is it?
thanks in advance!
C++ RULEZ!!! :)
Quote: Original post by BrennendeKomet
imho, if i have the latest glext.h included - i have only to check if the videocard supports the certain extension (with functions prototyped in glext.h - there is no serious problem at compile-time) for the program not to crash at run-time. after that i can use usual function calls... is it?
Yep. ASM and GLSL shaders are used in OpenGL just like any other extension: check for extension availablity, load the extensions functions then use them. And to use any extension, you will need the glext.h header file.
Any of the tutorials you've read should explain how to use load and use the extensions you need.
-Auron
Quote: Original post by Auron
And to use any extension, you will need the glext.h header file.
No you don't. I've never used glext.h. All you need is the extra tokens and function prototypes.
If at first you don't succeed, redefine success.
OK, good point. Actually, now that I think of it, it's probably better anyway since it doesn't cause the rest of the functions you're not using to be included. And it avoid the problem of someone else's machine having an old version of glext.h, causing a hassle at compile time.
-Auron
-Auron
When working with extensions I strongly sugest using some library to load avabile extensions. Something like GLee. Easy to include and use.
You should never let your fears become the boundaries of your dreams.
Thanks all for replies!
So, as far as i understand the basic scheme is to download a latest version of gl.h compatible with the video card (is it?), use glGetString(...) to check the extensions for availability and get all neccessary function pointers (wglGetFunctionPointer(...)). Or the other way, as Dark Wing mentioned, is to use some neat library... but still i don't understand what is glext.h for? and where can i find hottest (:)) gl.h? i have GeForce3 Ti 200, but exploration of nvidia.com just gave me a link to glext.h etc but not gl.h... my bad search or my foolish mistake?
So, as far as i understand the basic scheme is to download a latest version of gl.h compatible with the video card (is it?), use glGetString(...) to check the extensions for availability and get all neccessary function pointers (wglGetFunctionPointer(...)). Or the other way, as Dark Wing mentioned, is to use some neat library... but still i don't understand what is glext.h for? and where can i find hottest (:)) gl.h? i have GeForce3 Ti 200, but exploration of nvidia.com just gave me a link to glext.h etc but not gl.h... my bad search or my foolish mistake?
C++ RULEZ!!! :)
Up to date gl.h files are included with the nvidia drivers ( in their linux versions ). Windows only supports 1.1, without the use of extensions.
If at first you don't succeed, redefine success.
Quote: Original post by _DarkWIng_
When working with extensions I strongly sugest using some library to load avabile extensions. Something like GLee. Easy to include and use.
What do you think of glew? http://glew.sourceforge.net/
C++ RULEZ!!! :)
All extension loading librarys are very simmilar. Use the one you feel comftabile with. I like GLee becouse it's almost transparent. It uses standard OGL names for extensions and has a nice bool for each extension to check for support.
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement