If you are trying to use multitexcoord in c#, you first have to get an address pointer to that function. This forum taught me how to do that in “OpenGl multi texturing with C#”, and I’m grateful for that.
But now I’m trying to actually use multitexcoord, and I’m having trouble despite reading several tutorials.
Here’s my code to prepare a texture for multitexturing:
GL.ActiveTexture(TexID.Tex0);
GL.BindTexture(TexMode.Tex2D, TexID.Tex0);
GL.Enable(GLFeature.Tex2D);
(I set TexID.Tex0 = 0x84C0; and I set TexMode.Tex2D = 0x0DE1)
I later call multitexcoord using:
GL.MultiTexCoord(TexID.Tex0, x, y);
Which is in a loop just before my call to GL.Vertex.
The result is good: a texture is added to my quads just as expected. But here’s where the problem comes in. Suppose instead I try to activate another texture just after my activation of Tex0 using the following:
GL.ActiveTexture(TexID.Tex0);
GL.BindTexture(TexMode.Tex2D, TexID.Tex0);
GL.Enable(GLFeature.Tex2D);
GL.ActiveTexture(TexID.Tex1);
GL.BindTexture(TexMode.Tex2D, TexID.Tex1);
GL.Enable(GLFeature.Tex2D);
But then when I call GL.MultiTexCoord(TexID.Tex0, x, y);, the texture that gets rendered is different than it was when I merely activate Tex0! But the code I added has nothing to do with Tex0. It has to do with Tex1. I’m not trying to combine multiple textures yet. I only call multitexcoord one time and pass it Tex0. Why should activating Tex0 make a difference?
If someone knows a link to a sample program that implements multitexturing in c#, that might be the easiest solution. I didn’t see any such examples in OpenTK.