imgui_impl_allegro5.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // dear imgui: Renderer + Platform Backend for Allegro 5
  2. // (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.)
  3. // Implemented features:
  4. // [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID!
  5. // [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]
  6. // [X] Platform: Clipboard support (from Allegro 5.1.12).
  7. // [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
  8. // Missing features or Issues:
  9. // [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
  10. // [ ] Platform: Missing gamepad support.
  11. // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
  12. // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
  13. // Learn about Dear ImGui:
  14. // - FAQ https://dearimgui.com/faq
  15. // - Getting Started https://dearimgui.com/getting-started
  16. // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
  17. // - Introduction, links and more at the top of imgui.cpp
  18. #pragma once
  19. #include "imgui.h" // IMGUI_IMPL_API
  20. #ifndef IMGUI_DISABLE
  21. struct ALLEGRO_DISPLAY;
  22. union ALLEGRO_EVENT;
  23. // Follow "Getting Started" link and check examples/ folder to learn about using backends!
  24. IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display);
  25. IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown();
  26. IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame();
  27. IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data);
  28. IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event);
  29. // Use if you want to reset your rendering device without losing Dear ImGui state.
  30. IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects();
  31. IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects();
  32. #endif // #ifndef IMGUI_DISABLE