imgui_impl_allegro5.cpp
Go to the documentation of this file.
1 // dear imgui: Renderer + Platform Binding for Allegro 5
2 // (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.)
3 
4 // Implemented features:
5 // [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID!
6 // [X] Platform: Clipboard support (from Allegro 5.1.12)
7 // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
8 // Issues:
9 // [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
10 // [ ] Platform: Missing gamepad support.
11 
12 // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
13 // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp.
14 // https://github.com/ocornut/imgui, Original Allegro 5 code by @birthggd
15 
16 // CHANGELOG
17 // (minor and older changes stripped away, please see git history for details)
18 // 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
19 // 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
20 // 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter().
21 // 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
22 // 2018-11-30: Platform: Added touchscreen support.
23 // 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window.
24 // 2018-06-13: Platform: Added clipboard support (from Allegro 5.1.12).
25 // 2018-06-13: Renderer: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
26 // 2018-06-13: Renderer: Backup/restore transform and clipping rectangle.
27 // 2018-06-11: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors flag + honor ImGuiConfigFlags_NoMouseCursorChange flag.
28 // 2018-04-18: Misc: Renamed file from imgui_impl_a5.cpp to imgui_impl_allegro5.cpp.
29 // 2018-04-18: Misc: Added support for 32-bit vertex indices to avoid conversion at runtime. Added imconfig_allegro5.h to enforce 32-bit indices when included from imgui.h.
30 // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplAllegro5_RenderDrawData() in the .h file so you can call it yourself.
31 // 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
32 // 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
33 
34 #include <stdint.h> // uint64_t
35 #include <cstring> // memcpy
36 #include "imgui.h"
37 #include "imgui_impl_allegro5.h"
38 
39 // Allegro
40 #include <allegro5/allegro.h>
41 #include <allegro5/allegro_primitives.h>
42 #ifdef _WIN32
43 #include <allegro5/allegro_windows.h>
44 #endif
45 #define ALLEGRO_HAS_CLIPBOARD (ALLEGRO_VERSION_INT >= ((5 << 24) | (1 << 16) | (12 << 8))) // Clipboard only supported from Allegro 5.1.12
46 
47 // Visual Studio warnings
48 #ifdef _MSC_VER
49 #pragma warning (disable: 4127) // condition expression is constant
50 #endif
51 
52 // Data
53 static ALLEGRO_DISPLAY* g_Display = NULL;
54 static ALLEGRO_BITMAP* g_Texture = NULL;
55 static double g_Time = 0.0;
56 static ALLEGRO_MOUSE_CURSOR* g_MouseCursorInvisible = NULL;
57 static ALLEGRO_VERTEX_DECL* g_VertexDecl = NULL;
58 static char* g_ClipboardTextData = NULL;
59 
61 {
64  ALLEGRO_COLOR col;
65 };
66 
68 {
69  // Setup blending
70  al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA);
71 
72  // Setup orthographic projection matrix
73  // Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right).
74  {
75  float L = draw_data->DisplayPos.x;
76  float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
77  float T = draw_data->DisplayPos.y;
78  float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
79  ALLEGRO_TRANSFORM transform;
80  al_identity_transform(&transform);
81  al_use_transform(&transform);
82  al_orthographic_transform(&transform, L, T, 1.0f, R, B, -1.0f);
83  al_use_projection_transform(&transform);
84  }
85 }
86 
87 // Render function.
88 // (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
90 {
91  // Avoid rendering when minimized
92  if (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f)
93  return;
94 
95  // Backup Allegro state that will be modified
96  ALLEGRO_TRANSFORM last_transform = *al_get_current_transform();
97  ALLEGRO_TRANSFORM last_projection_transform = *al_get_current_projection_transform();
98  int last_clip_x, last_clip_y, last_clip_w, last_clip_h;
99  al_get_clipping_rectangle(&last_clip_x, &last_clip_y, &last_clip_w, &last_clip_h);
100  int last_blender_op, last_blender_src, last_blender_dst;
101  al_get_blender(&last_blender_op, &last_blender_src, &last_blender_dst);
102 
103  // Setup desired render state
105 
106  // Render command lists
107  for (int n = 0; n < draw_data->CmdListsCount; n++)
108  {
109  const ImDrawList* cmd_list = draw_data->CmdLists[n];
110 
111  // Allegro's implementation of al_draw_indexed_prim() for DX9 is completely broken. Unindex our buffers ourselves.
112  // FIXME-OPT: Unfortunately Allegro doesn't support 32-bit packed colors so we have to convert them to 4 float as well..
113  static ImVector<ImDrawVertAllegro> vertices;
114  vertices.resize(cmd_list->IdxBuffer.Size);
115  for (int i = 0; i < cmd_list->IdxBuffer.Size; i++)
116  {
117  const ImDrawVert* src_v = &cmd_list->VtxBuffer[cmd_list->IdxBuffer[i]];
118  ImDrawVertAllegro* dst_v = &vertices[i];
119  dst_v->pos = src_v->pos;
120  dst_v->uv = src_v->uv;
121  unsigned char* c = (unsigned char*)&src_v->col;
122  dst_v->col = al_map_rgba(c[0], c[1], c[2], c[3]);
123  }
124 
125  const int* indices = NULL;
126  if (sizeof(ImDrawIdx) == 2)
127  {
128  // FIXME-OPT: Unfortunately Allegro doesn't support 16-bit indices.. You can '#define ImDrawIdx int' in imconfig.h to request Dear ImGui to output 32-bit indices.
129  // Otherwise, we convert them from 16-bit to 32-bit at runtime here, which works perfectly but is a little wasteful.
130  static ImVector<int> indices_converted;
131  indices_converted.resize(cmd_list->IdxBuffer.Size);
132  for (int i = 0; i < cmd_list->IdxBuffer.Size; ++i)
133  indices_converted[i] = (int)cmd_list->IdxBuffer.Data[i];
134  indices = indices_converted.Data;
135  }
136  else if (sizeof(ImDrawIdx) == 4)
137  {
138  indices = (const int*)cmd_list->IdxBuffer.Data;
139  }
140 
141  // Render command lists
142  int idx_offset = 0;
143  ImVec2 clip_off = draw_data->DisplayPos;
144  for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
145  {
146  const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
147  if (pcmd->UserCallback)
148  {
149  // User callback, registered via ImDrawList::AddCallback()
150  // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
153  else
154  pcmd->UserCallback(cmd_list, pcmd);
155  }
156  else
157  {
158  // Draw
159  ALLEGRO_BITMAP* texture = (ALLEGRO_BITMAP*)pcmd->TextureId;
160  al_set_clipping_rectangle(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y, pcmd->ClipRect.z - pcmd->ClipRect.x, pcmd->ClipRect.w - pcmd->ClipRect.y);
161  al_draw_prim(&vertices[0], g_VertexDecl, texture, idx_offset, idx_offset + pcmd->ElemCount, ALLEGRO_PRIM_TRIANGLE_LIST);
162  }
163  idx_offset += pcmd->ElemCount;
164  }
165  }
166 
167  // Restore modified Allegro state
168  al_set_blender(last_blender_op, last_blender_src, last_blender_dst);
169  al_set_clipping_rectangle(last_clip_x, last_clip_y, last_clip_w, last_clip_h);
170  al_use_transform(&last_transform);
171  al_use_projection_transform(&last_projection_transform);
172 }
173 
175 {
176  // Build texture atlas
177  ImGuiIO &io = ImGui::GetIO();
178  unsigned char* pixels;
179  int width, height;
181 
182  // Create texture
183  int flags = al_get_new_bitmap_flags();
184  int fmt = al_get_new_bitmap_format();
185  al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP|ALLEGRO_MIN_LINEAR|ALLEGRO_MAG_LINEAR);
186  al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE);
187  ALLEGRO_BITMAP* img = al_create_bitmap(width, height);
188  al_set_new_bitmap_flags(flags);
189  al_set_new_bitmap_format(fmt);
190  if (!img)
191  return false;
192 
193  ALLEGRO_LOCKED_REGION *locked_img = al_lock_bitmap(img, al_get_bitmap_format(img), ALLEGRO_LOCK_WRITEONLY);
194  if (!locked_img)
195  {
196  al_destroy_bitmap(img);
197  return false;
198  }
199  memcpy(locked_img->data, pixels, sizeof(int)*width*height);
200  al_unlock_bitmap(img);
201 
202  // Convert software texture to hardware texture.
203  ALLEGRO_BITMAP* cloned_img = al_clone_bitmap(img);
204  al_destroy_bitmap(img);
205  if (!cloned_img)
206  return false;
207 
208  // Store our identifier
209  io.Fonts->TexID = (void*)cloned_img;
210  g_Texture = cloned_img;
211 
212  // Create an invisible mouse cursor
213  // Because al_hide_mouse_cursor() seems to mess up with the actual inputs..
214  ALLEGRO_BITMAP* mouse_cursor = al_create_bitmap(8,8);
215  g_MouseCursorInvisible = al_create_mouse_cursor(mouse_cursor, 0, 0);
216  al_destroy_bitmap(mouse_cursor);
217 
218  return true;
219 }
220 
222 {
223  if (g_Texture)
224  {
225  al_destroy_bitmap(g_Texture);
227  g_Texture = NULL;
228  }
230  {
231  al_destroy_mouse_cursor(g_MouseCursorInvisible);
233  }
234 }
235 
236 #if ALLEGRO_HAS_CLIPBOARD
237 static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
238 {
240  al_free(g_ClipboardTextData);
241  g_ClipboardTextData = al_get_clipboard_text(g_Display);
242  return g_ClipboardTextData;
243 }
244 
245 static void ImGui_ImplAllegro5_SetClipboardText(void*, const char* text)
246 {
247  al_set_clipboard_text(g_Display, text);
248 }
249 #endif
250 
251 bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
252 {
253  g_Display = display;
254 
255  // Setup back-end capabilities flags
256  ImGuiIO& io = ImGui::GetIO();
257  io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
258  io.BackendPlatformName = io.BackendRendererName = "imgui_impl_allegro5";
259 
260  // Create custom vertex declaration.
261  // Unfortunately Allegro doesn't support 32-bit packed colors so we have to convert them to 4 floats.
262  // We still use a custom declaration to use 'ALLEGRO_PRIM_TEX_COORD' instead of 'ALLEGRO_PRIM_TEX_COORD_PIXEL' else we can't do a reliable conversion.
263  ALLEGRO_VERTEX_ELEMENT elems[] =
264  {
265  { ALLEGRO_PRIM_POSITION, ALLEGRO_PRIM_FLOAT_2, IM_OFFSETOF(ImDrawVertAllegro, pos) },
266  { ALLEGRO_PRIM_TEX_COORD, ALLEGRO_PRIM_FLOAT_2, IM_OFFSETOF(ImDrawVertAllegro, uv) },
267  { ALLEGRO_PRIM_COLOR_ATTR, 0, IM_OFFSETOF(ImDrawVertAllegro, col) },
268  { 0, 0, 0 }
269  };
270  g_VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));
271 
272  io.KeyMap[ImGuiKey_Tab] = ALLEGRO_KEY_TAB;
273  io.KeyMap[ImGuiKey_LeftArrow] = ALLEGRO_KEY_LEFT;
274  io.KeyMap[ImGuiKey_RightArrow] = ALLEGRO_KEY_RIGHT;
275  io.KeyMap[ImGuiKey_UpArrow] = ALLEGRO_KEY_UP;
276  io.KeyMap[ImGuiKey_DownArrow] = ALLEGRO_KEY_DOWN;
277  io.KeyMap[ImGuiKey_PageUp] = ALLEGRO_KEY_PGUP;
278  io.KeyMap[ImGuiKey_PageDown] = ALLEGRO_KEY_PGDN;
279  io.KeyMap[ImGuiKey_Home] = ALLEGRO_KEY_HOME;
280  io.KeyMap[ImGuiKey_End] = ALLEGRO_KEY_END;
281  io.KeyMap[ImGuiKey_Insert] = ALLEGRO_KEY_INSERT;
282  io.KeyMap[ImGuiKey_Delete] = ALLEGRO_KEY_DELETE;
283  io.KeyMap[ImGuiKey_Backspace] = ALLEGRO_KEY_BACKSPACE;
284  io.KeyMap[ImGuiKey_Space] = ALLEGRO_KEY_SPACE;
285  io.KeyMap[ImGuiKey_Enter] = ALLEGRO_KEY_ENTER;
286  io.KeyMap[ImGuiKey_Escape] = ALLEGRO_KEY_ESCAPE;
287  io.KeyMap[ImGuiKey_KeyPadEnter] = ALLEGRO_KEY_PAD_ENTER;
288  io.KeyMap[ImGuiKey_A] = ALLEGRO_KEY_A;
289  io.KeyMap[ImGuiKey_C] = ALLEGRO_KEY_C;
290  io.KeyMap[ImGuiKey_V] = ALLEGRO_KEY_V;
291  io.KeyMap[ImGuiKey_X] = ALLEGRO_KEY_X;
292  io.KeyMap[ImGuiKey_Y] = ALLEGRO_KEY_Y;
293  io.KeyMap[ImGuiKey_Z] = ALLEGRO_KEY_Z;
294  io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
295 
296 #if ALLEGRO_HAS_CLIPBOARD
297  io.SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
298  io.GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
299  io.ClipboardUserData = NULL;
300 #endif
301 
302  return true;
303 }
304 
306 {
308 
309  g_Display = NULL;
310  g_Time = 0.0;
311 
312  if (g_VertexDecl)
313  al_destroy_vertex_decl(g_VertexDecl);
314  g_VertexDecl = NULL;
315 
317  al_free(g_ClipboardTextData);
319 }
320 
321 // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
322 // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
323 // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
324 // Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
325 bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT *ev)
326 {
327  ImGuiIO& io = ImGui::GetIO();
328 
329  switch (ev->type)
330  {
331  case ALLEGRO_EVENT_MOUSE_AXES:
332  if (ev->mouse.display == g_Display)
333  {
334  io.MouseWheel += ev->mouse.dz;
335  io.MouseWheelH += ev->mouse.dw;
336  io.MousePos = ImVec2(ev->mouse.x, ev->mouse.y);
337  }
338  return true;
339  case ALLEGRO_EVENT_MOUSE_BUTTON_DOWN:
340  case ALLEGRO_EVENT_MOUSE_BUTTON_UP:
341  if (ev->mouse.display == g_Display && ev->mouse.button <= 5)
342  io.MouseDown[ev->mouse.button - 1] = (ev->type == ALLEGRO_EVENT_MOUSE_BUTTON_DOWN);
343  return true;
344  case ALLEGRO_EVENT_TOUCH_MOVE:
345  if (ev->touch.display == g_Display)
346  io.MousePos = ImVec2(ev->touch.x, ev->touch.y);
347  return true;
348  case ALLEGRO_EVENT_TOUCH_BEGIN:
349  case ALLEGRO_EVENT_TOUCH_END:
350  case ALLEGRO_EVENT_TOUCH_CANCEL:
351  if (ev->touch.display == g_Display && ev->touch.primary)
352  io.MouseDown[0] = (ev->type == ALLEGRO_EVENT_TOUCH_BEGIN);
353  return true;
354  case ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY:
355  if (ev->mouse.display == g_Display)
356  io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
357  return true;
358  case ALLEGRO_EVENT_KEY_CHAR:
359  if (ev->keyboard.display == g_Display)
360  io.AddInputCharacter((unsigned int)ev->keyboard.unichar);
361  return true;
362  case ALLEGRO_EVENT_KEY_DOWN:
363  case ALLEGRO_EVENT_KEY_UP:
364  if (ev->keyboard.display == g_Display)
365  io.KeysDown[ev->keyboard.keycode] = (ev->type == ALLEGRO_EVENT_KEY_DOWN);
366  return true;
367  }
368  return false;
369 }
370 
372 {
373  ImGuiIO& io = ImGui::GetIO();
375  return;
376 
377  ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
378  if (io.MouseDrawCursor || imgui_cursor == ImGuiMouseCursor_None)
379  {
380  // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
381  al_set_mouse_cursor(g_Display, g_MouseCursorInvisible);
382  }
383  else
384  {
385  ALLEGRO_SYSTEM_MOUSE_CURSOR cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_DEFAULT;
386  switch (imgui_cursor)
387  {
388  case ImGuiMouseCursor_TextInput: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_EDIT; break;
389  case ImGuiMouseCursor_ResizeAll: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_MOVE; break;
390  case ImGuiMouseCursor_ResizeNS: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_N; break;
391  case ImGuiMouseCursor_ResizeEW: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_E; break;
392  case ImGuiMouseCursor_ResizeNESW: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NE; break;
393  case ImGuiMouseCursor_ResizeNWSE: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NW; break;
394  case ImGuiMouseCursor_NotAllowed: cursor_id = ALLEGRO_SYSTEM_MOUSE_CURSOR_UNAVAILABLE; break;
395  }
396  al_set_system_mouse_cursor(g_Display, cursor_id);
397  }
398 }
399 
401 {
402  if (!g_Texture)
404 
405  ImGuiIO &io = ImGui::GetIO();
406 
407  // Setup display size (every frame to accommodate for window resizing)
408  int w, h;
409  w = al_get_display_width(g_Display);
410  h = al_get_display_height(g_Display);
411  io.DisplaySize = ImVec2((float)w, (float)h);
412 
413  // Setup time step
414  double current_time = al_get_time();
415  io.DeltaTime = g_Time > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f/60.0f);
416  g_Time = current_time;
417 
418  // Setup inputs
419  ALLEGRO_KEYBOARD_STATE keys;
420  al_get_keyboard_state(&keys);
421  io.KeyCtrl = al_key_down(&keys, ALLEGRO_KEY_LCTRL) || al_key_down(&keys, ALLEGRO_KEY_RCTRL);
422  io.KeyShift = al_key_down(&keys, ALLEGRO_KEY_LSHIFT) || al_key_down(&keys, ALLEGRO_KEY_RSHIFT);
423  io.KeyAlt = al_key_down(&keys, ALLEGRO_KEY_ALT) || al_key_down(&keys, ALLEGRO_KEY_ALTGR);
424  io.KeySuper = al_key_down(&keys, ALLEGRO_KEY_LWIN) || al_key_down(&keys, ALLEGRO_KEY_RWIN);
425 
427 }
ImGuiIO::KeyMap
int KeyMap[ImGuiKey_COUNT]
Definition: imgui.h:1430
ImGuiMouseCursor_ResizeEW
@ ImGuiMouseCursor_ResizeEW
Definition: imgui.h:1249
ImGuiKey_Z
@ ImGuiKey_Z
Definition: imgui.h:1008
ImDrawVertAllegro::pos
ImVec2 pos
Definition: imgui_impl_allegro5.cpp:62
g_VertexDecl
static ALLEGRO_VERTEX_DECL * g_VertexDecl
Definition: imgui_impl_allegro5.cpp:57
ImDrawIdx
unsigned short ImDrawIdx
Definition: imgui.h:1888
ImGuiIO::KeySuper
bool KeySuper
Definition: imgui.h:1492
ImGuiIO::KeyCtrl
bool KeyCtrl
Definition: imgui.h:1489
height
GLint GLsizei GLsizei height
Definition: glcorearb.h:2768
g_MouseCursorInvisible
static ALLEGRO_MOUSE_CURSOR * g_MouseCursorInvisible
Definition: imgui_impl_allegro5.cpp:56
img
GLint GLvoid * img
Definition: glcorearb.h:2885
g_Display
static ALLEGRO_DISPLAY * g_Display
Definition: imgui_impl_allegro5.cpp:53
ImDrawData::DisplayPos
ImVec2 DisplayPos
Definition: imgui.h:2075
ImGuiIO::Fonts
ImFontAtlas * Fonts
Definition: imgui.h:1435
ImDrawList::IdxBuffer
ImVector< ImDrawIdx > IdxBuffer
Definition: imgui.h:1965
ImFontAtlas::TexID
ImTextureID TexID
Definition: imgui.h:2247
ImGuiKey_PageUp
@ ImGuiKey_PageUp
Definition: imgui.h:992
ImDrawData::CmdListsCount
int CmdListsCount
Definition: imgui.h:2072
NULL
NULL
Definition: test_security_zap.cpp:405
texture
GLuint texture
Definition: glcorearb.h:2840
ImVec4::z
float z
Definition: imgui.h:223
ImGuiIO::KeyShift
bool KeyShift
Definition: imgui.h:1490
ImDrawVertAllegro::uv
ImVec2 uv
Definition: imgui_impl_allegro5.cpp:63
g_ClipboardTextData
static char * g_ClipboardTextData
Definition: imgui_impl_allegro5.cpp:58
ImDrawData::CmdLists
ImDrawList ** CmdLists
Definition: imgui.h:2071
ImGuiKey_Enter
@ ImGuiKey_Enter
Definition: imgui.h:1000
ImGuiKey_Delete
@ ImGuiKey_Delete
Definition: imgui.h:997
ImGuiKey_X
@ ImGuiKey_X
Definition: imgui.h:1006
ImDrawVert::uv
ImVec2 uv
Definition: imgui.h:1896
ImDrawList
Definition: imgui.h:1961
ImGuiKey_RightArrow
@ ImGuiKey_RightArrow
Definition: imgui.h:989
ImGuiMouseCursor_None
@ ImGuiMouseCursor_None
Definition: imgui.h:1244
imgui.h
ImGuiKey_Space
@ ImGuiKey_Space
Definition: imgui.h:999
ImVector
Definition: imgui.h:1301
ImGuiIO::ClipboardUserData
void * ClipboardUserData
Definition: imgui.h:1465
ImGuiIO::GetClipboardTextFn
const char *(* GetClipboardTextFn)(void *user_data)
Definition: imgui.h:1463
ImVec2
Definition: imgui.h:208
ImGuiKey_End
@ ImGuiKey_End
Definition: imgui.h:995
ImGuiIO::KeyAlt
bool KeyAlt
Definition: imgui.h:1491
ImGui::GetIO
IMGUI_API ImGuiIO & GetIO()
Definition: imgui.cpp:3286
ImGuiIO::MouseDrawCursor
bool MouseDrawCursor
Definition: imgui.h:1442
g_Texture
static ALLEGRO_BITMAP * g_Texture
Definition: imgui_impl_allegro5.cpp:54
T
#define T(upbtypeconst, upbtype, ctype, default_value)
ImGui::GetMouseCursor
IMGUI_API ImGuiMouseCursor GetMouseCursor()
Definition: imgui.cpp:4543
ImGuiIO::AddInputCharacter
IMGUI_API void AddInputCharacter(unsigned int c)
Definition: imgui.cpp:1130
ImDrawList::CmdBuffer
ImVector< ImDrawCmd > CmdBuffer
Definition: imgui.h:1964
flags
GLbitfield flags
Definition: glcorearb.h:3585
ImDrawCmd
Definition: imgui.h:1871
ImGui_ImplAllegro5_NewFrame
void ImGui_ImplAllegro5_NewFrame()
Definition: imgui_impl_allegro5.cpp:400
ImDrawCmd::TextureId
ImTextureID TextureId
Definition: imgui.h:1875
ImGuiKey_A
@ ImGuiKey_A
Definition: imgui.h:1003
ImGuiKey_Home
@ ImGuiKey_Home
Definition: imgui.h:994
ImDrawCmd::UserCallback
ImDrawCallback UserCallback
Definition: imgui.h:1878
ImDrawVertAllegro::col
ALLEGRO_COLOR col
Definition: imgui_impl_allegro5.cpp:64
ImGuiBackendFlags_HasMouseCursors
@ ImGuiBackendFlags_HasMouseCursors
Definition: imgui.h:1078
ImGuiIO::MouseDown
bool MouseDown[5]
Definition: imgui.h:1486
ImVec4::y
float y
Definition: imgui.h:223
ImGuiMouseCursor_NotAllowed
@ ImGuiMouseCursor_NotAllowed
Definition: imgui.h:1253
ImVector::Data
T * Data
Definition: imgui.h:1305
ImGuiIO::ConfigFlags
ImGuiConfigFlags ConfigFlags
Definition: imgui.h:1420
ImGui_ImplAllegro5_Shutdown
void ImGui_ImplAllegro5_Shutdown()
Definition: imgui_impl_allegro5.cpp:305
ImGuiKey_Y
@ ImGuiKey_Y
Definition: imgui.h:1007
ImGuiKey_DownArrow
@ ImGuiKey_DownArrow
Definition: imgui.h:991
ImDrawData
Definition: imgui.h:2068
ImVector::Size
int Size
Definition: imgui.h:1303
ImDrawVert
Definition: imgui.h:1893
ImVec2::x
float x
Definition: imgui.h:210
ImDrawCmd::ClipRect
ImVec4 ClipRect
Definition: imgui.h:1874
ImGuiKey_KeyPadEnter
@ ImGuiKey_KeyPadEnter
Definition: imgui.h:1002
testing::internal::fmt
GTEST_API_ const char * fmt
Definition: gtest.h:1835
ImGui_ImplAllegro5_InvalidateDeviceObjects
void ImGui_ImplAllegro5_InvalidateDeviceObjects()
Definition: imgui_impl_allegro5.cpp:221
ImGuiIO::MouseWheel
float MouseWheel
Definition: imgui.h:1487
IM_OFFSETOF
#define IM_OFFSETOF(_TYPE, _MEMBER)
Definition: imgui.h:93
ImGuiKey_LeftArrow
@ ImGuiKey_LeftArrow
Definition: imgui.h:988
ImGuiMouseCursor_ResizeAll
@ ImGuiMouseCursor_ResizeAll
Definition: imgui.h:1247
ImDrawVertAllegro
Definition: imgui_impl_allegro5.cpp:60
ImGui_ImplAllegro5_Init
bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY *display)
Definition: imgui_impl_allegro5.cpp:251
ImVec4::x
float x
Definition: imgui.h:223
ImGui_ImplAllegro5_SetupRenderState
static void ImGui_ImplAllegro5_SetupRenderState(ImDrawData *draw_data)
Definition: imgui_impl_allegro5.cpp:67
ImGuiKey_PageDown
@ ImGuiKey_PageDown
Definition: imgui.h:993
n
GLdouble n
Definition: glcorearb.h:4153
ImGui_ImplAllegro5_CreateDeviceObjects
bool ImGui_ImplAllegro5_CreateDeviceObjects()
Definition: imgui_impl_allegro5.cpp:174
ImGuiKey_C
@ ImGuiKey_C
Definition: imgui.h:1004
ImDrawList::VtxBuffer
ImVector< ImDrawVert > VtxBuffer
Definition: imgui.h:1966
i
int i
Definition: gmock-matchers_test.cc:764
ImGuiKey_Escape
@ ImGuiKey_Escape
Definition: imgui.h:1001
ImGuiMouseCursor_ResizeNWSE
@ ImGuiMouseCursor_ResizeNWSE
Definition: imgui.h:1251
ImGuiIO::BackendPlatformName
const char * BackendPlatformName
Definition: imgui.h:1455
ImGui_ImplAllegro5_RenderDrawData
void ImGui_ImplAllegro5_RenderDrawData(ImDrawData *draw_data)
Definition: imgui_impl_allegro5.cpp:89
ImGuiIO::MousePos
ImVec2 MousePos
Definition: imgui.h:1485
ImGui_ImplAllegro5_UpdateMouseCursor
static void ImGui_ImplAllegro5_UpdateMouseCursor()
Definition: imgui_impl_allegro5.cpp:371
ImGuiIO::DisplaySize
ImVec2 DisplaySize
Definition: imgui.h:1422
ImDrawVert::col
ImU32 col
Definition: imgui.h:1897
ImVector::resize
void resize(int new_size)
Definition: imgui.h:1337
ImVec4::w
float w
Definition: imgui.h:223
ImGuiMouseCursor_ResizeNESW
@ ImGuiMouseCursor_ResizeNESW
Definition: imgui.h:1250
ImGuiMouseCursor_TextInput
@ ImGuiMouseCursor_TextInput
Definition: imgui.h:1246
ImDrawCallback_ResetRenderState
#define ImDrawCallback_ResetRenderState
Definition: imgui.h:1866
ImGuiIO::BackendRendererName
const char * BackendRendererName
Definition: imgui.h:1456
ImGui_ImplAllegro5_ProcessEvent
bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT *ev)
Definition: imgui_impl_allegro5.cpp:325
indices
GLsizei GLenum const GLvoid * indices
Definition: glcorearb.h:2831
ImGuiIO
Definition: imgui.h:1414
ImGuiIO::MouseWheelH
float MouseWheelH
Definition: imgui.h:1488
ImGuiKey_Backspace
@ ImGuiKey_Backspace
Definition: imgui.h:998
ImGuiIO::KeysDown
bool KeysDown[512]
Definition: imgui.h:1493
ImGuiKey_UpArrow
@ ImGuiKey_UpArrow
Definition: imgui.h:990
imgui_impl_allegro5.h
ImDrawData::DisplaySize
ImVec2 DisplaySize
Definition: imgui.h:2076
f
GLfloat f
Definition: glcorearb.h:3964
ImGuiKey_Insert
@ ImGuiKey_Insert
Definition: imgui.h:996
pixels
GLint GLint GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: glcorearb.h:2773
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:3126
ImGuiIO::DeltaTime
float DeltaTime
Definition: imgui.h:1423
ImGuiMouseCursor
int ImGuiMouseCursor
Definition: imgui.h:150
ImDrawVert::pos
ImVec2 pos
Definition: imgui.h:1895
ImGuiMouseCursor_ResizeNS
@ ImGuiMouseCursor_ResizeNS
Definition: imgui.h:1248
g_Time
static double g_Time
Definition: imgui_impl_allegro5.cpp:55
ImGuiIO::BackendFlags
ImGuiBackendFlags BackendFlags
Definition: imgui.h:1421
ImGuiConfigFlags_NoMouseCursorChange
@ ImGuiConfigFlags_NoMouseCursorChange
Definition: imgui.h:1066
ImGuiKey_Tab
@ ImGuiKey_Tab
Definition: imgui.h:987
h
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:4147
ImVec2::y
float y
Definition: imgui.h:210
width
GLint GLsizei width
Definition: glcorearb.h:2768
ImGuiIO::SetClipboardTextFn
void(* SetClipboardTextFn)(void *user_data, const char *text)
Definition: imgui.h:1464
ImDrawCmd::ElemCount
unsigned int ElemCount
Definition: imgui.h:1873
ImFontAtlas::GetTexDataAsRGBA32
IMGUI_API void GetTexDataAsRGBA32(unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
Definition: imgui_draw.cpp:1679
ImGuiKey_V
@ ImGuiKey_V
Definition: imgui.h:1005


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:54