Turtle Dove 3822055e72 OpenGL2/3: Backup and restore GL_UNPACK state in UpdateTexture() (#9473)
The OpenGL2 and OpenGL3 backends set GL_UNPACK_ROW_LENGTH=0 and
GL_UNPACK_ALIGNMENT=1 during texture creation and updates, but
never restored the original values. This corrupted the calling
application's pixel store state when ImGui created or updated
textures mid-frame (e.g., dynamic font atlas updates).

Fix: Backup GL_UNPACK_ROW_LENGTH and GL_UNPACK_ALIGNMENT at the
start of UpdateTexture(), and restore them at the end.

This resolves the FIXME in ImGui_ImplOpenGL3_UpdateTexture():
'FIXME: Consider backing up and restoring'

Issues: #8802 (original UNPACK_ALIGNMENT change), #9473 (this fix)
2026-07-15 07:58:39 -05:00
..
2026-01-20 18:25:18 +01:00