Skip to content

Commit

Permalink
Backends: OpenGL2, OpenGL3: ImGui_ImplOpenGL3_NewFrame() recreates fo…
Browse files Browse the repository at this point in the history
…nt texture if it has been destroyed by ImGui_ImplOpenGL3_DestroyFontsTexture(). (#7748)

Analogous to change to Vulkan backend in 1.90.
  • Loading branch information
ocornut committed Jun 28, 2024
1 parent 0582f76 commit 404af57
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backends/imgui_impl_opengl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-06-28: OpenGL: ImGui_ImplOpenGL2_NewFrame() recreates font texture if it has been destroyed by ImGui_ImplOpenGL2_DestroyFontsTexture(). (#7748)
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
// 2021-12-08: OpenGL: Fixed mishandling of the ImDrawCmd::IdxOffset field! This is an old bug but it never had an effect until some internal rendering changes in 1.86.
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
Expand Down Expand Up @@ -113,6 +114,8 @@ void ImGui_ImplOpenGL2_NewFrame()

if (!bd->FontTexture)
ImGui_ImplOpenGL2_CreateDeviceObjects();
if (!bd->FontTexture)
ImGui_ImplOpenGL2_CreateFontsTexture();
}

static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height)
Expand Down
3 changes: 3 additions & 0 deletions backends/imgui_impl_opengl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-06-28: OpenGL: ImGui_ImplOpenGL3_NewFrame() recreates font texture if it has been destroyed by ImGui_ImplOpenGL3_DestroyFontsTexture(). (#7748)
// 2024-05-07: OpenGL: Update loader for Linux to support EGL/GLVND. (#7562)
// 2024-04-16: OpenGL: Detect ES3 contexts on desktop based on version string, to e.g. avoid calling glPolygonMode() on them. (#7447)
// 2024-01-09: OpenGL: Update GL3W based imgui_impl_opengl3_loader.h to load "libGL.so" and variants, fixing regression on distros missing a symlink.
Expand Down Expand Up @@ -402,6 +403,8 @@ void ImGui_ImplOpenGL3_NewFrame()

if (!bd->ShaderHandle)
ImGui_ImplOpenGL3_CreateDeviceObjects();
if (!bd->FontTexture)
ImGui_ImplOpenGL3_CreateFontsTexture();
}

static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object)
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Other changes:
- Debug Tools: Metrics/Debugger: Browsing a Storage perform hover lookup on identifier.
- Viewports: Backported 'void* ImGuiViewport::PlatformHandle' from docking branch for
use by backends.
- Backends: OpenGL2, OpenGL3: ImGui_ImplOpenGL3_NewFrame() recreates font texture if it
has been destroyed by ImGui_ImplOpenGL3_DestroyFontsTexture(). (#7748) [@mlauss2]
- Backends: SDL3: Update for API removal of keysym field in SDL_KeyboardEvent. (#7728)
- Backends: SDL3: Update for SDL_StartTextInput()/SDL_StopTextInput() API changes. (#7735)
- Backends: Vulkan: Remove Volk/ from volk.h #include directives. (#7722, #6582, #4854)
Expand Down

0 comments on commit 404af57

Please sign in to comment.