powerpad
03-30-2005, 06:10 AM
I want to texture a simple quad with a texture loaded from an img (in .Net with C#)
1. I load the bitmap
2. I call
Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, 3, this.iTexWidth, this.iTexWidth, 0, Gl.GL_BGR_EXT, Gl.GL_UNSIGNED_BYTE, this.tex2.getImageData());3. and I set the quad with
Gl.glBegin(Gl.GL_QUADS);
Gl.glTexCoord2f(0.0f, 1.0f);
Gl.glVertex3f(0.0f, 0.0f, 0.0f);
Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex3f(5.0f, 0.0f, 0.0f);
Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex3f(5.0f, 5.0f, 0.0f);
Gl.glTexCoord2f(0.0f, 0.0f);
Gl.glVertex3f(0.0f, 5.0f, 0.0f);
Gl.glEnd(); but I get a quad with a mirrored texture - which is not the intented result ... has anyone suggestions here ....
tnx
1. I load the bitmap
2. I call
Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, 3, this.iTexWidth, this.iTexWidth, 0, Gl.GL_BGR_EXT, Gl.GL_UNSIGNED_BYTE, this.tex2.getImageData());3. and I set the quad with
Gl.glBegin(Gl.GL_QUADS);
Gl.glTexCoord2f(0.0f, 1.0f);
Gl.glVertex3f(0.0f, 0.0f, 0.0f);
Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex3f(5.0f, 0.0f, 0.0f);
Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex3f(5.0f, 5.0f, 0.0f);
Gl.glTexCoord2f(0.0f, 0.0f);
Gl.glVertex3f(0.0f, 5.0f, 0.0f);
Gl.glEnd(); but I get a quad with a mirrored texture - which is not the intented result ... has anyone suggestions here ....
tnx