Hi…
I know what wglGetProcAddress does and all, and I would like to use it; however, I am currently working on a project where I am not able to use wglGetProcAddress. Does anyone know how I can accomplish the task that it does, without actually using it?
Btw, if any of you don’t know what wglGetProcAddress is, it is simply a function that takes a string and finds the address to that extension function.
The only other way to accomplish the same thing is to connect to the GL DLL and get the appropriate function using symbol table enumeration. Seeing as that’s a lot less portable and more fragile than wglGetProcAddress, you are faced with a need to 1) convince your boss it’s OK to use it or 2) do without.
Well, you’re going to get the question of “why not” when such a question is asked in the first place…
The trick is, there aren’t many solutions, and knowing why you need to avoid using wglGetProcAddress() is pretty much necessary to providing an alternative.
As others have said, if you really want to, you can use GetProcAddress() instead, but this just adds a couple of steps to the process and doesn’t really gain anything.
If portability is the concern, realize that there is no portable way to get function pointers to extension functions. This is a small set of initialization code that is going to have to be written for each platform your application runs on.
Personally, I don’t like the “it shouldn’t matter why I want to do it” mentality of folks asking for help. Quite often the pathology of their situation is in why they want to do it that way as opposed to how to do it; it is very often much, much easier to solve the problem through changing the why as opposed to explaining the how.
Fair enough, I just get pissed because every time I ask any question people are always prying in trying to figure out why.
We are trying to go portable here but guess there’s no good way to do that so I will explain this to my boss and I thank you all for your kindness in helping me.