From c7412828d4bf0b695602d19f7f98e40b97ba9dde Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Sat, 2 Apr 2016 12:23:46 +0000 Subject: [PATCH] Use proper texture wrapping mode for 2d. Stops garbage down the top and left sides. Should really use NPOT texture. --- Src/Graphics/New3D/PolyHeader.h | 2 +- Src/Graphics/Render2D.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Graphics/New3D/PolyHeader.h b/Src/Graphics/New3D/PolyHeader.h index c720ab1..8617115 100644 --- a/Src/Graphics/New3D/PolyHeader.h +++ b/Src/Graphics/New3D/PolyHeader.h @@ -62,7 +62,7 @@ x------- -------- -------- -------- Alpha testing / contour -------- -------- -----x-- -------- Texture enable -------- -------- ------xx x------- Texture format -------- -------- -------- -------x Alpha enable ? --------- ------x - ------- -------- Never seen set ? +-------- ------x- -------- -------- Never seen set ? -------- -------- -------- -----xx- Always set ? -------- -------- -------- -xxxx--- ? */ diff --git a/Src/Graphics/Render2D.cpp b/Src/Graphics/Render2D.cpp index 2a6226f..3966022 100644 --- a/Src/Graphics/Render2D.cpp +++ b/Src/Graphics/Render2D.cpp @@ -797,8 +797,8 @@ bool CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned { glActiveTexture(GL_TEXTURE0); // texture unit 0 glBindTexture(GL_TEXTURE_2D, texID[i]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, surfTop);