diff options
-rw-r--r-- | src/tex.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |