Debian Codegraph @

extern/imgui_patched/docs/FAQ.md

raw
1 # FAQ (Frequently Asked Questions)
2
3 You may link to this document using short form:
4 https://www.dearimgui.com/faq
5 or its real address:
6 https://github.com/ocornut/imgui/blob/master/docs/FAQ.md
7 or view this file with any Markdown viewer.
8
9
10 ## Index
11
12 | **Q&A: Basics** |
13 :---------------------------------------------------------- |
14 | [Where is the documentation?](#q-where-is-the-documentation) |
15 | [What is this library called?](#q-what-is-this-library-called) |
16 | [Which version should I get?](#q-which-version-should-i-get) |
17 | **Q&A: Integration** |
18 | **[How to get started?](#q-how-to-get-started)** |
19 | **[How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?](#q-how-can-i-tell-whether-to-dispatch-mousekeyboard-to-dear-imgui-or-my-application)** |
20 | [How can I enable keyboard or gamepad controls?](#q-how-can-i-enable-keyboard-or-gamepad-controls) |
21 | [How can I use this on a machine without mouse, keyboard or screen? (input share, remote display)](#q-how-can-i-use-this-on-a-machine-without-mouse-keyboard-or-screen-input-share-remote-display) |
22 | [How can I create my own backend?](q-how-can-i-create-my-own-backend)
23 | [I integrated Dear ImGui in my engine and little squares are showing instead of text...](#q-i-integrated-dear-imgui-in-my-engine-and-little-squares-are-showing-instead-of-text) |
24 | [I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-clipping-or-disappearing-when-i-move-windows-around) |
25 | [I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-displaying-outside-their-expected-windows-boundaries) |
26 | **Q&A: Usage** |
27 | **[About the ID Stack system..<br>Why is my widget not reacting when I click on it?<br>Why is the wrong widget reacting when I click on one?<br>How can I have widgets with an empty label?<br>How can I have multiple widgets with the same label?<br>How can I have multiple windows with the same label?](#q-about-the-id-stack-system)** |
28 | [How can I display an image?](#q-how-can-i-display-an-image)<br>[What are ImTextureID/ImTextureRef?](#q-what-are-imtextureidimtextureref)|
29 | [How can I use maths operators with ImVec2?](#q-how-can-i-use-maths-operators-with-imvec2) |
30 | [How can I use my own maths types instead of ImVec2/ImVec4?](#q-how-can-i-use-my-own-maths-types-instead-of-imvec2imvec4) |
31 | [How can I interact with standard C++ types (such as std::string and std::vector)?](#q-how-can-i-interact-with-standard-c-types-such-as-stdstring-and-stdvector) |
32 | [How can I display custom shapes? (using low-level ImDrawList API)](#q-how-can-i-display-custom-shapes-using-low-level-imdrawlist-api) |
33 | **Q&A: Fonts, Text** |
34 | [How should I handle DPI in my application?](#q-how-should-i-handle-dpi-in-my-application) |
35 | [How can I load a different font than the default?](#q-how-can-i-load-a-different-font-than-the-default) |
36 | [How can I easily use icons in my application?](#q-how-can-i-easily-use-icons-in-my-application) |
37 | [How can I load multiple fonts?](#q-how-can-i-load-multiple-fonts) |
38 | [How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?](#q-how-can-i-display-and-input-non-latin-characters-such-as-chinese-japanese-korean-cyrillic) |
39 | **Q&A: Concerns** |
40 | [Who uses Dear ImGui?](#q-who-uses-dear-imgui) |
41 | [Can you create elaborate/serious tools with Dear ImGui?](#q-can-you-create-elaborateserious-tools-with-dear-imgui) |
42 | [Can you reskin the look of Dear ImGui?](#q-can-you-reskin-the-look-of-dear-imgui) |
43 | [Why using C++ (as opposed to C)?](#q-why-using-c-as-opposed-to-c) |
44 | **Q&A: Community** |
45 | [How can I help?](#q-how-can-i-help) |
46
47
48 # Q&A: Basics
49
50 ### Q: Where is the documentation?
51
52 **This library is poorly documented at the moment and expects the user to be acquainted with C/C++.**
53 - The [Wiki](https://github.com/ocornut/imgui/wiki) is a hub to many resources and links.
54 - Handy [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started) guide to integrate Dear ImGui in an existing application.
55 - 20+ standalone example applications using e.g. OpenGL/DirectX are provided in the [examples/](https://github.com/ocornut/imgui/blob/master/examples/) folder to explain how to integrate Dear ImGui with your own engine/application. You can run those applications and explore them.
56 - See demo code in [imgui_demo.cpp](https://github.com/ocornut/imgui/blob/master/imgui_demo.cpp) and particularly the `ImGui::ShowDemoWindow()` function. The demo covers most features of Dear ImGui, so you can read the code and see its output.
57 - See documentation: [Backends](https://github.com/ocornut/imgui/blob/master/docs/BACKENDS.md), [Examples](https://github.com/ocornut/imgui/blob/master/docs/EXAMPLES.md), [Fonts](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md).
58 - See documentation and comments at the top of [imgui.cpp](https://github.com/ocornut/imgui/blob/master/imgui.cpp) + general API comments in [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h).
59 - The [Glossary](https://github.com/ocornut/imgui/wiki/Glossary) page may be useful.
60 - The [Issues](https://github.com/ocornut/imgui/issues) and [Discussions](https://github.com/ocornut/imgui/discussions) sections can be searched for past questions and issues.
61 - Your programming IDE is your friend, find the type or function declaration to find comments associated with it.
62 - The `ImGui::ShowMetricsWindow()` function exposes lots of internal information and tools. Although it is primarily designed as a debugging tool, having access to that information tends to help understands concepts.
63
64 ##### [Return to Index](#index)
65
66 ---
67
68 ### Q. What is this library called?
69
70 **This library is called Dear ImGui**. Please refer to it as Dear ImGui (not ImGui, not IMGUI).
71
72 (The library misleadingly started its life in 2014 as "ImGui" due to the fact that I didn't give it a proper name when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI (immediate-mode graphical user interface) was coined before and is being used in variety of other situations e.g. Unity uses it own implementation of the IMGUI paradigm. To reduce the ambiguity without affecting existing code bases, I have decided in December 2015 a fully qualified name "Dear ImGui" for this library.
73
74 ##### [Return to Index](#index)
75
76 ---
77
78 ### Q: Which version should I get?
79 I occasionally tag [Releases](https://github.com/ocornut/imgui/releases) but it is generally safe and recommended to sync to master/latest. The library is fairly stable and regressions tend to be fixed fast when reported.
80
81 You may use the ['docking'](https://github.com/ocornut/imgui/tree/docking) branch which includes:
82 - [Docking features](https://github.com/ocornut/imgui/wiki/Docking)
83 - [Multi-viewport features](https://github.com/ocornut/imgui/wiki/Multi-Viewports)
84
85 Many projects are using this branch and it is kept in sync with master regularly.
86
87 ##### [Return to Index](#index)
88
89 ----
90
91 # Q&A: Integration
92
93 ### Q: How to get started?
94
95 Read [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started). <BR>
96 Read [docs/EXAMPLES.md](https://github.com/ocornut/imgui/blob/master/docs/EXAMPLES.md). <BR>
97 Read [docs/BACKENDS.md](https://github.com/ocornut/imgui/blob/master/docs/BACKENDS.md). <BR>
98 Read `PROGRAMMER GUIDE` section of [imgui.cpp](https://github.com/ocornut/imgui/blob/master/imgui.cpp). <BR>
99 The [Wiki](https://github.com/ocornut/imgui/wiki) is a hub to many resources and links.
100
101 For first-time users having issues compiling/linking/running or issues loading fonts, please use [GitHub Discussions](https://github.com/ocornut/imgui/discussions).
102
103 ##### [Return to Index](#index)
104
105 ---
106
107 ### Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?
108
109 You can read the `io.WantCaptureMouse`, `io.WantCaptureKeyboard` and `io.WantTextInput` flags from the ImGuiIO structure.
110 - When `io.WantCaptureMouse` is set, you need to discard/hide the mouse inputs from your underlying application.
111 - When `io.WantCaptureKeyboard` is set, you need to discard/hide the keyboard inputs from your underlying application.
112 - When `io.WantTextInput` is set, you can notify your OS/engine to popup an on-screen keyboard, if available (e.g. on a mobile phone, or console OS).
113
114 Important: you should always pass your mouse/keyboard inputs to Dear ImGui, regardless of the value `io.WantCaptureMouse`/`io.WantCaptureKeyboard`. This is because e.g. we need to detect that you clicked in the void to unfocus its own windows, and other reasons.
115
116 ```cpp
117 void MyLowLevelMouseButtonHandler(int button, bool down)
118 {
119 // (1) ALWAYS forward mouse data to ImGui! This is automatic with default backends. With your own backend:
120 ImGuiIO& io = ImGui::GetIO();
121 io.AddMouseButtonEvent(button, down);
122
123 // (2) ONLY forward mouse data to your underlying app/game.
124 if (!io.WantCaptureMouse)
125 my_game->HandleMouseData(...);
126 }
127 ```
128
129 **Note:** The `io.WantCaptureMouse` is more correct that any manual attempt to "check if the mouse is hovering a window" (don't do that!). It handles mouse dragging correctly (both dragging that started over your application or over a Dear ImGui window) and handle e.g. popup and modal windows blocking inputs.
130
131 **Note:** Text input widget releases focus on the "KeyDown" event of the Return key, so the subsequent "KeyUp" event that your application receive will typically have `io.WantCaptureKeyboard == false`. Depending on your application logic it may or not be inconvenient to receive that KeyUp event. You might want to track which key-downs were targeted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.)
132
133 ##### [Return to Index](#index)
134
135 ---
136
137 ### Q: How can I enable keyboard or gamepad controls?
138 - The gamepad/keyboard navigation is fairly functional and keeps being improved. The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. Gamepad support is particularly useful to use Dear ImGui on a game console (e.g. PS4, Switch, XB1) without a mouse connected!
139 - Keyboard: set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard` to enable.
140 - Gamepad: set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad` to enable (with a supporting backend).
141 - See [Control Sheets for Gamepads](https://www.dearimgui.com/controls_sheets) (reference PNG/PSD for PS4, XB1, Switch gamepads).
142 - See `USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS` section of [imgui.cpp](https://github.com/ocornut/imgui/blob/master/imgui.cpp) for more details.
143
144 ##### [Return to Index](#index)
145
146 ---
147
148 ### Q: How can I use this on a machine without mouse, keyboard or screen? (input share, remote display)
149 - You can share your computer mouse seamlessly with your console/tablet/phone using solutions such as [Synergy](https://symless.com/synergy)
150 This is the preferred solution for developer productivity.
151 In particular, the [micro-synergy-client repository](https://github.com/symless/micro-synergy-client) has simple
152 and portable source code (uSynergy.c/.h) for a small embeddable client that you can use on any platform to connect
153 to your host computer, based on the Synergy 1.x protocol. Make sure you download the Synergy 1 server on your computer.
154 Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-like protocols.
155 - Game console users: consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback.
156 - You may also use a third party solution such as [netImgui](https://github.com/sammyfreg/netImgui), [Remote ImGui](https://github.com/JordiRos/remoteimgui) or [imgui-ws](https://github.com/ggerganov/imgui-ws) which sends the vertices to render over the local network, allowing you to use Dear ImGui even on a screen-less machine. See [Wiki](https://github.com/ocornut/imgui/wiki) index for most details.
157 - For touch inputs, you can increase the hit box of widgets (via the `style.TouchPadding` setting) to accommodate for the lack of precision of touch inputs, but it is recommended you use a mouse or gamepad to allow optimizing for screen real-estate and precision.
158
159 ##### [Return to Index](#index)
160
161 ---
162
163 ### Q: How can I create my own backend?
164 - See [docs/BACKENDS.md](https://github.com/ocornut/imgui/blob/master/docs/BACKENDS.md).
165 - See Documentation at the top of imgui.cpp.
166
167 ##### [Return to Index](#index)
168
169 ---
170
171 ### Q: I integrated Dear ImGui in my engine and little squares are showing instead of text...
172 Your renderer backend is not using the font texture correctly or it hasn't been uploaded to the GPU.
173 - If this happens using standard backends (before 1.92): A) have you modified the font atlas after `ImGui_ImplXXX_NewFrame()`? B) maybe the texture failed to upload, which **can if your texture atlas is too big**. Also see [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md).
174 - If this happens using standard backends (after 1.92): please report.
175 - If this happens with a custom backend: make sure you have uploaded the font texture to the GPU, that all shaders are rendering states are setup properly (e.g. texture is bound). Compare your code to existing backends and use a graphics debugger such as [RenderDoc](https://renderdoc.org) to debug your rendering states.
176
177 ##### [Return to Index](#index)
178
179 ---
180
181 ### Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around...
182 ### Q: I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries...
183 You are probably mishandling the clipping rectangles in your render function.
184 Each draw command needs the triangle rendered using the clipping rectangle provided in the ImDrawCmd structure (`ImDrawCmd->CllipRect`).
185 Rectangles provided by Dear ImGui are defined as
186 `(x1=left,y1=top,x2=right,y2=bottom)`
187 and **NOT** as
188 `(x1,y1,width,height)`.
189 Refer to rendering backends in the [backends/](https://github.com/ocornut/imgui/tree/master/backends) folder for references of how to handle the `ClipRect` field.
190 For example, the [DirectX11 backend](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_dx11.cpp) does this:
191 ```cpp
192 // Project scissor/clipping rectangles into framebuffer space
193 ImVec2 clip_off = draw_data->DisplayPos;
194 ImVec2 clip_min(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y);
195 ImVec2 clip_max(pcmd->ClipRect.z - clip_off.x, pcmd->ClipRect.w - clip_off.y);
196 if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
197 continue;
198
199 // Apply scissor/clipping rectangle
200 const D3D11_RECT r = { (LONG)clip_min.x, (LONG)clip_min.y, (LONG)clip_max.x, (LONG)clip_max.y };
201 ctx->RSSetScissorRects(1, &r);
202 ```
203
204 ##### [Return to Index](#index)
205
206 ---
207
208 # Q&A: Usage
209
210 ### Q: About the ID Stack system...
211 ### Q: Why is my widget not reacting when I click on it?
212 ### Q: Why is the wrong widget reacting when I click on one?
213 ### Q: How can I have widgets with an empty label?
214 ### Q: How can I have multiple widgets with the same label?
215 ### Q: How can I have multiple windows with the same label?
216
217 **USING THE SAME LABEL+ID IS THE MOST COMMON USER MISTAKE!**
218 <br>**USING AN EMPTY LABEL IS THE SAME AS USING THE SAME LABEL AS YOUR PARENT WIDGET!**
219 <table>
220 <tr>
221 <td><img src="https://github.com/user-attachments/assets/776a8315-1164-4178-9a8c-df52e0ff28aa"></td>
222 <td>
223 <pre lang="cpp">
224 ImGui::Begin("Incorrect!");
225 ImGui::DragFloat2("My value", &objects[0]->pos.x);
226 ImGui::DragFloat2("My value", &objects[1]->pos.x);
227 ImGui::DragFloat2("My value", &objects[2]->pos.x);
228 ImGui::End();
229 &nbsp;
230 ImGui::Begin("Correct!");
231 ImGui::DragFloat2("My value", &objects[0]->pos.x);
232 ImGui::DragFloat2("My value##2", &objects[1]->pos.x);
233 ImGui::DragFloat2("My value##3", &objects[2]->pos.x);
234 ImGui::End();
235 &nbsp;
236 ImGui::Begin("Also Correct!");
237 for (int n = 0; n < 3; n++)
238 {
239 ImGui::PushID(n);
240 ImGui::DragFloat2("My value", &objects[n]->pos.x);
241 ImGui::PopID();
242 }
243 ImGui::End();
244 </pre>
245 </td>
246 </tr>
247 </table>
248
249 A primer on labels and the ID Stack...
250
251 Dear ImGui internally needs to uniquely identify UI elements.
252 Elements that are typically not clickable (such as calls to the Text functions) don't need an ID.
253 Interactive widgets (such as calls to Button buttons) need a unique ID.
254
255 **Unique IDs are used internally to track active widgets and occasionally associate state to widgets.<BR>
256 Unique IDs are implicitly built from the hash of multiple elements that identify the "path" to the UI element.**
257
258 Since Dear ImGui 1.85, you can use `Demo>Tools>ID Stack Tool` or call `ImGui::ShowIDStackToolWindow()`. The tool display intermediate values leading to the creation of a unique ID, making things easier to debug and understand.
259
260 ![Stack tool](https://user-images.githubusercontent.com/8225057/136235657-a0ea5665-dcd1-423f-9be6-dc3f8ced8f12.png)
261
262 - Unique ID are often derived from a string label and at minimum scoped within their host window:
263 ```cpp
264 Begin("MyWindow");
265 Button("OK"); // Label = "OK", ID = hash of ("MyWindow", "OK")
266 Button("Cancel"); // Label = "Cancel", ID = hash of ("MyWindow", "Cancel")
267 End();
268 ```
269 - Other elements such as tree nodes, etc. also pushes to the ID stack:
270 ```cpp
271 Begin("MyWindow");
272 if (TreeNode("MyTreeNode"))
273 {
274 Button("OK"); // Label = "OK", ID = hash of ("MyWindow", "MyTreeNode", "OK")
275 TreePop();
276 }
277 End();
278 ```
279 - Two items labeled "OK" in different windows or different tree locations won't collide:
280 ```cpp
281 Begin("MyFirstWindow");
282 Button("OK"); // Label = "OK", ID = hash of ("MyFirstWindow", "OK")
283 End();
284 Begin("MyOtherWindow");
285 Button("OK"); // Label = "OK", ID = hash of ("MyOtherWindow", "OK")
286 End();
287 ```
288
289 - If you have a same ID twice in the same location, you'll have a conflict:
290 ```cpp
291 Begin("MyWindow");
292 Button("OK");
293 Button("OK"); // ERROR: ID collision with the first button! Interacting with either button will trigger the first one.
294 Button(""); // ERROR: ID collision with Begin("MyWindow")!
295 End();
296 ```
297 Fear not! This is easy to solve and there are many ways to solve it!
298
299 - Solving ID conflict in a simple/local context:
300 When passing a label you can optionally specify extra ID information within the string itself.
301 Use "##" to pass a complement to the ID that won't be visible to the end-user.
302 This helps solve the simple collision cases when you know e.g. at compilation time which items
303 are going to be created:
304 ```cpp
305 Begin("MyWindow");
306 Button("Play"); // Label = "Play", ID = hash of ("MyWindow", "Play")
307 Button("Play##foo1"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo1") // Different from other buttons
308 Button("Play##foo2"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo2") // Different from other buttons
309 Button("##foo"); // Label = "", ID = hash of ("MyWindow", "##foo") // Different from window
310 End();
311 ```
312 - If you want to completely hide the label, but still need an ID:
313 ```cpp
314 Checkbox("##On", &b); // Label = "", ID = hash of (..., "##On") // No visible label, just a checkbox!
315 ```
316 - Occasionally/rarely you might want to change a label while preserving a constant ID. This allows
317 you to animate labels. For example, you may want to include varying information in a window title bar,
318 but windows are uniquely identified by their ID. Use "###" to pass a label that isn't part of ID:
319 ```cpp
320 Button("Hello###ID"); // Label = "Hello", ID = hash of (..., "###ID")
321 Button("World###ID"); // Label = "World", ID = hash of (..., "###ID") // Same ID, different label
322
323 sprintf(buf, "My game (%f FPS)###MyGame", fps);
324 Begin(buf); // Variable title, ID = hash of "MyGame"
325 ```
326 - Solving ID conflict in a more general manner:
327 Use `PushID()` / `PopID()` to create scopes and manipulate the ID stack, as to avoid ID conflicts
328 within the same window. This is the most convenient way of distinguishing ID when iterating and
329 creating many UI elements programmatically.
330 You can push a pointer, a string, or an integer value into the ID stack.
331 Remember that IDs are formed from the concatenation of _everything_ pushed into the ID stack.
332 At each level of the stack, we store the seed used for items at this level of the ID stack.
333 ```cpp
334 Begin("Window");
335 for (int i = 0; i < 100; i++)
336 {
337 PushID(i); // Push i to the id tack
338 Button("Click"); // Label = "Click", ID = hash of ("Window", i, "Click")
339 PopID();
340 }
341 for (int i = 0; i < 100; i++)
342 {
343 MyObject* obj = Objects[i];
344 PushID(obj);
345 Button("Click"); // Label = "Click", ID = hash of ("Window", obj pointer, "Click")
346 PopID();
347 }
348 for (int i = 0; i < 100; i++)
349 {
350 MyObject* obj = Objects[i];
351 PushID(obj->Name);
352 Button("Click"); // Label = "Click", ID = hash of ("Window", obj->Name, "Click")
353 PopID();
354 }
355 End();
356 ```
357 - You can stack multiple prefixes into the ID stack:
358 ```cpp
359 Button("Click"); // Label = "Click", ID = hash of (..., "Click")
360 PushID("node");
361 Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click")
362 PushID(my_ptr);
363 Button("Click"); // Label = "Click", ID = hash of (..., "node", my_ptr, "Click")
364 PopID();
365 PopID();
366 ```
367 - Tree nodes implicitly create a scope for you by calling `PushID()`:
368 ```cpp
369 Button("Click"); // Label = "Click", ID = hash of (..., "Click")
370 if (TreeNode("node")) // <-- this function call will do a PushID() for you (unless instructed not to, with a special flag)
371 {
372 Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click")
373 TreePop();
374 }
375 ```
376
377 When working with trees, IDs are used to preserve the open/close state of each tree node.
378 Depending on your use cases you may want to use strings, indices, or pointers as ID.
379 - e.g. when following a single pointer that may change over time, using a static string as ID
380 will preserve your node open/closed state when the targeted object change.
381 - e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
382 node open/closed state differently. See what makes more sense in your situation!
383
384 ##### [Return to Index](#index)
385
386 ---
387
388 ### Q: How can I display an image?
389 ### Q: What are ImTextureID/ImTextureRef?
390
391 **Short explanation:**
392 - You may use functions such as `ImGui::Image()`, `ImGui::ImageButton()` or lower-level `ImDrawList::AddImage()` to emit draw calls that will use your own textures.
393 - To load and display your own textures, refer to [Image Loading and Displaying Examples](https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples) on the [Wiki](https://github.com/ocornut/imgui/wiki).
394 - Actual textures are identified in a way that is up to the user/engine. Those identifiers are stored and passed as an opaque ImTextureID value.
395 - By default ImTextureID can store up to 64-bits. You may `#define` it to a custom type/structure if you need.
396 - Loading image files from the disk and turning them into a texture is not within the scope of Dear ImGui (for a good reason), but the examples linked above may be useful references.
397
398 **Details:**
399
400 1.92 introduced `ImTextureRef` in June 2025.
401 - All drawing functions using `ImTextureID` were changed to use `ImTextureRef`.
402 - You can trivially create a `ImTextureRef` from a `ImTextureID`.
403 - **If you use Image functions with textures that you have loaded/created yourself, you will mostly likely only ever store/manipulate `ImTextureID` and then pass them as `ImTextureRef`.**
404 - You only NEED to manipulate `ImTextureRef` when dealing with textures managed by the backend itself, aka mainly the atlas texture for now.
405 - We intentionally do not provide an implicit `ImTextureRef` -> `ImTextureID` cast operator because it is technically lossy to convert ImTextureRef to ImTextureID before rendering.
406
407 **ImTextureID = backend specific, low-level identifier for a texture uploaded in GPU/graphics system.**
408 ```cpp
409 #ifndef ImTextureID
410 typedef ImU64 ImTextureID; // Default: store up to 64-bits (any pointer or integer). A majority of backends are ok with that.
411 #endif
412 ```
413 - When a Rendered Backend creates a texture, it store its native identifier into a ImTextureID value (e.g. Used by DX11 backend to a `ID3D11ShaderResourceView*`; Used by OpenGL backends to store `GLuint`; Used by SDLGPU backend to store a `SDL_GPUTextureSamplerBinding*`, etc.).
414 - User may submit their own textures to e.g. `ImGui::Image()` function by passing this value.
415 - During the rendering loop, the Renderer Backend retrieve the ImTextureID, which stored inside a ImTextureRef, which is stored inside ImDrawCmd.
416 - Compile-time type configuration:
417 - To use something other than a 64-bit value: add '#define ImTextureID MyTextureType*' in your imconfig.h file.
418 - This can be whatever to you want it to be! read the FAQ entry about textures for details.
419 - You may decide to store a higher-level structure containing texture, sampler, shader etc. with various constructors if you like. You will need to implement ==/!= operators.
420
421 **ImTextureRef = higher-level identifier for a texture.**
422 ```cpp
423 // Store a ImTextureID _or_ a ImTextureData*.
424 struct ImTextureRef
425 {
426 ImTextureRef() { _TexData = NULL; _TexID = ImTextureID_Invalid; }
427 ImTextureRef(ImTextureID tex_id) { _TexData = NULL; _TexID = tex_id; }
428 inline ImTextureID GetTexID() const { return _TexData ? _TexData->TexID : _TexID; }
429
430 // Members (either are set, never both!)
431 ImTextureData* _TexData; // A texture, generally owned by a ImFontAtlas. Will convert to ImTextureID during render loop, after texture has been uploaded.
432 ImTextureID _TexID; // _OR_ Low-level backend texture identifier, if already uploaded or created by user/app. Generally provided to e.g. ImGui::Image() calls.
433 };
434 ```
435 - The identifier is valid even before the texture has been uploaded to the GPU/graphics system.
436 - This is what gets passed to functions such as `ImGui::Image()`, `ImDrawList::AddImage()`.
437 - This is what gets stored in draw commands (`ImDrawCmd`) to identify a texture during rendering.
438 - When a texture is created by user code (e.g. custom images), we directly store the low-level `ImTextureID`.
439 - Because of this, when displaying your own texture you are likely to ever only manage ImTextureID values on your side.
440 - When a texture is created by the backend, we store a `ImTextureData*` which becomes an indirection to extract the `ImTextureID` value during rendering, after texture upload has happened.
441 - To create a `ImTextureRef` from a `ImTextureData*` you can use `ImTextureData::GetTexRef()`.
442 We intentionally do not provide an `ImTextureRef` constructor for this: we don't expect this to be frequently useful to the end-user, and it would be erroneously called by many legacy code.
443 - There is no constructor to create a `ImTextureRef` from a `ImTextureData*` as we don't expect this to be useful to the end-user, and it would be erroneously called by many legacy code.
444 - If you want to bind the current atlas when using custom rectangles, you can use `io.Fonts->TexRef`.
445 - Binding generators for languages such as C (which don't have constructors), should provide a helper, e.g. `inline ImTextureRef ImTextureRefFromID(ImTextureID tex_id) { ImTextureRef tex_ref = { ._TexData = NULL, .TexID = tex_id }; return tex_ref; }`
446
447 **Please read documentations or tutorials on your graphics API to understand how to display textures on the screen before moving onward.**
448
449 Long explanation:
450 - Dear ImGui's job is to create "meshes", defined in a renderer-agnostic format made of draw commands and vertices. At the end of the frame, those meshes (ImDrawList) will be displayed by your rendering function. They are made up of textured polygons and the code to render them is generally fairly short (a few dozen lines). In the examples/ folder, we provide functions for popular graphics APIs (OpenGL, DirectX, etc.).
451 - Each rendering function decides on a data type to represent "textures". The concept of what is a "texture" is entirely tied to your underlying engine/graphics API.
452 We carry the information to identify a "texture" in the ImTextureID type, which itself tends to be stored inside a ImTextureRef.
453 ImTextureID default to ImU64 aka 8 bytes worth of data: just enough to store one pointer or integer of your choice.
454 Dear ImGui doesn't know or understand what you are storing in ImTextureID, it merely passes values until they reach your rendering function.
455 - In the [examples/](https://github.com/ocornut/imgui/tree/master/examples) backends, for each graphics API we decided on a type that is likely to be a good representation for specifying an image from the end-user perspective. This is what the _examples_ rendering functions are using:
456 ```cpp
457 OpenGL:
458 - ImTextureID should contains 'GLuint' (GL texture identifier).
459 - See ImGui_ImplOpenGL3_RenderDrawData() function in imgui_impl_opengl3.cpp
460 ```
461 ```cpp
462 DirectX9:
463 - ImTextureID should contain a 'LPDIRECT3DTEXTURE9' (pointer).
464 - See ImGui_ImplDX9_RenderDrawData() function in imgui_impl_dx9.cpp
465 ```
466 ```cpp
467 DirectX11:
468 - ImTextureID should contain a 'ID3D11ShaderResourceView*' (pointer)
469 - See ImGui_ImplDX11_RenderDrawData() function in imgui_impl_dx11.cpp
470 ```
471 ```cpp
472 DirectX12:
473 - ImTextureID should contain a 'D3D12_GPU_DESCRIPTOR_HANDLE' (always 64-bits)
474 - See ImGui_ImplDX12_RenderDrawData() function in imgui_impl_dx12.cpp
475 ```
476 For example, in the OpenGL example backend we store raw OpenGL texture identifier (GLuint) inside ImTextureID.
477 Whereas in the DirectX11 example backend we store a pointer to ID3D11ShaderResourceView inside ImTextureID, which is a higher-level structure tying together both the texture and information about its format and how to read it.
478
479 - If you have a custom engine built over e.g. OpenGL, instead of passing GLuint around you may decide to use a high-level data type to carry information about the texture as well as how to display it (shaders, etc.). The decision of what to use as ImTextureID can always be made better by knowing how your codebase is designed. If your engine has high-level data types for "textures" and "material" then you may want to use them.
480 If you are starting with OpenGL or DirectX or Vulkan and haven't built much of a rendering engine over them, keeping the default ImTextureID representation suggested by the example backends is probably the best choice.
481 (Advanced users may also decide to keep a low-level type in ImTextureID, use ImDrawList callback and pass information to their renderer)
482
483 User code may do:
484 ```cpp
485 // Cast our texture type to ImTextureID
486 MyTexture* texture = g_CoffeeTableTexture;
487 ImGui::Image((ImTextureID)(intptr_t)texture, ImVec2(texture->Width, texture->Height));
488 ```
489 The renderer function called after ImGui::Render() will receive that same value that the user code passed:
490 ```cpp
491 // Cast ImTextureID stored in the draw command as our texture type
492 MyTexture* texture = (MyTexture*)(intptr_t)pcmd->GetTexID();
493 MyEngineBindTexture2D(texture);
494 ```
495 Once you understand this design, you will understand that loading image files and turning them into displayable textures is not within the scope of Dear ImGui.
496 This is by design and is a good thing because it means your code has full control over your data types and how you display them.
497 If you want to display an image file (e.g. PNG file) on the screen, please refer to documentation and tutorials for the graphics API you are using.
498
499 Refer to [Image Loading and Displaying Examples](https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples) on the [Wiki](https://github.com/ocornut/imgui/wiki) to find simplified examples for loading textures with OpenGL, DirectX9 and DirectX11.
500
501 C/C++ tip: a u64 is 8 bytes. You may safely store any pointer or integer into it by casting your value to ImTextureID, and vice-versa.
502 Because both end-points (user code and rendering function) are under your control, you know exactly what is stored inside the ImTextureID.
503 Here are some examples:
504 ```cpp
505 GLuint my_tex = XXX;
506 ImTextureID my_imtexid;
507 my_imtexid = (ImTextureID)(intptr_t)my_tex; // cast a GLuint into a ImTextureID (we don't take its address! we just copy the address)
508 my_tex = (GLuint)(intptr_t)my_imtexid; // cast a ImTextureID into a GLuint
509
510 ID3D11ShaderResourceView* my_dx11_srv = XXX;
511 ImTextureID my_imtexid;
512 my_imtexid = (ImTextureID)(intptr_t)my_dx11_srv; // cast a ID3D11ShaderResourceView* into an opaque ImTextureID
513 my_dx11_srv = (ID3D11ShaderResourceView*)(intptr_t)_my_imtexid; // cast a ImTextureID into a ID3D11ShaderResourceView*
514 ```
515 Finally, you may call `ImGui::ShowMetricsWindow()` to explore/visualize/understand how the ImDrawList are generated.
516
517 ##### [Return to Index](#index)
518
519 ---
520
521 ### Q: How can I use maths operators with ImVec2?
522
523 We do not export maths operators by default in imgui.h in order to not conflict with the use of your own maths types and maths operators. As a convenience, you may use `#define IMGUI_DEFINE_MATH_OPERATORS` + `#include "imgui.h"` to access our basic maths operators.
524
525 ##### [Return to Index](#index)
526
527 ---
528
529 ### Q: How can I use my own maths types instead of ImVec2/ImVec4?
530
531 You can setup your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file with `IM_VEC2_CLASS_EXTRA`/`IM_VEC4_CLASS_EXTRA` macros to add implicit type conversions to our own maths types.
532 This way you will be able to use your own types everywhere, e.g. passing `MyVector2` or `glm::vec2` to ImGui functions instead of `ImVec2`.
533
534 ##### [Return to Index](#index)
535
536 ---
537
538 ### Q: How can I interact with standard C++ types (such as std::string and std::vector)?
539 - Being highly portable (backends/bindings for several languages, frameworks, programming styles, obscure or older platforms/compilers), and aiming for compatibility & performance suitable for every modern real-time game engine, Dear ImGui does not use any of std C++ types. We use raw types (e.g. char* instead of std::string) because they adapt to more use cases.
540 - To use ImGui::InputText() with a std::string or any resizable string class, see [misc/cpp/imgui_stdlib.h](https://github.com/ocornut/imgui/blob/master/misc/cpp/imgui_stdlib.h).
541 - To use combo boxes and list boxes with `std::vector` or any other data structure: the `BeginCombo()/EndCombo()` API
542 lets you iterate and submit items yourself, so does the `ListBoxHeader()/ListBoxFooter()` API.
543 Prefer using them over the old and awkward `Combo()/ListBox()` api.
544 - Generally for most high-level types you should be able to access the underlying data type.
545 You may write your own one-liner wrappers to facilitate user code (tip: add new functions in ImGui:: namespace from your code).
546 - Dear ImGui applications often need to make intensive use of strings. It is expected that many of the strings you will pass
547 to the API are raw literals (free in C/C++) or allocated in a manner that won't incur a large cost on your application.
548 Please bear in mind that using `std::string` on applications with a large amount of UI may incur unsatisfactory performances.
549 Modern implementations of `std::string` often include small-string optimization (which is often a local buffer) but those
550 are not configurable and not the same across implementations.
551 - If you are finding your UI traversal cost to be too large, make sure your string usage is not leading to an excessive amount
552 of heap allocations. Consider using literals, statically sized buffers, and your own helper functions. A common pattern
553 is that you will need to build lots of strings on the fly, and their maximum length can be easily scoped ahead.
554 One possible implementation of a helper to facilitate printf-style building of strings: https://github.com/ocornut/Str
555 This is a small helper where you can instance strings with configurable local buffers length. Many game engines will
556 provide similar or better string helpers.
557
558 ##### [Return to Index](#index)
559
560 ---
561
562 ### Q: How can I display custom shapes? (using low-level ImDrawList API)
563
564 - You can use the low-level `ImDrawList` api to render shapes within a window.
565 ```cpp
566 ImGui::Begin("My shapes");
567
568 ImDrawList* draw_list = ImGui::GetWindowDrawList();
569
570 // Get the current ImGui cursor position
571 ImVec2 p = ImGui::GetCursorScreenPos();
572
573 // Draw a red circle
574 draw_list->AddCircleFilled(ImVec2(p.x + 50, p.y + 50), 30.0f, IM_COL32(255, 0, 0, 255));
575
576 // Draw a 3 pixel thick yellow line
577 draw_list->AddLine(ImVec2(p.x, p.y), ImVec2(p.x + 100.0f, p.y + 100.0f), IM_COL32(255, 255, 0, 255), 3.0f);
578
579 // Advance the ImGui cursor to claim space in the window (otherwise the window will appear small and needs to be resized)
580 ImGui::Dummy(ImVec2(200, 200));
581
582 ImGui::End();
583 ```
584 ![ImDrawList usage](https://raw.githubusercontent.com/wiki/ocornut/imgui/tutorials/CustomRendering01.png)
585
586 - Refer to "Demo > Examples > Custom Rendering" in the demo window and read the code of `ShowExampleAppCustomRendering()` in `imgui_demo.cpp` from more examples.
587 - To generate colors: you can use the macro `IM_COL32(255,255,255,255)` to generate them at compile time, or use `ImGui::GetColorU32(IM_COL32(255,255,255,255))` or `ImGui::GetColorU32(ImVec4(1.0f,1.0f,1.0f,1.0f))` to generate a color that is multiplied by the current value of `style.Alpha`.
588 - Math operators: if you have setup `IM_VEC2_CLASS_EXTRA` in `imconfig.h` to bind your own math types, you can use your own math types and their natural operators instead of ImVec2. ImVec2 by default doesn't export any math operators in the public API. You may use `#define IMGUI_DEFINE_MATH_OPERATORS` `#include "imgui.h"` to use our math operators, but instead prefer using your own math library and set it up in `imconfig.h`.
589 - You can use `ImGui::GetBackgroundDrawList()` or `ImGui::GetForegroundDrawList()` to access draw lists which will be displayed behind and over every other Dear ImGui window (one bg/fg drawlist per viewport). This is very convenient if you need to quickly display something on the screen that is not associated with a Dear ImGui window.
590 - You can also create your own empty window and draw inside it. Call Begin() with the NoBackground | NoDecoration | NoSavedSettings | NoInputs flags (The `ImGuiWindowFlags_NoDecoration` flag itself is a shortcut for NoTitleBar | NoResize | NoScrollbar | NoCollapse). Then you can retrieve the ImDrawList* via `GetWindowDrawList()` and draw to it in any way you like.
591 - You can create your own ImDrawList instance. You'll need to initialize them with `ImGui::GetDrawListSharedData()`, or create your own instancing `ImDrawListSharedData`, and then call your renderer function with your own ImDrawList or ImDrawData data.
592 - Looking for fun? The [ImDrawList coding party 2020](https://github.com/ocornut/imgui/issues/3606) thread is full of "don't do this at home" extreme uses of the ImDrawList API.
593
594 ##### [Return to Index](#index)
595
596 ---
597
598 # Q&A: Fonts, Text
599
600 ### Q: How should I handle DPI in my application?
601
602 Since 1.92 (June 2025) fonts may be dynamically used at any size.
603
604 **Scaling fonts**
605
606 To change font size:
607 ```cpp
608 ImGui::PushFont(NULL, 42.0f);
609 ```
610 To change font and font size:
611 ```cpp
612 ImGui::PushFont(new_font, 42.0f);
613 ```
614 To scale all fonts:
615 ```cpp
616 style.FontScaleDpi = 2.0f;
617 ```
618 In `docking` branch or with multi-viewports:
619 ```cpp
620 io.ConfigDpiScaleFonts = true; // [Experimental] Automatically overwrite style.FontScaleDpi in Begin() when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
621 io.ConfigDpiScaleViewports = true; // [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
622 ```
623
624 **Scaling style** (paddings, spacings, thicknesses)
625
626 This is still massively work in progress, expect turbulence.
627 Style values are currently not easily scalable dynamically.
628 For single viewport application you can call once:
629 ```cpp
630 style.ScaleAllSizes(factor); // call once!
631 ```
632 If you need to change the scaling factor, it is currently most practical to reset the style and call this again with a new value.
633
634 Your UI code should avoid using hardcoded constants for size and positioning. Prefer to express values as multiple of reference values such as `ImGui::GetFontSize()` or `ImGui::GetFrameHeight()`. So e.g. instead of seeing a hardcoded height of 500 for a given item/window, you may want to use `30*ImGui::GetFontSize()` instead.
635
636 Down the line Dear ImGui will provide a variety of standardized reference values to facilitate using this. This is expected to happen during subsequent 1.92.x releases.
637
638 Applications in the `examples/` folder are partly DPI aware but they are unable to load a custom font from the file-system, so they look ugly (may change that in the future).
639
640 The reason DPI is not auto-magically solved in stock examples is that we don't yet have a satisfying solution for the "multi-dpi" problem (using the `docking` branch: when multiple viewport windows are over multiple monitors using different DPI scales) specifically for the `ImGuiStyle` structure. Fonts are however now perfectly scalable.
641
642 **On Windows, you need to inform Windows that your application is DPI aware!**
643 If this is not done, Windows will scale the application window and the UI text will be blurry. Potential solutions to indicate DPI awareness on Windows are:
644 - For SDL2: the flag `SDL_WINDOW_ALLOW_HIGHDPI` needs to be passed to `SDL_CreateWindow()` + call `::SetProcessDPIAware()`.
645 - For SDL3: the flag `SDL_WINDOW_HIGH_PIXEL_DENSITY` needs to be passed to `SDL_CreateWindow()`.
646 - For GLFW: this is done automatically.
647 - For other Windows projects with other backends, or wrapper projects:
648 - We provide a `ImGui_ImplWin32_EnableDpiAwareness()` helper method in the Win32 backend.
649 - Use an [application manifest file](https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process) to set the `<dpiAware>` property.
650
651 ### Q: How can I load a different font than the default?
652 Use the font atlas to load the TTF/OTF file you want:
653
654 ```cpp
655 ImGuiIO& io = ImGui::GetIO();
656 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
657 io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
658 ```
659
660 Default is ProggyClean.ttf, monospace, rendered at size 13, embedded in dear imgui's source code.
661
662 (Tip: monospace fonts are convenient because they allow to facilitate horizontal alignment directly at the string level.)
663
664 (Read the [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) file for more details about font loading.)
665
666 New programmers: remember that in C/C++ and most programming languages if you want to use a
667 backslash \ within a string literal, you need to write it double backslash "\\":
668
669 ```cpp
670 io.Fonts->AddFontFromFileTTF("MyFolder\MyFont.ttf", size); // WRONG (you are escaping the M here!)
671 io.Fonts->AddFontFromFileTTF("MyFolder\\MyFont.ttf", size); // CORRECT (Windows only)
672 io.Fonts->AddFontFromFileTTF("MyFolder/MyFont.ttf", size); // ALSO CORRECT
673 ```
674
675 ##### [Return to Index](#index)
676
677 ---
678
679 ### Q: How can I easily use icons in my application?
680 The most convenient and practical way is to merge an icon font such as FontAwesome inside your
681 main font. Then you can refer to icons within your strings.
682 Read the [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) file for more details about icons font loading.
683
684 ##### [Return to Index](#index)
685
686 ---
687
688 ### Q: How can I load multiple fonts?
689
690 Use the font atlas to pack them into a single texture. Read [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) for more details.
691
692 ##### [Return to Index](#index)
693
694 ---
695
696 ### Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
697
698 Since 1.92 (June 2025) and with an updated backend, it is not necessary to specify glyph ranges at all.
699
700 Before 1.92, when loading a font, pass custom Unicode ranges to specify the glyphs to load.
701 ```cpp
702 // [BEFORE 1.92]
703 // Add default Japanese ranges
704 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, nullptr, io.Fonts->GetGlyphRangesJapanese());
705
706 // Or create your own custom ranges (e.g. for a game you can feed your entire game script and only build the characters the game need)
707 ImVector<ImWchar> ranges;
708 ImFontGlyphRangesBuilder builder;
709 builder.AddText("Hello world"); // Add a string (here "Hello world" contains 7 unique characters)
710 builder.AddChar(0x7262); // Add a specific character
711 builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges
712 builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted)
713 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", 16.0f, nullptr, ranges.Data);
714 ```
715
716 All your strings need to use UTF-8 encoding.
717 You need to tell your compiler to use UTF-8, or in C++11 you can encode a string literal in UTF-8 by using the u8"hello" syntax.
718 Specifying literal in your source code using a local code page (such as CP-923 for Japanese or CP-1251 for Cyrillic) will NOT work!
719 See [About UTF-8 Encoding](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#about-utf-8-encoding) section
720 of [FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) for details about UTF-8 Encoding.
721
722 Text input: it is up to your application to pass the right character code by calling `io.AddInputCharacter()`.
723 The applications in examples/ are doing that.
724 Windows: you can use the WM_CHAR or WM_UNICHAR or WM_IME_CHAR message (depending if your app is built using Unicode or MultiByte mode).
725 You may also use `MultiByteToWideChar()` or `ToUnicode()` to retrieve Unicode codepoints from MultiByte characters or keyboard state.
726 Windows: if your language is relying on an Input Method Editor (IME), you can write your HWND to `ImGui::GetMainViewport()->PlatformHandleRaw`
727 for the default implementation of `GetPlatformIO().Platform_SetImeDataFn()` to set your Microsoft IME position correctly.
728
729 ##### [Return to Index](#index)
730
731 ---
732
733 # Q&A: Concerns
734
735 ### Q: Who uses Dear ImGui?
736
737 You may take a look at:
738
739 - [Quotes](https://github.com/ocornut/imgui/wiki/Quotes)
740 - [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui)
741 - [Funding & Sponsors](https://github.com/ocornut/imgui/wiki/Funding)
742 - [Gallery](https://github.com/ocornut/imgui/issues?q=label%3Agallery)
743
744 ##### [Return to Index](#index)
745
746 ---
747
748 ### Q: Can you create elaborate/serious tools with Dear ImGui?
749
750 Yes. People have written game editors, data browsers, debuggers, profilers, and all sorts of non-trivial tools with the library. In my experience, the simplicity of the API is very empowering. Your UI runs close to your live data. Make the tools always-on and everybody in the team will be inclined to create new tools (as opposed to more "offline" UI toolkits where only a fraction of your team effectively creates tools). The list of sponsors below is also an indicator that serious game teams have been using the library.
751
752 Dear ImGui is very programmer-centric and the immediate-mode GUI paradigm might require you to readjust some habits before you can realize its full potential. Dear ImGui is about making things that are simple, efficient, and powerful.
753
754 Dear ImGui is built to be efficient and scalable toward the needs for AAA-quality applications running all day. The IMGUI paradigm offers different opportunities for optimization than the more typical RMGUI paradigm.
755
756 ##### [Return to Index](#index)
757
758 ---
759
760 ### Q: Can you reskin the look of Dear ImGui?
761
762 Somewhat. You can alter the look of the interface to some degree: changing colors, sizes, padding, rounding, and fonts. However, as Dear ImGui is designed and optimized to create debug tools, the amount of skinning you can apply is limited. There is only so much you can stray away from the default look and feel of the interface. Dear ImGui is NOT designed to create a user interface for games, although with ingenious use of the low-level API you can do it.
763
764 A reasonably skinned application may look like (screenshot from [#2529](https://github.com/ocornut/imgui/issues/2529#issuecomment-524281119)):
765 ![minipars](https://user-images.githubusercontent.com/314805/63589441-d9794f00-c5b1-11e9-8d96-cfc1b93702f7.png)
766
767 ##### [Return to Index](#index)
768
769 ---
770
771 ### Q: Why using C++ (as opposed to C)?
772
773 Dear ImGui takes advantage of a few C++ language features for convenience but nothing anywhere Boost insanity/quagmire. Dear ImGui doesn't use any C++ header file. Dear ImGui uses a very small subset of C++11 features. In particular, function overloading and default parameters are used to make the API easier to use and code terser. Doing so I believe the API is sitting on a sweet spot and giving up on those features would make the API more cumbersome. Other features such as namespace, constructors, and templates (in the case of the ImVector<> class) are also relied on as a convenience.
774
775 There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/cimgui/cimgui) by Sonoro1234 and Stephan Dilly. It is designed for creating bindings to other languages. If possible, I would suggest using your target language functionalities to try replicating the function overloading and default parameters used in C++ else the API may be harder to use. Also see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for various third-party bindings.
776
777 ##### [Return to Index](#index)
778
779 ---
780
781 # Q&A: Community
782
783 ### Q: How can I help?
784 - Businesses: please reach out to `omar AT dearimgui.com` if you work in a place using Dear ImGui! We can discuss ways for your company to fund development via invoiced technical support, maintenance, or sponsoring contacts. This is among the most useful thing you can do for Dear ImGui. With increased funding, we can hire more people to work on this project. Please see [Funding](https://github.com/ocornut/imgui/wiki/Funding) page.
785 - Individuals: you can support continued maintenance and development via PayPal donations. See [README](https://github.com/ocornut/imgui/blob/master/docs/README.md).
786 - If you are experienced with Dear ImGui and C++, look at [GitHub Issues](https://github.com/ocornut/imgui/issues), [GitHub Discussions](https://github.com/ocornut/imgui/discussions), the [Wiki](https://github.com/ocornut/imgui/wiki), read [docs/TODO.txt](https://github.com/ocornut/imgui/blob/master/docs/TODO.txt), and see how you want to help and can help!
787 - Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere, etc.
788 You may post screenshots or links in the [gallery threads](https://github.com/ocornut/imgui/issues?q=label%3Agallery). Visuals are ideal as they inspire other programmers. Disclosing your use of Dear ImGui helps the library grow credibility, and helps other teams and programmers with taking decisions.
789 - If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues or sometimes incomplete PR.
790
791 ##### [Return to Index](#index)
792