From fd188433bd08d0e88c80d530c0d2323d8ed1bfc1 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Thu, 7 Apr 2016 05:37:51 +0300 Subject: [PATCH] fixed npot textures --- src/engine/e_textures.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/e_textures.pas b/src/engine/e_textures.pas index 7c80469..af38f3c 100644 --- a/src/engine/e_textures.pas +++ b/src/engine/e_textures.pas @@ -116,12 +116,12 @@ begin if Format = GL_RGBA then begin glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.glwidth, tex.glheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, tex.glheight-Height, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData); end else begin glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex.glwidth, tex.glheight, 0, GL_RGB, GL_UNSIGNED_BYTE, nil); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, tex.glheight-Height, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData); end; // the following is ok too -- 2.29.2