diff options
Diffstat (limited to 'src/GFX/Texture.cpp')
| -rw-r--r-- | src/GFX/Texture.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GFX/Texture.cpp b/src/GFX/Texture.cpp index f5474df..ef48631 100644 --- a/src/GFX/Texture.cpp +++ b/src/GFX/Texture.cpp @@ -13,6 +13,10 @@ Texture::Texture(const Image::RawImage& image) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // If this is not here, odd-numbered rows (like those in i.e. 5x5 textures) + // will begin at the incorrect byte, causing color artifacts. + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.raw()); glGenerateMipmap(GL_TEXTURE_2D); |
