ARB constants

since crappy windows still ships with openGL 1.1 i need to get some functions like glActiveTextureARB() driectly from the DLL which is okay. however, where do i get the necessary constants like GL_TEXTURE0_ARB etc from? i read on the net that there should be some file named glext.h containing these but i don’t have that file. i know that GL_TEXTURE0_ARB should be 0x84C0 but when i run my program with that value it crashes. so, what do i need to use openGL 1.2 and 1.3 functions?


Hey, easy there; you’ve got a header file problem, and “crappy” windows doesn’t ship with any header files. Maybe you mean “crappy” Visual Studio, which I will promptly defend as a very fine product.

Maan, everyone likes to jump on the Microsoft-slamming bandwagon.

i did not just jump on the microsoft-bashing bandwaggon, i’ve bashed MS ever since win3.11 and i bash linux and macOS too whenever i feel the need for it.
ok whatever but it’s just another MS strategy of pushing their own product (directX) instead of supporting a standard that has been around for years.

The value 0x84C0 can not crash your program. This constant will never change, because OpenGL is upward compatible.

If it crashes, that’s probably because you didn’t get the right pointer for function glActiveTextureARB, for instance if your card or drivers does not support multitexturing.

you’re right it must be an invalid function pointer… problem is, i do get some non-NULL function pointer but it seems to be broken. i can’t even load something simple like glEnable at runtime and using it without crashing.

You need a valid rendering context before you can start loading function pointers. Do you have a rendering context?

sure thing.
i don’t use wgl or xgl though but a function from theSDL library but that basically uses wgl and it has worked for other people but it fails on me…

Whenever you need some update to some opengl file, or a demo program or documents:

goto (I think that’s it)

and there are fine documents and demoes here to (developer section, main page)

Get the glext.h wglext.h from the nvidia or ati demoes! I will be posting a newer gl.h myself on my site.


Are you using wglGetProcAddress to initialize your function pointer?

probably but i’m not sure. as i said i use the SDL library for cross-platform ProcAddressing but as far as i know it uses wglGetProcAddress under windows.
the strange thing is that i do get some pointer but it seems to be invalid because everytime i try to call this function my prog crashes.