OpenGL Extensions

I as wondering if a particular OpenGL extension is defined (in glext.h) then does that mean it will be supported by graphics hardware?

What I mean is can I rely on following piece of code to see if GL_DEPTH_CLAMP_NV and GL_STENCIL_TEST_TWO_SIDE_EXT is supported on clients machine or I have to just depend on extension string returned by glGetString(GL_EXTENSIONS)?

#ifdef GL_DEPTH_CLAMP_NV
#define IS_DEPTH_CLAMP_SUPPORTED TRUE
#else
#define IS_DEPTH_CLAMP_SUPPORTED FALSE
#endif

#ifdef GL_STENCIL_TEST_TWO_SIDE_EXT
#define IS_TWO_SIDE_STENCIL_TEST_SUPPORTED TRUE
#else
#define IS_TWO_SIDE_STENCIL_TEST_SUPPORTED FALSE
#endif

Any help will be highly appreciated. :o

Thank you.

Prasad Dixit

You must use glGetString. You’re not compiling the whole project on the client’s machine while using some header-generator to specify which extensions are supported…
That’s why extension-procs are loaded dynamically.

awesome…that will help a lot. That is why my code was working perfectly fine on machine on which i was compiling it but breaking on other machines. The other machine on which I was running my code had Vista 64 bit while machine on which I was compiling my code was XP 32 bit. I thought that was causing the problem…but it doesn’t look like it.

I will modify code to see if dynamically checking supported extensions makes any difference and will let you know.

Thanks again, Ilian

Hi,

I made the changes code to check supported extensions dynamically and now it works perfectly fine.

Prasad