diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 15:21:36 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 15:21:36 +0100 |
commit | 59733c3c3de7aa6dee5fde8e2a60b80b4c706583 (patch) | |
tree | f92706197e5de26132282ac21e51d55b08d3c05e /gfx/models | |
parent | Merge branch 'worker' into assimp (diff) | |
download | ilt-59733c3c3de7aa6dee5fde8e2a60b80b4c706583.tar.bz2 ilt-59733c3c3de7aa6dee5fde8e2a60b80b4c706583.tar.xz ilt-59733c3c3de7aa6dee5fde8e2a60b80b4c706583.zip |
Set GL_PACK_ALIGNMENT before saving texture to fit buffer correctly
Diffstat (limited to 'gfx/models')
-rw-r--r-- | gfx/models/texture.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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<uint8_t>(8 * channels),
};
+ glPixelStorei(GL_PACK_ALIGNMENT, 1);
glGetTextureImage(texture, 0, format, type, static_cast<GLsizei>(dataSize), tga.get<TGAHead>() + 1);
tga.msync(MS_ASYNC);
}
|