diff --git a/docs/README.md b/docs/README.md
index 5f9a188c..b1e10d53 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -20,7 +20,7 @@ Dear ImGui is designed to enable fast iterations and to empower programmers to c
Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.
-See [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui), [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) and [Gallery](https://github.com/ocornut/imgui/issues/1902) pages to get an idea of its use cases.
+See [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui), [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) and [Gallery](https://github.com/ocornut/imgui/issues/2265) pages to get an idea of its use cases.
Dear ImGui is self-contained within a few files that you can easily copy and compile into your application/engine:
- imgui.cpp
@@ -175,7 +175,8 @@ User screenshots:
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 to June 2018)
-
[Gallery Part 7](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
+
[Gallery Part 7](https://github.com/ocornut/imgui/issues/1902) (June 2018 to January 2018)
+
[Gallery Part 8](https://github.com/ocornut/imgui/issues/2265) (January 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Custom engine
@@ -243,6 +244,7 @@ The library started its life and is best known as "ImGui" only due to the fact t
**How can I easily use icons in my application?**
**How can I load multiple fonts?**
**How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?** ([example](https://github.com/ocornut/imgui/wiki/Loading-Font-Example))
+
**How can I interact with standard C++ types (such as std::string and std::vector)?**
**How can I use the drawing facilities without an Dear ImGui window? (using ImDrawList API)**
**How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)**
**I integrated Dear ImGui in my engine and the text or lines are blurry..**
@@ -298,7 +300,7 @@ Ongoing dear imgui development is financially supported by users and private spo
- **Blizzard Entertainment**.
**Double-chocolate sponsors**
-- Media Molecule, Mobigame, Insomniac Games, Aras Pranckevičius, Lizardcube, Greggman, DotEmu, Nadeo, Supercell, Runner, Aiden Koss.
+- Media Molecule, Mobigame, Insomniac Games, Aras Pranckevičius, Lizardcube, Greggman, DotEmu, Nadeo, Supercell, Runner, Aiden Koss, Kylotonn.
**Salty caramel supporters**
- Jetha Chan, Wild Sheep Studio, Pastagames, Mārtiņš Možeiko, Daniel Collin, Recognition Robotics, Chris Genova, ikrima, Glenn Fiedler, Geoffrey Evans, Dakko Dakko, Mercury Labs, Singularity Demo Group, Mischa Alff, Sebastien Ronsse, Lionel Landwerlin, Nikolay Ivanov, Ron Gilbert, Brandon Townsend, Nikhil Deshpande, Cort Stratton, drudru, Harfang 3D, Jeff Roberts, Rainway inc.
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 5e3f73ff..9c5f3140 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -257,6 +257,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- font: add support for kerning, probably optional. A) perhaps default to (32..128)^2 matrix ~ 9K entries = 36KB, then hash for non-ascii?. B) or sparse lookup into per-char list?
- font: add a simpler CalcTextSizeA() api? current one ok but not welcome if user needs to call it directly (without going through ImGui::CalcTextSize)
- font: fix AddRemapChar() to work before font has been built.
+ - font: what would it take to support codepoint higher than 0xFFFF? (smileys, etc.)
- font: (api breaking) remove "TTF" from symbol names. also because it now supports OTF.
- font/opt: Considering storing standalone AdvanceX table as 16-bit fixed point integer?
- font/opt: Glyph currently 40 bytes (2+9*4). Consider storing UV as 16 bits integer? (->32 bytes). X0/Y0/X1/Y1 as 16 fixed-point integers? Or X0/Y0 as float and X1/Y1 as fixed8_8?
diff --git a/imgui.cpp b/imgui.cpp
index c9b4188b..8c118918 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -45,6 +45,7 @@ DOCUMENTATION
- How can I easily use icons in my application?
- How can I load multiple fonts?
- How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
+ - How can I interact with standard C++ types (such as std::string and std::vector)?
- How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
- How can I use Dear ImGui on a platform that doesn't have a mouse or a keyboard? (input share, remoting, gamepad)
- I integrated Dear ImGui in my engine and the text or lines are blurry..
@@ -843,6 +844,28 @@ CODE
Windows: if your language is relying on an Input Method Editor (IME), you copy the HWND of your window to io.ImeWindowHandle in order for
the default implementation of io.ImeSetInputScreenPosFn() to set your Microsoft IME position correctly.
+ Q: How can I interact with standard C++ types (such as std::string and std::vector)?
+ A: - Being highly portable (bindings for several languages, frameworks, programming style, obscure or older platforms/compilers),
+ and aiming for compatibility & performance suitable for every modern real-time game engines, 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.
+ - To use ImGui::InputText() with a std::string or any resizable string class, see misc/cpp/imgui_stdlib.h.
+ - To use combo boxes and list boxes with std::vector or any other data structure: the BeginCombo()/EndCombo() API
+ lets you iterate and submit items yourself, so does the ListBoxHeader()/ListBoxFooter() API.
+ Prefer using them over the old and awkward Combo()/ListBox() api.
+ - Generally for most high-level types you should be able to access the underlying data type.
+ You may write your own one-liner wrappers to facilitate user code (tip: add new functions in ImGui:: namespace from your code).
+ - Dear ImGui applications often need to make intensive use of strings. It is expected that many of the strings you will pass
+ 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.
+ Please bear in mind that using std::string on applications with large amount of UI may incur unsatisfactory performances.
+ Modern implementations of std::string often include small-string optimization (which is often a local buffer) but those
+ are not configurable and not the same across implementations.
+ - If you are finding your UI traversal cost to be too large, make sure your string usage is not leading to excessive amount
+ of heap allocations. Consider using literals, statically sized buffers and your own helper functions. A common pattern
+ is that you will need to build lots of strings on the fly, and their maximum length can be easily be scoped ahead.
+ One possible implementation of a helper to facilitate printf-style building of strings: https://github.com/ocornut/Str
+ This is a small helper where you can instance strings with configurable local buffers length. Many game engines will
+ provide similar or better string helpers.
+
Q: How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
A: - You can create a dummy window. Call Begin() with the NoBackground | NoDecoration | NoSavedSettings | NoInputs flags.
(The ImGuiWindowFlags_NoDecoration flag itself is a shortcut for NoTitleBar | NoResize | NoScrollbar | NoCollapse)
diff --git a/imgui.h b/imgui.h
index dad97c6f..3ac1f0e9 100644
--- a/imgui.h
+++ b/imgui.h
@@ -98,9 +98,6 @@ struct ImFontConfig; // Configuration data when adding a font or
struct ImFontGlyph; // A single font glyph (code point + coordinates within in ImFontAtlas + offset)
struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data
struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using)
-#ifndef ImTextureID
-typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
-#endif
struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h)
struct ImGuiIO; // Main configuration and I/O between your application and ImGui
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
@@ -115,6 +112,9 @@ struct ImGuiTextFilter; // Helper to parse and apply text filters (e
// Typedefs and Enums/Flags (declared as int for compatibility with old C++, to allow using as flags and to not pollute the top of this file)
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
+#ifndef ImTextureID
+typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
+#endif
typedef unsigned int ImGuiID; // Unique ID used by widgets (typically hashed from a stack of string)
typedef unsigned short ImWchar; // A single U16 character for keyboard input/display. We encode them as multi bytes UTF-8 when used in strings.
typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling