From d86c4be9a46e2388e8cbbb31ebdbccfb21d36705 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Sun, 8 Jun 2003 23:37:58 +0000 Subject: [PATCH] add texcoords --- render2/texture.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/render2/texture.c b/render2/texture.c index 97570ed7..fc55d1b4 100644 --- a/render2/texture.c +++ b/render2/texture.c @@ -100,12 +100,17 @@ void RrTexturePaint(struct RrSurface *sur, struct RrTexture *tex, glColor3f(1.0, 1.0, 1.0); glBindTexture(GL_TEXTURE_2D, tex->data.rgba.texid); glBegin(GL_TRIANGLES); + glTexCoord2f(0, 0); glVertex2i(x, y); - glVertex2i(x+w, y); - glVertex2i(x+w, y+h); + glTexCoord2f(1, 0); + glVertex2i(x+w - 1, y); + glTexCoord2f(1, 1); + glVertex2i(x+w - 1, y+h - 1); - glVertex2i(x+w, y+h); - glVertex2i(x, y+h); + glVertex2i(x+w - 1, y+h - 1); + glTexCoord2f(0, 1); + glVertex2i(x, y+h - 1); + glTexCoord2f(0, 0); glVertex2i(x, y); glEnd(); -- 2.34.1