imgui_impl_sdl.cpp
Go to the documentation of this file.
1 // dear imgui: Platform Binding for SDL2
2 // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
3 // (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.)
4 // (Requires: SDL 2.0. Prefer SDL 2.0.4+ for full feature support.)
5 
6 // Implemented features:
7 // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
8 // [X] Platform: Clipboard support.
9 // [X] Platform: Keyboard arrays indexed using SDL_SCANCODE_* codes, e.g. ImGui::IsKeyPressed(SDL_SCANCODE_SPACE).
10 // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
11 // Missing features:
12 // [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME.
13 
14 // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
15 // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp.
16 // https://github.com/ocornut/imgui
17 
18 // CHANGELOG
19 // (minor and older changes stripped away, please see git history for details)
20 // 2020-02-20: Inputs: Fixed mapping for ImGuiKey_KeyPadEnter (using SDL_SCANCODE_KP_ENTER instead of SDL_SCANCODE_RETURN2).
21 // 2019-12-17: Inputs: On Wayland, use SDL_GetMouseState (because there is no global mouse state).
22 // 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
23 // 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
24 // 2019-04-23: Inputs: Added support for SDL_GameController (if ImGuiConfigFlags_NavEnableGamepad is set by user application).
25 // 2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is minimized.
26 // 2018-12-21: Inputs: Workaround for Android/iOS which don't seem to handle focus related calls.
27 // 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window.
28 // 2018-11-14: Changed the signature of ImGui_ImplSDL2_ProcessEvent() to take a 'const SDL_Event*'.
29 // 2018-08-01: Inputs: Workaround for Emscripten which doesn't seem to handle focus related calls.
30 // 2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor.
31 // 2018-06-08: Misc: Extracted imgui_impl_sdl.cpp/.h away from the old combined SDL2+OpenGL/Vulkan examples.
32 // 2018-06-08: Misc: ImGui_ImplSDL2_InitForOpenGL() now takes a SDL_GLContext parameter.
33 // 2018-05-09: Misc: Fixed clipboard paste memory leak (we didn't call SDL_FreeMemory on the data returned by SDL_GetClipboardText).
34 // 2018-03-20: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors flag + honor ImGuiConfigFlags_NoMouseCursorChange flag.
35 // 2018-02-16: Inputs: Added support for mouse cursors, honoring ImGui::GetMouseCursor() value.
36 // 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
37 // 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
38 // 2018-02-05: Misc: Using SDL_GetPerformanceCounter() instead of SDL_GetTicks() to be able to handle very high framerate (1000+ FPS).
39 // 2018-02-05: Inputs: Keyboard mapping is using scancodes everywhere instead of a confusing mixture of keycodes and scancodes.
40 // 2018-01-20: Inputs: Added Horizontal Mouse Wheel support.
41 // 2018-01-19: Inputs: When available (SDL 2.0.4+) using SDL_CaptureMouse() to retrieve coordinates outside of client area when dragging. Otherwise (SDL 2.0.3 and before) testing for SDL_WINDOW_INPUT_FOCUS instead of SDL_WINDOW_MOUSE_FOCUS.
42 // 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert.
43 // 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).
44 // 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
45 
46 #include "imgui.h"
47 #include "imgui_impl_sdl.h"
48 
49 // SDL
50 #include <SDL.h>
51 #include <SDL_syswm.h>
52 #if defined(__APPLE__)
53 #include "TargetConditionals.h"
54 #endif
55 
56 #define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE SDL_VERSION_ATLEAST(2,0,4)
57 #define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
58 
59 // Data
60 static SDL_Window* g_Window = NULL;
61 static Uint64 g_Time = 0;
62 static bool g_MousePressed[3] = { false, false, false };
63 static SDL_Cursor* g_MouseCursors[ImGuiMouseCursor_COUNT] = {};
64 static char* g_ClipboardTextData = NULL;
65 static bool g_MouseCanUseGlobalState = true;
66 
67 static const char* ImGui_ImplSDL2_GetClipboardText(void*)
68 {
70  SDL_free(g_ClipboardTextData);
71  g_ClipboardTextData = SDL_GetClipboardText();
72  return g_ClipboardTextData;
73 }
74 
75 static void ImGui_ImplSDL2_SetClipboardText(void*, const char* text)
76 {
77  SDL_SetClipboardText(text);
78 }
79 
80 // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
81 // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
82 // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
83 // Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
84 // If you have multiple SDL events and some of them are not meant to be used by dear imgui, you may need to filter events based on their windowID field.
86 {
87  ImGuiIO& io = ImGui::GetIO();
88  switch (event->type)
89  {
90  case SDL_MOUSEWHEEL:
91  {
92  if (event->wheel.x > 0) io.MouseWheelH += 1;
93  if (event->wheel.x < 0) io.MouseWheelH -= 1;
94  if (event->wheel.y > 0) io.MouseWheel += 1;
95  if (event->wheel.y < 0) io.MouseWheel -= 1;
96  return true;
97  }
98  case SDL_MOUSEBUTTONDOWN:
99  {
100  if (event->button.button == SDL_BUTTON_LEFT) g_MousePressed[0] = true;
101  if (event->button.button == SDL_BUTTON_RIGHT) g_MousePressed[1] = true;
102  if (event->button.button == SDL_BUTTON_MIDDLE) g_MousePressed[2] = true;
103  return true;
104  }
105  case SDL_TEXTINPUT:
106  {
107  io.AddInputCharactersUTF8(event->text.text);
108  return true;
109  }
110  case SDL_KEYDOWN:
111  case SDL_KEYUP:
112  {
113  int key = event->key.keysym.scancode;
114  IM_ASSERT(key >= 0 && key < IM_ARRAYSIZE(io.KeysDown));
115  io.KeysDown[key] = (event->type == SDL_KEYDOWN);
116  io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
117  io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
118  io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
119 #ifdef _WIN32
120  io.KeySuper = false;
121 #else
122  io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
123 #endif
124  return true;
125  }
126  }
127  return false;
128 }
129 
130 static bool ImGui_ImplSDL2_Init(SDL_Window* window)
131 {
132  g_Window = window;
133 
134  // Setup back-end capabilities flags
135  ImGuiIO& io = ImGui::GetIO();
136  io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
137  io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
138  io.BackendPlatformName = "imgui_impl_sdl";
139 
140  // Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
141  io.KeyMap[ImGuiKey_Tab] = SDL_SCANCODE_TAB;
142  io.KeyMap[ImGuiKey_LeftArrow] = SDL_SCANCODE_LEFT;
143  io.KeyMap[ImGuiKey_RightArrow] = SDL_SCANCODE_RIGHT;
144  io.KeyMap[ImGuiKey_UpArrow] = SDL_SCANCODE_UP;
145  io.KeyMap[ImGuiKey_DownArrow] = SDL_SCANCODE_DOWN;
146  io.KeyMap[ImGuiKey_PageUp] = SDL_SCANCODE_PAGEUP;
147  io.KeyMap[ImGuiKey_PageDown] = SDL_SCANCODE_PAGEDOWN;
148  io.KeyMap[ImGuiKey_Home] = SDL_SCANCODE_HOME;
149  io.KeyMap[ImGuiKey_End] = SDL_SCANCODE_END;
150  io.KeyMap[ImGuiKey_Insert] = SDL_SCANCODE_INSERT;
151  io.KeyMap[ImGuiKey_Delete] = SDL_SCANCODE_DELETE;
152  io.KeyMap[ImGuiKey_Backspace] = SDL_SCANCODE_BACKSPACE;
153  io.KeyMap[ImGuiKey_Space] = SDL_SCANCODE_SPACE;
154  io.KeyMap[ImGuiKey_Enter] = SDL_SCANCODE_RETURN;
155  io.KeyMap[ImGuiKey_Escape] = SDL_SCANCODE_ESCAPE;
156  io.KeyMap[ImGuiKey_KeyPadEnter] = SDL_SCANCODE_KP_ENTER;
157  io.KeyMap[ImGuiKey_A] = SDL_SCANCODE_A;
158  io.KeyMap[ImGuiKey_C] = SDL_SCANCODE_C;
159  io.KeyMap[ImGuiKey_V] = SDL_SCANCODE_V;
160  io.KeyMap[ImGuiKey_X] = SDL_SCANCODE_X;
161  io.KeyMap[ImGuiKey_Y] = SDL_SCANCODE_Y;
162  io.KeyMap[ImGuiKey_Z] = SDL_SCANCODE_Z;
163 
166  io.ClipboardUserData = NULL;
167 
168  // Load mouse cursors
169  g_MouseCursors[ImGuiMouseCursor_Arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
170  g_MouseCursors[ImGuiMouseCursor_TextInput] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM);
171  g_MouseCursors[ImGuiMouseCursor_ResizeAll] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL);
172  g_MouseCursors[ImGuiMouseCursor_ResizeNS] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS);
173  g_MouseCursors[ImGuiMouseCursor_ResizeEW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE);
174  g_MouseCursors[ImGuiMouseCursor_ResizeNESW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW);
175  g_MouseCursors[ImGuiMouseCursor_ResizeNWSE] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE);
176  g_MouseCursors[ImGuiMouseCursor_Hand] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);
177  g_MouseCursors[ImGuiMouseCursor_NotAllowed] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO);
178 
179  // Check and store if we are on Wayland
180  g_MouseCanUseGlobalState = strncmp(SDL_GetCurrentVideoDriver(), "wayland", 7) != 0;
181 
182 #ifdef _WIN32
183  SDL_SysWMinfo wmInfo;
184  SDL_VERSION(&wmInfo.version);
185  SDL_GetWindowWMInfo(window, &wmInfo);
186  io.ImeWindowHandle = wmInfo.info.win.window;
187 #else
188  (void)window;
189 #endif
190 
191  return true;
192 }
193 
194 bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context)
195 {
196  (void)sdl_gl_context; // Viewport branch will need this.
197  return ImGui_ImplSDL2_Init(window);
198 }
199 
200 bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
201 {
202 #if !SDL_HAS_VULKAN
203  IM_ASSERT(0 && "Unsupported");
204 #endif
205  return ImGui_ImplSDL2_Init(window);
206 }
207 
208 bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)
209 {
210 #if !defined(_WIN32)
211  IM_ASSERT(0 && "Unsupported");
212 #endif
213  return ImGui_ImplSDL2_Init(window);
214 }
215 
216 bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window)
217 {
218  return ImGui_ImplSDL2_Init(window);
219 }
220 
222 {
223  g_Window = NULL;
224 
225  // Destroy last known clipboard data
227  SDL_free(g_ClipboardTextData);
229 
230  // Destroy SDL mouse cursors
231  for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
232  SDL_FreeCursor(g_MouseCursors[cursor_n]);
233  memset(g_MouseCursors, 0, sizeof(g_MouseCursors));
234 }
235 
237 {
238  ImGuiIO& io = ImGui::GetIO();
239 
240  // Set OS mouse position if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user)
241  if (io.WantSetMousePos)
242  SDL_WarpMouseInWindow(g_Window, (int)io.MousePos.x, (int)io.MousePos.y);
243  else
244  io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
245 
246  int mx, my;
247  Uint32 mouse_buttons = SDL_GetMouseState(&mx, &my);
248  io.MouseDown[0] = g_MousePressed[0] || (mouse_buttons & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0; // If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
249  io.MouseDown[1] = g_MousePressed[1] || (mouse_buttons & SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0;
250  io.MouseDown[2] = g_MousePressed[2] || (mouse_buttons & SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0;
251  g_MousePressed[0] = g_MousePressed[1] = g_MousePressed[2] = false;
252 
253 #if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) && !(defined(__APPLE__) && TARGET_OS_IOS)
254  SDL_Window* focused_window = SDL_GetKeyboardFocus();
255  if (g_Window == focused_window)
256  {
258  {
259  // SDL_GetMouseState() gives mouse position seemingly based on the last window entered/focused(?)
260  // The creation of a new windows at runtime and SDL_CaptureMouse both seems to severely mess up with that, so we retrieve that position globally.
261  // Won't use this workaround when on Wayland, as there is no global mouse position.
262  int wx, wy;
263  SDL_GetWindowPosition(focused_window, &wx, &wy);
264  SDL_GetGlobalMouseState(&mx, &my);
265  mx -= wx;
266  my -= wy;
267  }
268  io.MousePos = ImVec2((float)mx, (float)my);
269  }
270 
271  // SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger the OS window resize cursor.
272  // The function is only supported from SDL 2.0.4 (released Jan 2016)
273  bool any_mouse_button_down = ImGui::IsAnyMouseDown();
274  SDL_CaptureMouse(any_mouse_button_down ? SDL_TRUE : SDL_FALSE);
275 #else
276  if (SDL_GetWindowFlags(g_Window) & SDL_WINDOW_INPUT_FOCUS)
277  io.MousePos = ImVec2((float)mx, (float)my);
278 #endif
279 }
280 
282 {
283  ImGuiIO& io = ImGui::GetIO();
285  return;
286 
287  ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
288  if (io.MouseDrawCursor || imgui_cursor == ImGuiMouseCursor_None)
289  {
290  // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
291  SDL_ShowCursor(SDL_FALSE);
292  }
293  else
294  {
295  // Show OS mouse cursor
296  SDL_SetCursor(g_MouseCursors[imgui_cursor] ? g_MouseCursors[imgui_cursor] : g_MouseCursors[ImGuiMouseCursor_Arrow]);
297  SDL_ShowCursor(SDL_TRUE);
298  }
299 }
300 
302 {
303  ImGuiIO& io = ImGui::GetIO();
304  memset(io.NavInputs, 0, sizeof(io.NavInputs));
306  return;
307 
308  // Get gamepad
309  SDL_GameController* game_controller = SDL_GameControllerOpen(0);
310  if (!game_controller)
311  {
313  return;
314  }
315 
316  // Update gamepad inputs
317  #define MAP_BUTTON(NAV_NO, BUTTON_NO) { io.NavInputs[NAV_NO] = (SDL_GameControllerGetButton(game_controller, BUTTON_NO) != 0) ? 1.0f : 0.0f; }
318  #define MAP_ANALOG(NAV_NO, AXIS_NO, V0, V1) { float vn = (float)(SDL_GameControllerGetAxis(game_controller, AXIS_NO) - V0) / (float)(V1 - V0); if (vn > 1.0f) vn = 1.0f; if (vn > 0.0f && io.NavInputs[NAV_NO] < vn) io.NavInputs[NAV_NO] = vn; }
319  const int thumb_dead_zone = 8000; // SDL_gamecontroller.h suggests using this value.
320  MAP_BUTTON(ImGuiNavInput_Activate, SDL_CONTROLLER_BUTTON_A); // Cross / A
321  MAP_BUTTON(ImGuiNavInput_Cancel, SDL_CONTROLLER_BUTTON_B); // Circle / B
322  MAP_BUTTON(ImGuiNavInput_Menu, SDL_CONTROLLER_BUTTON_X); // Square / X
323  MAP_BUTTON(ImGuiNavInput_Input, SDL_CONTROLLER_BUTTON_Y); // Triangle / Y
324  MAP_BUTTON(ImGuiNavInput_DpadLeft, SDL_CONTROLLER_BUTTON_DPAD_LEFT); // D-Pad Left
325  MAP_BUTTON(ImGuiNavInput_DpadRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT); // D-Pad Right
326  MAP_BUTTON(ImGuiNavInput_DpadUp, SDL_CONTROLLER_BUTTON_DPAD_UP); // D-Pad Up
327  MAP_BUTTON(ImGuiNavInput_DpadDown, SDL_CONTROLLER_BUTTON_DPAD_DOWN); // D-Pad Down
328  MAP_BUTTON(ImGuiNavInput_FocusPrev, SDL_CONTROLLER_BUTTON_LEFTSHOULDER); // L1 / LB
329  MAP_BUTTON(ImGuiNavInput_FocusNext, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); // R1 / RB
330  MAP_BUTTON(ImGuiNavInput_TweakSlow, SDL_CONTROLLER_BUTTON_LEFTSHOULDER); // L1 / LB
331  MAP_BUTTON(ImGuiNavInput_TweakFast, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); // R1 / RB
332  MAP_ANALOG(ImGuiNavInput_LStickLeft, SDL_CONTROLLER_AXIS_LEFTX, -thumb_dead_zone, -32768);
333  MAP_ANALOG(ImGuiNavInput_LStickRight, SDL_CONTROLLER_AXIS_LEFTX, +thumb_dead_zone, +32767);
334  MAP_ANALOG(ImGuiNavInput_LStickUp, SDL_CONTROLLER_AXIS_LEFTY, -thumb_dead_zone, -32767);
335  MAP_ANALOG(ImGuiNavInput_LStickDown, SDL_CONTROLLER_AXIS_LEFTY, +thumb_dead_zone, +32767);
336 
338  #undef MAP_BUTTON
339  #undef MAP_ANALOG
340 }
341 
342 void ImGui_ImplSDL2_NewFrame(SDL_Window* window)
343 {
344  ImGuiIO& io = ImGui::GetIO();
345  IM_ASSERT(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
346 
347  // Setup display size (every frame to accommodate for window resizing)
348  int w, h;
349  int display_w, display_h;
350  SDL_GetWindowSize(window, &w, &h);
351  SDL_GL_GetDrawableSize(window, &display_w, &display_h);
352  io.DisplaySize = ImVec2((float)w, (float)h);
353  if (w > 0 && h > 0)
354  io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
355 
356  // Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)
357  static Uint64 frequency = SDL_GetPerformanceFrequency();
358  Uint64 current_time = SDL_GetPerformanceCounter();
359  io.DeltaTime = g_Time > 0 ? (float)((double)(current_time - g_Time) / frequency) : (float)(1.0f / 60.0f);
360  g_Time = current_time;
361 
364 
365  // Update game controllers (if enabled and available)
367 }
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
ImGuiIO::KeySuper
bool KeySuper
Definition: imgui.h:1492
ImGuiIO::KeyCtrl
bool KeyCtrl
Definition: imgui.h:1489
ImGuiIO::Fonts
ImFontAtlas * Fonts
Definition: imgui.h:1435
SDL_Event
union SDL_Event SDL_Event
Definition: imgui_impl_sdl.h:20
ImGuiKey_PageUp
@ ImGuiKey_PageUp
Definition: imgui.h:992
ImGuiNavInput_FocusNext
@ ImGuiNavInput_FocusNext
Definition: imgui.h:1042
NULL
NULL
Definition: test_security_zap.cpp:405
ImGuiConfigFlags_NavEnableGamepad
@ ImGuiConfigFlags_NavEnableGamepad
Definition: imgui.h:1062
imgui_impl_sdl.h
ImGuiIO::KeyShift
bool KeyShift
Definition: imgui.h:1490
MAP_BUTTON
#define MAP_BUTTON(NAV_NO, BUTTON_NO)
ImGuiNavInput_TweakSlow
@ ImGuiNavInput_TweakSlow
Definition: imgui.h:1043
ImGuiNavInput_TweakFast
@ ImGuiNavInput_TweakFast
Definition: imgui.h:1044
ImGuiIO::DisplayFramebufferScale
ImVec2 DisplayFramebufferScale
Definition: imgui.h:1439
ImGuiNavInput_Activate
@ ImGuiNavInput_Activate
Definition: imgui.h:1029
ImGuiNavInput_Cancel
@ ImGuiNavInput_Cancel
Definition: imgui.h:1030
ImGuiKey_Enter
@ ImGuiKey_Enter
Definition: imgui.h:1000
ImGuiKey_Delete
@ ImGuiKey_Delete
Definition: imgui.h:997
g_MousePressed
static bool g_MousePressed[3]
Definition: imgui_impl_sdl.cpp:62
ImGuiKey_X
@ ImGuiKey_X
Definition: imgui.h:1006
ImGui_ImplSDL2_ProcessEvent
bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event *event)
Definition: imgui_impl_sdl.cpp:85
ImGuiKey_RightArrow
@ ImGuiKey_RightArrow
Definition: imgui.h:989
ImGuiIO::ImeWindowHandle
void * ImeWindowHandle
Definition: imgui.h:1470
ImGui_ImplSDL2_InitForD3D
bool ImGui_ImplSDL2_InitForD3D(SDL_Window *window)
Definition: imgui_impl_sdl.cpp:208
ImGuiMouseCursor_None
@ ImGuiMouseCursor_None
Definition: imgui.h:1244
imgui.h
ImGuiIO::NavInputs
float NavInputs[ImGuiNavInput_COUNT]
Definition: imgui.h:1494
ImGuiKey_Space
@ ImGuiKey_Space
Definition: imgui.h:999
MAP_ANALOG
#define MAP_ANALOG(NAV_NO, AXIS_NO, V0, V1)
ImGuiIO::ClipboardUserData
void * ClipboardUserData
Definition: imgui.h:1465
ImGuiIO::GetClipboardTextFn
const char *(* GetClipboardTextFn)(void *user_data)
Definition: imgui.h:1463
ImGui_ImplSDL2_NewFrame
void ImGui_ImplSDL2_NewFrame(SDL_Window *window)
Definition: imgui_impl_sdl.cpp:342
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
ImGui_ImplSDL2_InitForOpenGL
bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window *window, void *sdl_gl_context)
Definition: imgui_impl_sdl.cpp:194
ImGui::GetMouseCursor
IMGUI_API ImGuiMouseCursor GetMouseCursor()
Definition: imgui.cpp:4543
ImGuiIO::WantSetMousePos
bool WantSetMousePos
Definition: imgui.h:1509
ImGui_ImplSDL2_UpdateMouseCursor
static void ImGui_ImplSDL2_UpdateMouseCursor()
Definition: imgui_impl_sdl.cpp:281
ImGuiNavInput_LStickLeft
@ ImGuiNavInput_LStickLeft
Definition: imgui.h:1037
ImGuiKey_A
@ ImGuiKey_A
Definition: imgui.h:1003
ImGuiKey_Home
@ ImGuiKey_Home
Definition: imgui.h:994
ImGuiBackendFlags_HasMouseCursors
@ ImGuiBackendFlags_HasMouseCursors
Definition: imgui.h:1078
ImGuiIO::MouseDown
bool MouseDown[5]
Definition: imgui.h:1486
ImGui_ImplSDL2_UpdateMousePosAndButtons
static void ImGui_ImplSDL2_UpdateMousePosAndButtons()
Definition: imgui_impl_sdl.cpp:236
ImGuiMouseCursor_NotAllowed
@ ImGuiMouseCursor_NotAllowed
Definition: imgui.h:1253
ImGuiIO::AddInputCharactersUTF8
IMGUI_API void AddInputCharactersUTF8(const char *str)
Definition: imgui.cpp:1161
event
struct _cl_event * event
Definition: glcorearb.h:4163
ImGuiIO::ConfigFlags
ImGuiConfigFlags ConfigFlags
Definition: imgui.h:1420
ImGuiNavInput_FocusPrev
@ ImGuiNavInput_FocusPrev
Definition: imgui.h:1041
ImGuiNavInput_DpadLeft
@ ImGuiNavInput_DpadLeft
Definition: imgui.h:1033
ImGuiKey_Y
@ ImGuiKey_Y
Definition: imgui.h:1007
ImGuiKey_DownArrow
@ ImGuiKey_DownArrow
Definition: imgui.h:991
ImGuiNavInput_DpadDown
@ ImGuiNavInput_DpadDown
Definition: imgui.h:1036
ImGuiBackendFlags_HasSetMousePos
@ ImGuiBackendFlags_HasSetMousePos
Definition: imgui.h:1079
ImVec2::x
float x
Definition: imgui.h:210
ImGuiKey_KeyPadEnter
@ ImGuiKey_KeyPadEnter
Definition: imgui.h:1002
ImGuiIO::MouseWheel
float MouseWheel
Definition: imgui.h:1487
ImGuiKey_LeftArrow
@ ImGuiKey_LeftArrow
Definition: imgui.h:988
IM_ARRAYSIZE
#define IM_ARRAYSIZE(_ARR)
Definition: imgui.h:88
ImGuiMouseCursor_ResizeAll
@ ImGuiMouseCursor_ResizeAll
Definition: imgui.h:1247
g_Time
static Uint64 g_Time
Definition: imgui_impl_sdl.cpp:61
g_MouseCursors
static SDL_Cursor * g_MouseCursors[ImGuiMouseCursor_COUNT]
Definition: imgui_impl_sdl.cpp:63
ImGui_ImplSDL2_GetClipboardText
static const char * ImGui_ImplSDL2_GetClipboardText(void *)
Definition: imgui_impl_sdl.cpp:67
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
ImGui_ImplSDL2_Shutdown
void ImGui_ImplSDL2_Shutdown()
Definition: imgui_impl_sdl.cpp:221
ImGuiNavInput_LStickUp
@ ImGuiNavInput_LStickUp
Definition: imgui.h:1039
ImGuiKey_PageDown
@ ImGuiKey_PageDown
Definition: imgui.h:993
void
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
ImGuiKey_C
@ ImGuiKey_C
Definition: imgui.h:1004
ImGuiMouseCursor_COUNT
@ ImGuiMouseCursor_COUNT
Definition: imgui.h:1254
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
ImFontAtlas::IsBuilt
bool IsBuilt() const
Definition: imgui.h:2205
ImGuiIO::MousePos
ImVec2 MousePos
Definition: imgui.h:1485
ImGuiMouseCursor_Hand
@ ImGuiMouseCursor_Hand
Definition: imgui.h:1252
ImGui_ImplSDL2_InitForMetal
bool ImGui_ImplSDL2_InitForMetal(SDL_Window *window)
Definition: imgui_impl_sdl.cpp:216
ImGui_ImplSDL2_InitForVulkan
bool ImGui_ImplSDL2_InitForVulkan(SDL_Window *window)
Definition: imgui_impl_sdl.cpp:200
ImGuiIO::DisplaySize
ImVec2 DisplaySize
Definition: imgui.h:1422
ImGuiMouseCursor_ResizeNESW
@ ImGuiMouseCursor_ResizeNESW
Definition: imgui.h:1250
ImGuiMouseCursor_TextInput
@ ImGuiMouseCursor_TextInput
Definition: imgui.h:1246
ImGui::IsAnyMouseDown
IMGUI_API bool IsAnyMouseDown()
Definition: imgui.cpp:4510
ImGuiNavInput_Menu
@ ImGuiNavInput_Menu
Definition: imgui.h:1032
ImGuiNavInput_Input
@ ImGuiNavInput_Input
Definition: imgui.h:1031
g_Window
static SDL_Window * g_Window
Definition: imgui_impl_sdl.cpp:60
ImGuiIO
Definition: imgui.h:1414
ImGuiIO::MouseWheelH
float MouseWheelH
Definition: imgui.h:1488
ImGuiKey_Backspace
@ ImGuiKey_Backspace
Definition: imgui.h:998
ImGui_ImplSDL2_UpdateGamepads
static void ImGui_ImplSDL2_UpdateGamepads()
Definition: imgui_impl_sdl.cpp:301
ImGuiNavInput_LStickDown
@ ImGuiNavInput_LStickDown
Definition: imgui.h:1040
IM_ASSERT
#define IM_ASSERT(_EXPR)
Definition: imgui.h:79
ImGuiIO::KeysDown
bool KeysDown[512]
Definition: imgui.h:1493
ImGuiKey_UpArrow
@ ImGuiKey_UpArrow
Definition: imgui.h:990
ImGui_ImplSDL2_SetClipboardText
static void ImGui_ImplSDL2_SetClipboardText(void *, const char *text)
Definition: imgui_impl_sdl.cpp:75
f
GLfloat f
Definition: glcorearb.h:3964
ImGuiKey_Insert
@ ImGuiKey_Insert
Definition: imgui.h:996
ImGuiNavInput_LStickRight
@ ImGuiNavInput_LStickRight
Definition: imgui.h:1038
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
ImGuiNavInput_DpadUp
@ ImGuiNavInput_DpadUp
Definition: imgui.h:1035
g_MouseCanUseGlobalState
static bool g_MouseCanUseGlobalState
Definition: imgui_impl_sdl.cpp:65
ImGuiMouseCursor_ResizeNS
@ ImGuiMouseCursor_ResizeNS
Definition: imgui.h:1248
ImGuiMouseCursor_Arrow
@ ImGuiMouseCursor_Arrow
Definition: imgui.h:1245
ImGuiIO::BackendFlags
ImGuiBackendFlags BackendFlags
Definition: imgui.h:1421
ImGui_ImplSDL2_Init
static bool ImGui_ImplSDL2_Init(SDL_Window *window)
Definition: imgui_impl_sdl.cpp:130
ImGuiConfigFlags_NoMouseCursorChange
@ ImGuiConfigFlags_NoMouseCursorChange
Definition: imgui.h:1066
ImGuiBackendFlags_HasGamepad
@ ImGuiBackendFlags_HasGamepad
Definition: imgui.h:1077
ImGuiNavInput_DpadRight
@ ImGuiNavInput_DpadRight
Definition: imgui.h:1034
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
ImGuiIO::SetClipboardTextFn
void(* SetClipboardTextFn)(void *user_data, const char *text)
Definition: imgui.h:1464
g_ClipboardTextData
static char * g_ClipboardTextData
Definition: imgui_impl_sdl.cpp:64
ImGuiKey_V
@ ImGuiKey_V
Definition: imgui.h:1005


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