
texture mapping example question
Posted Wednesday, 3 August, 2011 - 16:22 by JIm inAs you will likely deduce, I am very new to OpenGL. I just completed my first (2D) project in the XNA arena and have decided that moving to OpenGL might be a better technology. Another similar post response suggested that OpenGL was a little more work than XNA and, I suspect the responder might be a master of the understatement :-) Anyway, I compiled the TextureMapping sample and it ran just fine. I then changed the code to reference a different image file and now all it displays is a white rectangle. I am assuming that the problem may be with the following four lines of sample code but, since I have been unable to find any examples explaining just what the parameters actually mean, I can't be too sure.
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-0.6f, -0.4f);
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(0.6f, -0.4f);
GL.TexCoord2(1.0f, 0.0f); GL.Vertex2(0.6f, 0.4f);
GL.TexCoord2(0.0f, 0.0f); GL.Vertex2(-0.6f, 0.4f);
Can anyone tell me what might be the issue or, better yet, point me in a direction where I might find a tutorial in which no OpenGL knowledge is presumed? Thanks


Comments
Re: texture mapping example question
The OpenGL wiki is a good in-depth resource: http://www.opengl.org/wiki/Texture_Mapping
I then changed the code to reference a different image file and now all it displays is a white rectangle.
Call
GL.GetError()once you load the texture and see what it returns. A white texture can mean one of two things: