I’m trying to use glmultitexcoord3f, but when I try to use this function in C#, I get the following error:
“Unable to find an entry point named ‘glMultiTexCoord3f’ in DLL ‘opengl32’.”
In my Gl class, I include the following code:
[DllImport(DLL.OPENGL, EntryPoint = “glMultiTexCoord3f”, ExactSpelling = false)]
public extern static void MultiTexCoord(int id, Single s, Single t, Single r);
The error results in my main class after this line:
GL.MultiTexCoord(0, 0F, 0F, 0F);
I get the same error for any of the ARB functions I try to use. My computer supports opengl’s multi-texturing. I verified this by downloading a sample program written in c++. But I can’t figure out how to avoid the error mentioned above when using c#. If anyone can help, I would be so happy; I’d be willing to pay.
You probably should use a wrapper such as opentk (opentk.com).
Other than that, all I can say is that glMultiTexCoord3f is not defined in opengl32.dll. It is defined in the real driver (nVidia or whatever you have) and we get a pointer to that using wglGetProcAddress. I’m sure that opentk does a lot of wglGetProcAddress calls to get all the functions beyong GL 1.1
Thanks for the reply! I had looked into opentk, but it didn’t seem to call ARB functions (I might check again). Your comment about using wglGetProcAddress might be the key. I’ll look into that!
You can find all ARB functions under ‘GL.Arb’ (EXT functions under ‘GL.Ext’ and so on and so forth).
If you wish to bind the method yourself, you’ll need to use wglGetProcAddress() and Marshal.GetDelegateForFunctionPointer(). I wouldn’t recommend that, though. You might as well use OpenTK and focus on creating your application rather than fighting with p/invokes!
You’ll need to call the setup function before you use MultiTexCoord (i.e. GL.Setup()). You will then be able to call MultiTexCoord the same way you were before.
This loads the function using a delegate. Enjoy ;).
Your solution is the most helpful (though I see that it builds off the others) and solves my problem. Since it’s the most helpful, I will abide to your payment terms. I’ll put the check in the mail tonight.