Skip to content

Commit

Permalink
Update Imgui to 1.91.5
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Nov 9, 2024
1 parent 98849f2 commit f4bd771
Show file tree
Hide file tree
Showing 14 changed files with 2,550 additions and 1,745 deletions.
2 changes: 1 addition & 1 deletion platforms/shared/desktop/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static void main_window(void)
float tex_h = (float)runtime.screen_width / (float)(SYSTEM_TEXTURE_WIDTH);
float tex_v = (float)runtime.screen_height / (float)(SYSTEM_TEXTURE_HEIGHT);

ImGui::Image((void*)(intptr_t)renderer_emu_texture, ImVec2((float)gui_main_window_width, (float)gui_main_window_height), ImVec2(0, 0), ImVec2(tex_h, tex_v));
ImGui::Image((ImTextureID)(intptr_t)renderer_emu_texture, ImVec2((float)gui_main_window_width, (float)gui_main_window_height), ImVec2(0, 0), ImVec2(tex_h, tex_v));

if (config_video.fps)
gui_show_fps();
Expand Down
8 changes: 4 additions & 4 deletions platforms/shared/desktop/gui_debug_huc6270.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void gui_debug_window_huc6270_background(void)
ImVec2 p = ImGui::GetCursorScreenPos();
ImDrawList* draw_list = ImGui::GetWindowDrawList();

ImGui::Image((void*)(intptr_t)renderer_emu_debug_huc6270_background, ImVec2(size_h, size_v), ImVec2(0.0f, 0.0f), ImVec2(emu_debug_background_buffer_width / texture_size_h, emu_debug_background_buffer_height / texture_size_v));
ImGui::Image((ImTextureID)(intptr_t)renderer_emu_debug_huc6270_background, ImVec2(size_h, size_v), ImVec2(0.0f, 0.0f), ImVec2(emu_debug_background_buffer_width / texture_size_h, emu_debug_background_buffer_height / texture_size_v));

if (show_grid)
{
Expand Down Expand Up @@ -332,7 +332,7 @@ void gui_debug_window_huc6270_background(void)
float tile_uv_h = (i % screen_size_x) * 8.0f;
float tile_uv_v = (i / screen_size_x) * 8.0f;

ImGui::Image((void*)(intptr_t)renderer_emu_debug_huc6270_background, ImVec2(tile_width, tile_height), ImVec2(tile_uv_h / texture_size_h, tile_uv_v / texture_size_v), ImVec2((tile_uv_h + 8) / texture_size_h, (tile_uv_v + 8) / texture_size_v));
ImGui::Image((ImTextureID)(intptr_t)renderer_emu_debug_huc6270_background, ImVec2(tile_width, tile_height), ImVec2(tile_uv_h / texture_size_h, tile_uv_v / texture_size_v), ImVec2((tile_uv_h + 8) / texture_size_h, (tile_uv_v + 8) / texture_size_v));

ImGui::PushFont(gui_default_font);

Expand Down Expand Up @@ -403,7 +403,7 @@ void gui_debug_window_huc6270_sprites(void)
float tex_h = fwidth / 32.0f / scale;
float tex_v = fheight / 64.0f / scale;

ImGui::Image((void*)(intptr_t)renderer_emu_debug_huc6270_sprites[s], ImVec2(fwidth, fheight), ImVec2(0.0f, 0.0f), ImVec2(tex_h, tex_v));
ImGui::Image((ImTextureID)(intptr_t)renderer_emu_debug_huc6270_sprites[s], ImVec2(fwidth, fheight), ImVec2(0.0f, 0.0f), ImVec2(tex_h, tex_v));

float mouse_x = io.MousePos.x - p[s].x;
float mouse_y = io.MousePos.y - p[s].y;
Expand All @@ -425,7 +425,7 @@ void gui_debug_window_huc6270_sprites(void)
float tex_h = (float)runtime.screen_width / (float)(SYSTEM_TEXTURE_WIDTH);
float tex_v = (float)runtime.screen_height / (float)(SYSTEM_TEXTURE_HEIGHT);

ImGui::Image((void*)(intptr_t)renderer_emu_texture, ImVec2(runtime.screen_width * screen_scale, runtime.screen_height * screen_scale), ImVec2(0, 0), ImVec2(tex_h, tex_v));
ImGui::Image((ImTextureID)(intptr_t)renderer_emu_texture, ImVec2(runtime.screen_width * screen_scale, runtime.screen_height * screen_scale), ImVec2(0, 0), ImVec2(tex_h, tex_v));

for (int s = 0; s < 64; s++)
{
Expand Down
12 changes: 7 additions & 5 deletions platforms/shared/desktop/imgui/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.

//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
Expand All @@ -43,7 +42,7 @@
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default io.PlatformOpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
Expand Down Expand Up @@ -83,10 +82,13 @@
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
//#define IMGUI_ENABLE_FREETYPE

//---- Use FreeType+lunasvg library to render OpenType SVG fonts (SVGinOT)
// Requires lunasvg headers to be available in the include path + program to be linked with the lunasvg library (not provided).
//---- Use FreeType + plutosvg or lunasvg to render OpenType SVG fonts (SVGinOT)
// Only works in combination with IMGUI_ENABLE_FREETYPE.
// (implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
// - lunasvg is currently easier to acquire/install, as e.g. it is part of vcpkg.
// - plutosvg will support more fonts and may load them faster. It currently requires to be built manually but it is fairly easy. See misc/freetype/README for instructions.
// - Both require headers to be available in the include path + program to be linked with the library code (not provided).
// - (note: lunasvg implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
//#define IMGUI_ENABLE_FREETYPE_PLUTOSVG
//#define IMGUI_ENABLE_FREETYPE_LUNASVG

//---- Use stb_truetype to build and rasterize the font atlas (default)
Expand Down
Loading

0 comments on commit f4bd771

Please sign in to comment.