summaryrefslogtreecommitdiff
path: root/src/tex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tex.c')
-rw-r--r--src/tex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tex.c b/src/tex.c
index b8254e1..b67af17 100644
--- a/src/tex.c
+++ b/src/tex.c
@@ -153,6 +153,12 @@ tex_t * tex_new(int width, int height, const unsigned char *buf)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ /* transparent border pixels outside of the texture boundaries, this
+ * eliminates the spurious fringing on some sprites/positions */
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
+ glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, (float[4]){});
+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
glBindTexture(GL_TEXTURE_2D, 0);
© All Rights Reserved