Skip to content

Commit efb3129

Browse files
SiegeLordExSiegeLord
authored andcommitted
Reset the GL_UNPACK_ROW_LENGTH after unlocking certain bitmaps.
Fixes #1658
1 parent 2ba8b40 commit efb3129

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/opengl/ogl_lock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,10 @@ static void ogl_unlock_region_nonbb_nonfbo(ALLEGRO_BITMAP *bitmap,
688688
get_glformat(lock_format, 1),
689689
start_ptr);
690690

691+
if (!(bitmap->lock_flags & ALLEGRO_LOCK_WRITEONLY)) {
692+
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
693+
}
694+
691695
e = glGetError();
692696
if (e) {
693697
ALLEGRO_ERROR("glTexSubImage2D for format %s failed (%s).\n",

0 commit comments

Comments
 (0)