mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-23 01:12:51 +00:00
Fixed 0ff4a8a.
This commit is contained in:
@@ -670,7 +670,8 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
|
||||
// Backup GL_UNPACK state that we modify, restore on exit.
|
||||
GLint last_unpack_row_length = 0; (void)last_unpack_row_length;
|
||||
GLint last_unpack_alignment = 0; (void)last_unpack_alignment;
|
||||
if (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates)
|
||||
const bool last_unpack_state_save_and_restore = (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates);
|
||||
if (last_unpack_state_save_and_restore)
|
||||
{
|
||||
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
|
||||
GL_CALL(glGetIntegerv(GL_UNPACK_ROW_LENGTH, &last_unpack_row_length));
|
||||
@@ -744,7 +745,7 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
|
||||
ImGui_ImplOpenGL3_DestroyTexture(tex);
|
||||
|
||||
// Restore GL_UNPACK state
|
||||
if (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates)
|
||||
if (last_unpack_state_save_and_restore)
|
||||
{
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, last_unpack_row_length));
|
||||
|
||||
Reference in New Issue
Block a user