Skip to content

Commit

Permalink
Merge branch 'elloramir-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Mar 21, 2024
2 parents 00c9072 + 837b476 commit 7d13a67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Updates

### 21-Mar-2024:

- sokol_imgui.h: merged PR https://github.com/floooh/sokol/pull/1010, this will automatically
re-create the sokol-gfx font texture resources in the `simgui_new_frame()` call
when the Dear ImGui texture atlas has changed. This is an alternative to calling the
functions `simgui_create_fonts_texture()` and `simgui_destroy_fonts_texture()` manually.
One important reason why you'd want to call those functions manually is to create the fonts texture
with custom texture sampler attributes (the new implicit re-creation inside `simgui_new_frame()`
calls `sg_make_sampler()` with default attributes).

### 02-Mar-2024:

- sokol_app.h emscripten: two new flags in `sapp_desc` to configure the Emscripten main loop:
Expand Down
6 changes: 6 additions & 0 deletions util/sokol_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2521,6 +2521,12 @@ SOKOL_API_IMPL void simgui_new_frame(const simgui_frame_desc_t* desc) {
#else
ImGuiIO* io = igGetIO();
#endif
if (!io->Fonts->TexReady) {
simgui_destroy_fonts_texture();
simgui_font_tex_desc_t simgui_font_smp_desc;
_simgui_clear(&simgui_font_smp_desc, sizeof(simgui_font_smp_desc));
simgui_create_fonts_texture(&simgui_font_smp_desc);
}
io->DisplaySize.x = ((float)desc->width) / _simgui.cur_dpi_scale;
io->DisplaySize.y = ((float)desc->height) / _simgui.cur_dpi_scale;
io->DeltaTime = (float)desc->delta_time;
Expand Down

0 comments on commit 7d13a67

Please sign in to comment.