From 59733c3c3de7aa6dee5fde8e2a60b80b4c706583 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 14 Apr 2023 15:21:36 +0100 Subject: Set GL_PACK_ALIGNMENT before saving texture to fit buffer correctly --- gfx/models/texture.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/models') diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp index 3b27e77..6319eb8 100644 --- a/gfx/models/texture.cpp +++ b/gfx/models/texture.cpp @@ -70,6 +70,7 @@ Texture::save( .size = size, .pixelDepth = static_cast(8 * channels), }; + glPixelStorei(GL_PACK_ALIGNMENT, 1); glGetTextureImage(texture, 0, format, type, static_cast(dataSize), tga.get() + 1); tga.msync(MS_ASYNC); } -- cgit v1.2.3