Skip to content

Commit 6bcd18e

Browse files
committed
Update Dear ImGui to v1.91.2
1 parent c7ad161 commit 6bcd18e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6148
-1751
lines changed

neo/libs/imgui/backends/imgui_impl_allegro5.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

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

6871
// Visual Studio warnings
6972
#ifdef _MSC_VER
@@ -291,7 +294,7 @@ void ImGui_ImplAllegro5_InvalidateDeviceObjects()
291294
}
292295

293296
#if ALLEGRO_HAS_CLIPBOARD
294-
static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
297+
static const char* ImGui_ImplAllegro5_GetClipboardText(ImGuiContext*)
295298
{
296299
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
297300
if (bd->ClipboardTextData)
@@ -300,14 +303,15 @@ static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
300303
return bd->ClipboardTextData;
301304
}
302305

303-
static void ImGui_ImplAllegro5_SetClipboardText(void*, const char* text)
306+
static void ImGui_ImplAllegro5_SetClipboardText(ImGuiContext*, const char* text)
304307
{
305308
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
306309
al_set_clipboard_text(bd->Display, text);
307310
}
308311
#endif
309312

310-
static ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
313+
// Not static to allow third-party code to use that if they want to (but undocumented)
314+
ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
311315
{
312316
switch (key_code)
313317
{
@@ -447,9 +451,9 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
447451
bd->VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));
448452

449453
#if ALLEGRO_HAS_CLIPBOARD
450-
io.SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
451-
io.GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
452-
io.ClipboardUserData = nullptr;
454+
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
455+
platform_io.Platform_SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
456+
platform_io.Platform_GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
453457
#endif
454458

455459
return true;

neo/libs/imgui/backends/imgui_impl_allegro5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
struct ALLEGRO_DISPLAY;
2626
union ALLEGRO_EVENT;
2727

28+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
2829
IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display);
2930
IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown();
3031
IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame();

neo/libs/imgui/backends/imgui_impl_android.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
struct ANativeWindow;
2929
struct AInputEvent;
3030

31+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
3132
IMGUI_IMPL_API bool ImGui_ImplAndroid_Init(ANativeWindow* window);
3233
IMGUI_IMPL_API int32_t ImGui_ImplAndroid_HandleInputEvent(const AInputEvent* input_event);
3334
IMGUI_IMPL_API void ImGui_ImplAndroid_Shutdown();

neo/libs/imgui/backends/imgui_impl_dx10.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
struct ID3D10Device;
2121

22+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
2223
IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device);
2324
IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown();
2425
IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame();

neo/libs/imgui/backends/imgui_impl_dx11.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
struct ID3D11Device;
2121
struct ID3D11DeviceContext;
2222

23+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
2324
IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context);
2425
IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown();
2526
IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame();

neo/libs/imgui/backends/imgui_impl_dx12.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ struct ID3D12GraphicsCommandList;
2727
struct D3D12_CPU_DESCRIPTOR_HANDLE;
2828
struct D3D12_GPU_DESCRIPTOR_HANDLE;
2929

30+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
31+
3032
// cmd_list is the command list that the implementation will use to render imgui draw lists.
3133
// Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate
3234
// render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle.

neo/libs/imgui/backends/imgui_impl_dx9.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
struct IDirect3DDevice9;
2121

22+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
2223
IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device);
2324
IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown();
2425
IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame();

0 commit comments

Comments
 (0)