From: Ketmar Dark Date: Thu, 7 Apr 2016 02:37:51 +0000 (+0300) Subject: fixed npot textures X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=fd188433bd08d0e88c80d530c0d2323d8ed1bfc1;p=d2df-sdl.git fixed npot textures --- 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