I’m having a very strange issue with something that is very simple. I’m only trying to draw a texture onto a quad - something I’ve been able to do successfully several times before. Unfortunately, OpenGL is only texturing the bottom-right half of a quad. Instead of one rectangular texture, I’m getting a triangle. Here is the relevant code:
<div class=“ubbcode-block”><div class=“ubbcode-header”>Click to reveal… <input type=“button” class=“form-button” value=“Show me!” onclick=“toggle_spoiler(this, ‘Yikes, my eyes!’, ‘Show me!’)” />]<div style=“display: none;”>
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-2.0f, -4.0f, -7.0f); //Bottom-left vertex
glTexCoord2f(1.0f, 0.0f);
glVertex3f(2.0f, -4.0f, -7.0f); //Bottom-right vertex
glTexCoord2f(1.0f, 1.0f);
glVertex3f(2.0f, 4.0f, -7.0f); //Top-right vertex
glTexCoord2f(0.0f, 1.0f);
glVertex3f(2.0f, 4.0f, -7.0f); //Top-left vertex
glEnd();
[/QUOTE]</div>
I can not for the life of me figure out what it is I’m doing wrong - I was able to render a full texture to a quad before using almost exactly the same code.
What am I doing wrong?