|
@@ -12,14 +12,14 @@
|
|
|
|
|
|
// CHANGELOG
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
-// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplA5_RenderDrawData() in the .h file so you can call it yourself.
|
|
|
+// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplAllegro5_RenderDrawData() in the .h file so you can call it yourself.
|
|
|
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
|
|
|
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
|
|
|
|
|
|
#include <stdint.h> // uint64_t
|
|
|
#include <cstring> // memcpy
|
|
|
#include "imgui.h"
|
|
|
-#include "imgui_impl_a5.h"
|
|
|
+#include "imgui_impl_allegro5.h"
|
|
|
#include <allegro5/allegro.h>
|
|
|
#include <allegro5/allegro_primitives.h>
|
|
|
|
|
@@ -43,7 +43,7 @@ struct ImDrawVertAllegro
|
|
|
|
|
|
// Render function.
|
|
|
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
|
|
|
-void ImGui_ImplA5_RenderDrawData(ImDrawData* draw_data)
|
|
|
+void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
|
|
|
{
|
|
|
int op, src, dst;
|
|
|
al_get_blender(&op, &src, &dst);
|
|
@@ -97,7 +97,7 @@ void ImGui_ImplA5_RenderDrawData(ImDrawData* draw_data)
|
|
|
al_set_clipping_rectangle(0, 0, al_get_display_width(g_Display), al_get_display_height(g_Display));
|
|
|
}
|
|
|
|
|
|
-bool Imgui_ImplA5_CreateDeviceObjects()
|
|
|
+bool ImGui_ImplAllegro5_CreateDeviceObjects()
|
|
|
{
|
|
|
// Build texture atlas
|
|
|
ImGuiIO &io = ImGui::GetIO();
|
|
@@ -144,7 +144,7 @@ bool Imgui_ImplA5_CreateDeviceObjects()
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void ImGui_ImplA5_InvalidateDeviceObjects()
|
|
|
+void ImGui_ImplAllegro5_InvalidateDeviceObjects()
|
|
|
{
|
|
|
if (g_Texture)
|
|
|
{
|
|
@@ -159,7 +159,7 @@ void ImGui_ImplA5_InvalidateDeviceObjects()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display)
|
|
|
+bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
|
|
|
{
|
|
|
g_Display = display;
|
|
|
|
|
@@ -205,16 +205,16 @@ bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void ImGui_ImplA5_Shutdown()
|
|
|
+void ImGui_ImplAllegro5_Shutdown()
|
|
|
{
|
|
|
- ImGui_ImplA5_InvalidateDeviceObjects();
|
|
|
+ ImGui_ImplAllegro5_InvalidateDeviceObjects();
|
|
|
}
|
|
|
|
|
|
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
|
|
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
|
|
|
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
|
|
|
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
|
|
|
-bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT *ev)
|
|
|
+bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT *ev)
|
|
|
{
|
|
|
ImGuiIO &io = ImGui::GetIO();
|
|
|
|
|
@@ -238,10 +238,10 @@ bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT *ev)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-void ImGui_ImplA5_NewFrame()
|
|
|
+void ImGui_ImplAllegro5_NewFrame()
|
|
|
{
|
|
|
if (!g_Texture)
|
|
|
- Imgui_ImplA5_CreateDeviceObjects();
|
|
|
+ ImGui_ImplAllegro5_CreateDeviceObjects();
|
|
|
|
|
|
ImGuiIO &io = ImGui::GetIO();
|
|
|
|