Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ocornut/imgui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3c435c029788cc26c52e835e2feb262a3057addc
Choose a base ref
...
head repository: ocornut/imgui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 08400f5be7fa8a83682b99d611ab7cdc66258425
Choose a head ref
Loading
Showing with 12,739 additions and 4,711 deletions.
  1. +1 −1 .github/FUNDING.yml
  2. +65 −5 .github/workflows/build.yml
  3. +12 −0 .github/workflows/manual.yml
  4. +3 −1 .gitignore
  5. +32 −25 backends/imgui_impl_allegro5.cpp
  6. +2 −1 backends/imgui_impl_allegro5.h
  7. +3 −1 backends/imgui_impl_android.cpp
  8. +2 −1 backends/imgui_impl_android.h
  9. +69 −67 backends/imgui_impl_dx10.cpp
  10. +2 −1 backends/imgui_impl_dx10.h
  11. +88 −75 backends/imgui_impl_dx11.cpp
  12. +14 −1 backends/imgui_impl_dx11.h
  13. +129 −69 backends/imgui_impl_dx12.cpp
  14. +44 −15 backends/imgui_impl_dx12.h
  15. +82 −72 backends/imgui_impl_dx9.cpp
  16. +1 −0 backends/imgui_impl_dx9.h
  17. +115 −44 backends/imgui_impl_glfw.cpp
  18. +8 −3 backends/imgui_impl_glfw.h
  19. +2 −1 backends/imgui_impl_glut.cpp
  20. +2 −1 backends/imgui_impl_glut.h
  21. +2 −0 backends/imgui_impl_metal.h
  22. +16 −14 backends/imgui_impl_metal.mm
  23. +14 −7 backends/imgui_impl_opengl2.cpp
  24. +1 −0 backends/imgui_impl_opengl2.h
  25. +46 −36 backends/imgui_impl_opengl3.cpp
  26. +4 −4 backends/imgui_impl_opengl3.h
  27. +116 −16 backends/imgui_impl_opengl3_loader.h
  28. +3 −1 backends/imgui_impl_osx.h
  29. +26 −11 backends/imgui_impl_osx.mm
  30. +79 −23 backends/imgui_impl_sdl2.cpp
  31. +2 −1 backends/imgui_impl_sdl2.h
  32. +182 −109 backends/imgui_impl_sdl3.cpp
  33. +4 −4 backends/imgui_impl_sdl3.h
  34. +39 −30 backends/imgui_impl_sdlrenderer2.cpp
  35. +11 −1 backends/imgui_impl_sdlrenderer2.h
  36. +65 −31 backends/imgui_impl_sdlrenderer3.cpp
  37. +13 −1 backends/imgui_impl_sdlrenderer3.h
  38. +47 −39 backends/imgui_impl_vulkan.cpp
  39. +31 −16 backends/imgui_impl_vulkan.h
  40. +78 −17 backends/imgui_impl_wgpu.cpp
  41. +20 −2 backends/imgui_impl_wgpu.h
  42. +137 −100 backends/imgui_impl_win32.cpp
  43. +2 −1 backends/imgui_impl_win32.h
  44. +22 −22 docs/BACKENDS.md
  45. +1,382 −251 docs/CHANGELOG.txt
  46. +10 −43 docs/EXAMPLES.md
  47. +62 −28 docs/FAQ.md
  48. +5 −1 docs/FONTS.md
  49. +14 −14 docs/README.md
  50. +13 −18 docs/TODO.txt
  51. +1 −1 examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml
  52. +2 −2 examples/example_android_opengl3/main.cpp
  53. +5 −0 examples/example_glfw_opengl2/main.cpp
  54. +6 −1 examples/example_glfw_opengl3/main.cpp
  55. +1 −1 examples/example_glfw_vulkan/CMakeLists.txt
  56. +2 −2 examples/example_glfw_vulkan/build_win32.bat
  57. +4 −3 examples/example_glfw_vulkan/build_win64.bat
  58. +4 −4 examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj
  59. +29 −17 examples/example_glfw_vulkan/main.cpp
  60. +117 −0 examples/example_glfw_wgpu/CMakeLists.txt
  61. 0 examples/{example_emscripten_wgpu → example_glfw_wgpu}/Makefile.emscripten
  62. +2 −2 examples/{example_emscripten_wgpu → example_glfw_wgpu}/README.md
  63. +88 −19 examples/{example_emscripten_wgpu → example_glfw_wgpu}/main.cpp
  64. +5 −1 examples/{example_emscripten_wgpu → example_glfw_wgpu}/web/index.html
  65. +1 −1 examples/example_null/Makefile
  66. +5 −0 examples/example_sdl2_directx11/main.cpp
  67. +5 −0 examples/example_sdl2_opengl2/main.cpp
  68. +5 −0 examples/example_sdl2_opengl3/main.cpp
  69. +7 −2 examples/example_sdl2_sdlrenderer2/main.cpp
  70. +5 −1 examples/example_sdl2_vulkan/build_win32.bat
  71. +14 −0 examples/example_sdl2_vulkan/build_win64.bat
  72. +5 −5 examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj
  73. +29 −17 examples/example_sdl2_vulkan/main.cpp
  74. +3 −3 examples/example_sdl3_opengl3/Makefile
  75. +3 −3 examples/example_sdl3_opengl3/README.md
  76. +7 −1 examples/example_sdl3_opengl3/build_win32.bat
  77. +14 −0 examples/example_sdl3_opengl3/build_win64.bat
  78. +7 −5 examples/example_sdl3_opengl3/main.cpp
  79. +3 −3 examples/example_sdl3_sdlrenderer3/Makefile
  80. +13 −7 examples/example_sdl3_sdlrenderer3/main.cpp
  81. +14 −0 examples/example_sdl3_vulkan/build_win32.bat
  82. +14 −0 examples/example_sdl3_vulkan/build_win64.bat
  83. +190 −0 examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj
  84. +64 −0 examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj.filters
  85. +587 −0 examples/example_sdl3_vulkan/main.cpp
  86. +14 −2 examples/example_win32_directx10/main.cpp
  87. +13 −2 examples/example_win32_directx11/main.cpp
  88. +1 −2 examples/example_win32_directx12/build_win32.bat
  89. +5 −5 examples/example_win32_directx12/example_win32_directx12.vcxproj
  90. +93 −28 examples/example_win32_directx12/main.cpp
  91. +18 −4 examples/example_win32_directx9/main.cpp
  92. +8 −0 examples/example_win32_opengl3/build_mingw.bat
  93. +5 −0 examples/example_win32_opengl3/main.cpp
  94. +30 −0 examples/imgui_examples.sln
  95. +4 −3 examples/libs/emscripten/emscripten_mainloop_stub.h
  96. +1 −1 examples/libs/usynergy/uSynergy.h
  97. +15 −8 imconfig.h
  98. +2,200 −1,153 imgui.cpp
  99. +715 −315 imgui.h
  100. +2,280 −460 imgui_demo.cpp
  101. +117 −62 imgui_draw.cpp
  102. +556 −560 imgui_internal.h
  103. +190 −102 imgui_tables.cpp
  104. +1,970 −626 imgui_widgets.cpp
  105. +64 −36 imstb_textedit.h
  106. +1 −1 imstb_truetype.h
  107. +22 −4 misc/freetype/README.md
  108. +27 −11 misc/freetype/imgui_freetype.cpp
  109. +7 −0 misc/freetype/imgui_freetype.h
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: ['https://github.com/ocornut/imgui/wiki/Sponsors']
custom: ['https://github.com/ocornut/imgui/wiki/Funding']
70 changes: 65 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ on:
# "scheduled" workflow, while maintaining ability to perform local CI builds.
workflows:
- scheduled
- manual
branches:
- master
- docking
@@ -123,6 +124,11 @@ jobs:
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build Win32 example_sdl2_sdlrenderer2
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build Win32 example_sdl2_vulkan
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
@@ -168,6 +174,11 @@ jobs:
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'

- name: Build x64 example_sdl2_sdlrenderer2
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=x64 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build x64 example_sdl2_vulkan
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
@@ -207,7 +218,7 @@ jobs:
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'

Linux:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

@@ -313,6 +324,18 @@ jobs:
EOF
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (with C++20)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_OBSOLETE_KEYIO
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
g++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_DEBUG_TOOLS)
run: |
cat > example_single_file.cpp <<'EOF'
@@ -370,6 +393,18 @@ jobs:
EOF
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (C++26, Clang)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#define IMGUI_DISABLE_DEMO_WINDOWS
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
clang++ -I. -std=c++26 -Wall -Wformat -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp
- name: Build example_null (without c++ runtime, Clang)
run: |
cat > example_single_file.cpp <<'EOF'
@@ -422,6 +457,17 @@ jobs:
EOF
clang++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (single file build, c++20)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
clang++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (without c++ runtime)
run: |
cat > example_single_file.cpp <<'EOF'
@@ -470,7 +516,7 @@ jobs:
xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
Emscripten:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

@@ -481,6 +527,7 @@ jobs:
emsdk-master/emsdk update
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
sudo apt-get install build-essential
- name: Build example_sdl2_opengl3 with Emscripten
run: |
@@ -489,15 +536,28 @@ jobs:
popd
make -C examples/example_sdl2_opengl3 -f Makefile.emscripten
- name: Build example_emscripten_wgpu
# This build compiles example_glfw_wgpu using Makefile.emscripten and Emscripten GLFW built-in implementation (-sUSE_GLFW=3)
# This ensures 2 things: the make build works, and the GLFW built-in implementation is tested
- name: Build example_glfw_wgpu with Emscripten/Makefile
run: |
pushd emsdk-master
source ./emsdk_env.sh
popd
make -C examples/example_glfw_wgpu -f Makefile.emscripten
# This build compiles example_glfw_wgpu using CMakeLists.txt and Emscripten GLFW contrib port (--use-port=contrib.glfw3)
# This ensures 2 things: the CMake build works, and the GLFW contrib port is tested
- name: Build example_glfw_wgpu with Emscripten/CMake
run: |
pushd emsdk-master
source ./emsdk_env.sh
popd
make -C examples/example_emscripten_wgpu -f Makefile.emscripten
emcc -v
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release examples/example_glfw_wgpu
cmake --build build
Android:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

12 changes: 12 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# This is a dummy workflow used to trigger full builds manually.
#
name: manual

on: workflow_dispatch

jobs:
manual:
runs-on: ubuntu-latest
steps:
- run: exit 0
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

## Dear ImGui artifacts
imgui.ini
imgui*.ini

## General build artifacts
*.o
@@ -40,8 +41,9 @@ examples/*.o.tmp
examples/*.out.js
examples/*.out.wasm
examples/example_glfw_opengl3/web/*
examples/example_glfw_wgpu/web/*
examples/example_glfw_wgpu/external/*
examples/example_sdl2_opengl3/web/*
examples/example_emscripten_wgpu/web/*

## JetBrains IDE artifacts
.idea
57 changes: 32 additions & 25 deletions backends/imgui_impl_allegro5.cpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

// Implemented features:
// [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID!
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values are obsolete since 1.87 and not supported since 1.91.5]
// [X] Platform: Clipboard support (from Allegro 5.1.12)
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Issues:
@@ -20,6 +20,9 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
// 2022-11-30: Renderer: Restoring using al_draw_indexed_prim() when Allegro version is >= 5.2.5.
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
@@ -62,8 +65,8 @@
#ifdef _WIN32
#include <allegro5/allegro_windows.h>
#endif
#define ALLEGRO_HAS_CLIPBOARD (ALLEGRO_VERSION_INT >= ((5 << 24) | (1 << 16) | (12 << 8))) // Clipboard only supported from Allegro 5.1.12
#define ALLEGRO_HAS_DRAW_INDEXED_PRIM (ALLEGRO_VERSION_INT >= ((5 << 24) | (2 << 16) | ( 5 << 8))) // DX9 implementation of al_draw_indexed_prim() got fixed in Allegro 5.2.5
#define ALLEGRO_HAS_CLIPBOARD ((ALLEGRO_VERSION_INT & ~ALLEGRO_UNSTABLE_BIT) >= ((5 << 24) | (1 << 16) | (12 << 8))) // Clipboard only supported from Allegro 5.1.12
#define ALLEGRO_HAS_DRAW_INDEXED_PRIM ((ALLEGRO_VERSION_INT & ~ALLEGRO_UNSTABLE_BIT) >= ((5 << 24) | (2 << 16) | ( 5 << 8))) // DX9 implementation of al_draw_indexed_prim() got fixed in Allegro 5.2.5

// Visual Studio warnings
#ifdef _MSC_VER
@@ -146,14 +149,14 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
// Render command lists
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
const ImDrawList* draw_list = draw_data->CmdLists[n];

ImVector<ImDrawVertAllegro>& vertices = bd->BufVertices;
#if ALLEGRO_HAS_DRAW_INDEXED_PRIM
vertices.resize(cmd_list->VtxBuffer.Size);
for (int i = 0; i < cmd_list->VtxBuffer.Size; i++)
vertices.resize(draw_list->VtxBuffer.Size);
for (int i = 0; i < draw_list->VtxBuffer.Size; i++)
{
const ImDrawVert* src_v = &cmd_list->VtxBuffer[i];
const ImDrawVert* src_v = &draw_list->VtxBuffer[i];
ImDrawVertAllegro* dst_v = &vertices[i];
DRAW_VERT_IMGUI_TO_ALLEGRO(dst_v, src_v);
}
@@ -163,39 +166,39 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
// FIXME-OPT: Allegro doesn't support 16-bit indices.
// You can '#define ImDrawIdx int' in imconfig.h to request Dear ImGui to output 32-bit indices.
// Otherwise, we convert them from 16-bit to 32-bit at runtime here, which works perfectly but is a little wasteful.
bd->BufIndices.resize(cmd_list->IdxBuffer.Size);
for (int i = 0; i < cmd_list->IdxBuffer.Size; ++i)
bd->BufIndices[i] = (int)cmd_list->IdxBuffer.Data[i];
bd->BufIndices.resize(draw_list->IdxBuffer.Size);
for (int i = 0; i < draw_list->IdxBuffer.Size; ++i)
bd->BufIndices[i] = (int)draw_list->IdxBuffer.Data[i];
indices = bd->BufIndices.Data;
}
else if (sizeof(ImDrawIdx) == 4)
{
indices = (const int*)cmd_list->IdxBuffer.Data;
indices = (const int*)draw_list->IdxBuffer.Data;
}
#else
// Allegro's implementation of al_draw_indexed_prim() for DX9 was broken until 5.2.5. Unindex buffers ourselves while converting vertex format.
vertices.resize(cmd_list->IdxBuffer.Size);
for (int i = 0; i < cmd_list->IdxBuffer.Size; i++)
vertices.resize(draw_list->IdxBuffer.Size);
for (int i = 0; i < draw_list->IdxBuffer.Size; i++)
{
const ImDrawVert* src_v = &cmd_list->VtxBuffer[cmd_list->IdxBuffer[i]];
const ImDrawVert* src_v = &draw_list->VtxBuffer[draw_list->IdxBuffer[i]];
ImDrawVertAllegro* dst_v = &vertices[i];
DRAW_VERT_IMGUI_TO_ALLEGRO(dst_v, src_v);
}
#endif

// Render command lists
ImVec2 clip_off = draw_data->DisplayPos;
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
for (int cmd_i = 0; cmd_i < draw_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
const ImDrawCmd* pcmd = &draw_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
ImGui_ImplAllegro5_SetupRenderState(draw_data);
else
pcmd->UserCallback(cmd_list, pcmd);
pcmd->UserCallback(draw_list, pcmd);
}
else
{
@@ -291,7 +294,7 @@ void ImGui_ImplAllegro5_InvalidateDeviceObjects()
}

#if ALLEGRO_HAS_CLIPBOARD
static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
static const char* ImGui_ImplAllegro5_GetClipboardText(ImGuiContext*)
{
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
if (bd->ClipboardTextData)
@@ -300,14 +303,16 @@ static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
return bd->ClipboardTextData;
}

static void ImGui_ImplAllegro5_SetClipboardText(void*, const char* text)
static void ImGui_ImplAllegro5_SetClipboardText(ImGuiContext*, const char* text)
{
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
al_set_clipboard_text(bd->Display, text);
}
#endif

static ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
// Not static to allow third-party code to use that if they want to (but undocumented)
ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code);
ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
{
switch (key_code)
{
@@ -423,6 +428,7 @@ static ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
{
ImGuiIO& io = ImGui::GetIO();
IMGUI_CHECKVERSION();
IM_ASSERT(io.BackendPlatformUserData == nullptr && "Already initialized a platform backend!");

// Setup backend capabilities flags
@@ -446,9 +452,9 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
bd->VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));

#if ALLEGRO_HAS_CLIPBOARD
io.SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
io.ClipboardUserData = nullptr;
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
platform_io.Platform_SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
platform_io.Platform_GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
#endif

return true;
@@ -490,8 +496,9 @@ static void ImGui_ImplAllegro5_UpdateKeyModifiers()
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* ev)
{
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplAllegro5_Init()?");
ImGuiIO& io = ImGui::GetIO();

switch (ev->type)
{
@@ -586,7 +593,7 @@ static void ImGui_ImplAllegro5_UpdateMouseCursor()
void ImGui_ImplAllegro5_NewFrame()
{
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
IM_ASSERT(bd != nullptr && "Did you call ImGui_ImplAllegro5_Init()?");
IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplAllegro5_Init()?");

if (!bd->Texture)
ImGui_ImplAllegro5_CreateDeviceObjects();
3 changes: 2 additions & 1 deletion backends/imgui_impl_allegro5.h
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

// Implemented features:
// [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID!
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values are obsolete since 1.87 and not supported since 1.91.5]
// [X] Platform: Clipboard support (from Allegro 5.1.12)
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Issues:
@@ -25,6 +25,7 @@
struct ALLEGRO_DISPLAY;
union ALLEGRO_EVENT;

// Follow "Getting Started" link and check examples/ folder to learn about using backends!
IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display);
IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown();
IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame();
4 changes: 3 additions & 1 deletion backends/imgui_impl_android.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3)

// Implemented features:
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
// Missing features:
// [ ] Platform: Clipboard support.
@@ -263,6 +263,8 @@ int32_t ImGui_ImplAndroid_HandleInputEvent(const AInputEvent* input_event)

bool ImGui_ImplAndroid_Init(ANativeWindow* window)
{
IMGUI_CHECKVERSION();

g_Window = window;
g_Time = 0.0;

Loading