Hello,
I am having a problem texture mapping. I have derived
a control from OpenGLControl and have put an instance
on a form. The instance has an OpenGLTexture2D
object with a texture stored in it that I use to texture a
square polygon.
You can rotate the polygon using the mouse and left
mouse button.
You can change the polygon by pressing the F1 key and
browsing your file system for a specific texture.
I use the following code to implement my rotation.
base.GrabContext();
GL.glMatrixMode(GL.GL_MODELVIEW_MATRIX);
GL.glPushMatrix();
GL.glLoadIdentity();
GL.glRotated(alpha, axis.x, axis.y, axis.z);
GL.glMultMatrixd(rotMatrix);
GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, rotMatrix);
GL.glPopMatrix();
The problem I have arises when I do a rotate and
change the texture. If both of these things have been
done, then on my call to m_texture.Bind() I get an
exception "invalid enumerant".
I have attached the source for a simpe application that
has the problem. I am not a beginner with OpenGL and
have troubleshot this for a while. I'm not sure if there is
a bug in the wrappers or if it's in my code. If someone
could please look at this problem and help me out it
would be much appreciated.
If you would like to contact me directly my email
address is Drew.McLean@__nospam__cedara.com with
the __nospam__ removed.
Thanks in advance.
Drew
Sample app with problem