mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 16:30:32 +00:00
Updated to ImGui 1.74
This commit is contained in:
parent
91080c3988
commit
a35585f26a
@ -7,6 +7,7 @@ Change History
|
|||||||
|
|
||||||
Version: 1.18 (2020/01)
|
Version: 1.18 (2020/01)
|
||||||
- Updated to engine version 4.24.
|
- Updated to engine version 4.24.
|
||||||
|
- Updated to ImGui version 1.74.
|
||||||
|
|
||||||
Version: 1.17 (2019/04)
|
Version: 1.17 (2019/04)
|
||||||
- Added experimental support for touch input.
|
- Added experimental support for touch input.
|
||||||
|
@ -9,9 +9,9 @@ Dear ImGui is an immediate-mode graphical user interface library that is very li
|
|||||||
|
|
||||||
Status
|
Status
|
||||||
------
|
------
|
||||||
Version: 1.17
|
Version: 1.18
|
||||||
|
|
||||||
ImGui version: 1.65
|
ImGui version: 1.74
|
||||||
|
|
||||||
Supported engine version: 4.24*
|
Supported engine version: 4.24*
|
||||||
|
|
||||||
|
@ -31,8 +31,7 @@ public class ImGui : ModuleRules
|
|||||||
|
|
||||||
PublicIncludePaths.AddRange(
|
PublicIncludePaths.AddRange(
|
||||||
new string[] {
|
new string[] {
|
||||||
Path.Combine(ModuleDirectory, "../ThirdParty/ImGuiLibrary/Include"),
|
Path.Combine(ModuleDirectory, "../ThirdParty/ImGuiLibrary/Include")
|
||||||
Path.Combine(ModuleDirectory, "../ThirdParty/ImGuiLibrary/Include/misc/stl")
|
|
||||||
// ... add public include paths required here ...
|
// ... add public include paths required here ...
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -137,7 +137,7 @@ void FImGuiContextProxy::Tick(float DeltaSeconds)
|
|||||||
// Update context information (some data, like mouse cursor, may be cleaned in new frame, so we should collect it
|
// Update context information (some data, like mouse cursor, may be cleaned in new frame, so we should collect it
|
||||||
// beforehand).
|
// beforehand).
|
||||||
bHasActiveItem = ImGui::IsAnyItemActive();
|
bHasActiveItem = ImGui::IsAnyItemActive();
|
||||||
bIsMouseHoveringAnyWindow = ImGui::IsMouseHoveringAnyWindow();
|
bIsMouseHoveringAnyWindow = ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow);
|
||||||
MouseCursor = ImGuiInterops::ToSlateMouseCursor(ImGui::GetMouseCursor());
|
MouseCursor = ImGuiInterops::ToSlateMouseCursor(ImGui::GetMouseCursor());
|
||||||
DisplaySize = ImGuiInterops::ToVector2D(ImGui::GetIO().DisplaySize);
|
DisplaySize = ImGuiInterops::ToVector2D(ImGui::GetIO().DisplaySize);
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ void FImGuiDemo::DrawControls(int32 ContextIndex)
|
|||||||
// 2. Show another simple window, this time using an explicit Begin/End pair
|
// 2. Show another simple window, this time using an explicit Begin/End pair
|
||||||
if (ShowAnotherWindowMask & ContextBit)
|
if (ShowAnotherWindowMask & ContextBit)
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowSize(ImVec2(200, 100), ImGuiSetCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(200, 100), ImGuiCond_FirstUseEver);
|
||||||
ImGui::Begin("Another Window");
|
ImGui::Begin("Another Window");
|
||||||
ImGui::Text("Hello");
|
ImGui::Text("Hello");
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
@ -76,7 +76,7 @@ void FImGuiDemo::DrawControls(int32 ContextIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw demo window.
|
// Draw demo window.
|
||||||
ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver);
|
ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
|
||||||
ImGui::ShowDemoWindow();
|
ImGui::ShowDemoWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ ImGuiContext** GImGuiContextPtrHandle = &GImGuiContextPtr;
|
|||||||
#include "imgui_demo.cpp"
|
#include "imgui_demo.cpp"
|
||||||
#include "imgui_draw.cpp"
|
#include "imgui_draw.cpp"
|
||||||
#include "imgui_widgets.cpp"
|
#include "imgui_widgets.cpp"
|
||||||
#include "misc/stl/imgui_stl.cpp"
|
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS
|
#if PLATFORM_WINDOWS
|
||||||
#include <Windows/HideWindowsPlatformTypes.h>
|
#include <Windows/HideWindowsPlatformTypes.h>
|
||||||
|
@ -9,41 +9,6 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
|
||||||
// If TCHAR is wider than ImWchar, enable or disable validation of input character before conversions.
|
|
||||||
#define VALIDATE_INPUT_CHARACTERS 1
|
|
||||||
|
|
||||||
#if VALIDATE_INPUT_CHARACTERS
|
|
||||||
DEFINE_LOG_CATEGORY_STATIC(LogImGuiInput, Warning, All);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
template<typename T, std::enable_if_t<(sizeof(T) <= sizeof(ImWchar)), T>* = nullptr>
|
|
||||||
ImWchar CastInputChar(T Char)
|
|
||||||
{
|
|
||||||
return static_cast<ImWchar>(Char);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T, std::enable_if_t<!(sizeof(T) <= sizeof(ImWchar)), T>* = nullptr>
|
|
||||||
ImWchar CastInputChar(T Char)
|
|
||||||
{
|
|
||||||
#if VALIDATE_INPUT_CHARACTERS
|
|
||||||
// We only need a runtime validation if TCHAR is wider than ImWchar.
|
|
||||||
// Signed and unsigned integral types with the same size as ImWchar should be safely converted. As long as the
|
|
||||||
// char value is in that range we can safely use it, otherwise we should log an error to notify about possible
|
|
||||||
// truncations.
|
|
||||||
static constexpr auto MinLimit = (std::numeric_limits<std::make_signed_t<ImWchar>>::min)();
|
|
||||||
static constexpr auto MaxLimit = (std::numeric_limits<std::make_unsigned_t<ImWchar>>::max)();
|
|
||||||
UE_CLOG(!(Char >= MinLimit && Char <= MaxLimit), LogImGuiInput, Error,
|
|
||||||
TEXT("TCHAR value '%c' (%#x) is out of range %d (%#x) to %u (%#x) that can be safely converted to ImWchar. ")
|
|
||||||
TEXT("If you wish to disable this validation, please set VALIDATE_INPUT_CHARACTERS in ImGuiInputState.cpp to 0."),
|
|
||||||
Char, Char, MinLimit, MinLimit, MaxLimit, MaxLimit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return static_cast<ImWchar>(Char);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FImGuiInputState::FImGuiInputState()
|
FImGuiInputState::FImGuiInputState()
|
||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
@ -51,11 +16,7 @@ FImGuiInputState::FImGuiInputState()
|
|||||||
|
|
||||||
void FImGuiInputState::AddCharacter(TCHAR Char)
|
void FImGuiInputState::AddCharacter(TCHAR Char)
|
||||||
{
|
{
|
||||||
if (InputCharactersNum < Utilities::GetArraySize(InputCharacters))
|
InputCharacters.Add(Char);
|
||||||
{
|
|
||||||
InputCharacters[InputCharactersNum++] = CastInputChar(Char);
|
|
||||||
InputCharacters[InputCharactersNum] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FImGuiInputState::SetKeyDown(uint32 KeyIndex, bool bIsDown)
|
void FImGuiInputState::SetKeyDown(uint32 KeyIndex, bool bIsDown)
|
||||||
@ -83,11 +44,8 @@ void FImGuiInputState::SetMouseDown(uint32 MouseIndex, bool bIsDown)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FImGuiInputState::ClearUpdateState()
|
void FImGuiInputState::ClearUpdateState()
|
||||||
{
|
|
||||||
if (InputCharactersNum > 0)
|
|
||||||
{
|
{
|
||||||
ClearCharacters();
|
ClearCharacters();
|
||||||
}
|
|
||||||
|
|
||||||
KeysUpdateRange.SetEmpty();
|
KeysUpdateRange.SetEmpty();
|
||||||
MouseButtonsUpdateRange.SetEmpty();
|
MouseButtonsUpdateRange.SetEmpty();
|
||||||
@ -99,9 +57,7 @@ void FImGuiInputState::ClearUpdateState()
|
|||||||
|
|
||||||
void FImGuiInputState::ClearCharacters()
|
void FImGuiInputState::ClearCharacters()
|
||||||
{
|
{
|
||||||
using std::fill;
|
InputCharacters.Empty();
|
||||||
fill(InputCharacters, &InputCharacters[Utilities::GetArraySize(InputCharacters)], 0);
|
|
||||||
InputCharactersNum = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FImGuiInputState::ClearKeys()
|
void FImGuiInputState::ClearKeys()
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include "ImGuiInteroperability.h"
|
#include "ImGuiInteroperability.h"
|
||||||
#include "Utilities/Arrays.h"
|
#include "Utilities/Arrays.h"
|
||||||
|
|
||||||
|
#include <Containers/Array.h>
|
||||||
|
|
||||||
|
|
||||||
// Collects and stores input state and updates for ImGui IO.
|
// Collects and stores input state and updates for ImGui IO.
|
||||||
class FImGuiInputState
|
class FImGuiInputState
|
||||||
@ -12,7 +14,7 @@ class FImGuiInputState
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// Characters buffer.
|
// Characters buffer.
|
||||||
using FCharactersBuffer = ImGuiInterops::ImGuiTypes::FInputCharactersBuffer;
|
using FCharactersBuffer = TArray<TCHAR, TInlineAllocator<8>>;
|
||||||
|
|
||||||
// Array for mouse button states.
|
// Array for mouse button states.
|
||||||
using FMouseButtonsArray = ImGuiInterops::ImGuiTypes::FMouseButtonsArray;
|
using FMouseButtonsArray = ImGuiInterops::ImGuiTypes::FMouseButtonsArray;
|
||||||
@ -35,9 +37,6 @@ public:
|
|||||||
// Get reference to input characters buffer.
|
// Get reference to input characters buffer.
|
||||||
const FCharactersBuffer& GetCharacters() const { return InputCharacters; }
|
const FCharactersBuffer& GetCharacters() const { return InputCharacters; }
|
||||||
|
|
||||||
// Get number of characters in input characters buffer.
|
|
||||||
int32 GetCharactersNum() const { return InputCharactersNum; }
|
|
||||||
|
|
||||||
// Add a character to the characters buffer. We can store and send to ImGui up to 16 characters per frame. Any
|
// Add a character to the characters buffer. We can store and send to ImGui up to 16 characters per frame. Any
|
||||||
// character beyond that limit will be discarded.
|
// character beyond that limit will be discarded.
|
||||||
// @param Char - Character to add
|
// @param Char - Character to add
|
||||||
@ -222,7 +221,6 @@ private:
|
|||||||
FMouseButtonsIndexRange MouseButtonsUpdateRange;
|
FMouseButtonsIndexRange MouseButtonsUpdateRange;
|
||||||
|
|
||||||
FCharactersBuffer InputCharacters;
|
FCharactersBuffer InputCharacters;
|
||||||
uint32 InputCharactersNum = 0;
|
|
||||||
|
|
||||||
FKeysArray KeysDown;
|
FKeysArray KeysDown;
|
||||||
FKeysIndexRange KeysUpdateRange;
|
FKeysIndexRange KeysUpdateRange;
|
||||||
|
@ -7,8 +7,44 @@
|
|||||||
#include "Utilities/Arrays.h"
|
#include "Utilities/Arrays.h"
|
||||||
|
|
||||||
|
|
||||||
|
// If TCHAR is wider than ImWchar, enable or disable validation of input character before conversions.
|
||||||
|
#define VALIDATE_INPUT_CHARACTERS 1
|
||||||
|
|
||||||
|
#if VALIDATE_INPUT_CHARACTERS
|
||||||
|
DEFINE_LOG_CATEGORY_STATIC(LogImGuiInput, Warning, All);
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
//====================================================================================================
|
||||||
|
// Character conversion
|
||||||
|
//====================================================================================================
|
||||||
|
|
||||||
|
template<typename T, std::enable_if_t<(sizeof(T) <= sizeof(ImWchar)), T>* = nullptr>
|
||||||
|
ImWchar CastInputChar(T Char)
|
||||||
|
{
|
||||||
|
return static_cast<ImWchar>(Char);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, std::enable_if_t<!(sizeof(T) <= sizeof(ImWchar)), T>* = nullptr>
|
||||||
|
ImWchar CastInputChar(T Char)
|
||||||
|
{
|
||||||
|
#if VALIDATE_INPUT_CHARACTERS
|
||||||
|
// We only need a runtime validation if TCHAR is wider than ImWchar.
|
||||||
|
// Signed and unsigned integral types with the same size as ImWchar should be safely converted. As long as the
|
||||||
|
// char value is in that range we can safely use it, otherwise we should log an error to notify about possible
|
||||||
|
// truncations.
|
||||||
|
static constexpr auto MinLimit = (std::numeric_limits<std::make_signed_t<ImWchar>>::min)();
|
||||||
|
static constexpr auto MaxLimit = (std::numeric_limits<std::make_unsigned_t<ImWchar>>::max)();
|
||||||
|
UE_CLOG(!(Char >= MinLimit && Char <= MaxLimit), LogImGuiInput, Error,
|
||||||
|
TEXT("TCHAR value '%c' (%#x) is out of range %d (%#x) to %u (%#x) that can be safely converted to ImWchar. ")
|
||||||
|
TEXT("If you wish to disable this validation, please set VALIDATE_INPUT_CHARACTERS in ImGuiInputState.cpp to 0."),
|
||||||
|
Char, Char, MinLimit, MinLimit, MaxLimit, MaxLimit);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return static_cast<ImWchar>(Char);
|
||||||
|
}
|
||||||
|
|
||||||
//====================================================================================================
|
//====================================================================================================
|
||||||
// Copying Utilities
|
// Copying Utilities
|
||||||
//====================================================================================================
|
//====================================================================================================
|
||||||
@ -264,9 +300,9 @@ namespace ImGuiInterops
|
|||||||
Copy(InputState.GetMouseButtons(), IO.MouseDown, InputState.GetMouseButtonsUpdateRange());
|
Copy(InputState.GetMouseButtons(), IO.MouseDown, InputState.GetMouseButtonsUpdateRange());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InputState.GetCharactersNum() > 0)
|
for (const TCHAR Char : InputState.GetCharacters())
|
||||||
{
|
{
|
||||||
Copy(InputState.GetCharacters(), IO.InputCharacters);
|
IO.AddInputCharacter(CastInputChar(Char));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InputState.IsGamepadNavigationEnabled() && InputState.HasGamepad())
|
if (InputState.IsGamepadNavigationEnabled() && InputState.HasGamepad())
|
||||||
|
@ -24,8 +24,6 @@ namespace ImGuiInterops
|
|||||||
using FKeysArray = decltype(ImGuiIO::KeysDown);
|
using FKeysArray = decltype(ImGuiIO::KeysDown);
|
||||||
using FNavInputArray = decltype(ImGuiIO::NavInputs);
|
using FNavInputArray = decltype(ImGuiIO::NavInputs);
|
||||||
|
|
||||||
using FInputCharactersBuffer = decltype(ImGuiIO::InputCharacters);
|
|
||||||
|
|
||||||
using FKeyMap = decltype(ImGuiIO::KeyMap);
|
using FKeyMap = decltype(ImGuiIO::KeyMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
536
Source/ThirdParty/ImGuiLibrary/Docs/FAQ.md
vendored
Normal file
536
Source/ThirdParty/ImGuiLibrary/Docs/FAQ.md
vendored
Normal file
@ -0,0 +1,536 @@
|
|||||||
|
# FAQ (Frequenty Asked Questions)
|
||||||
|
|
||||||
|
You may link to this document using short form:
|
||||||
|
https://www.dearimgui.org/faq
|
||||||
|
or its real address:
|
||||||
|
https://github.com/ocornut/imgui/blob/master/docs/FAQ.md
|
||||||
|
or view this file with any Markdown viewer.
|
||||||
|
|
||||||
|
|
||||||
|
## Index
|
||||||
|
|
||||||
|
| **Q&A: Basics** |
|
||||||
|
:---------------------------------------------------------- |
|
||||||
|
| [Where is the documentation?](#q-where-is-the-documentation) |
|
||||||
|
| [Which version should I get?](#q-which-version-should-i-get) |
|
||||||
|
| [Why the names "Dear ImGui" vs "ImGui"?](#q-why-the-names-dear-imgui-vs-imgui) |
|
||||||
|
| **Q&A: Concerns** |
|
||||||
|
| [Who uses Dear ImGui?](#q-who-uses-dear-imgui) |
|
||||||
|
| [Can you create elaborate/serious tools with Dear ImGui?](#q-can-you-create-elaborateserious-tools-with-dear-imgui) |
|
||||||
|
| [Can you reskin the look of Dear ImGui?](#q-can-you-reskin-the-look-of-dear-imgui) |
|
||||||
|
| [Why using C++ (as opposed to C)?](#q-why-using-c-as-opposed-to-c) |
|
||||||
|
| **Q&A: Integration** |
|
||||||
|
| [How can I tell whether to dispatch mouse/keyboard to Dear ImGui or to my application?](#q-how-can-i-tell-whether-to-dispatch-mousekeyboard-to-dear-imgui-or-to-my-application) |
|
||||||
|
| [How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)](#q-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..](#q-i-integrated-dear-imgui-in-my-engine-and-the-text-or-lines-are-blurry) |
|
||||||
|
| [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) |
|
||||||
|
| **Q&A: Usage** |
|
||||||
|
| [Why are multiple widgets reacting when I interact with a single one?<br>How can I have multiple widgets with the same label or with an empty label?](#q-why-are-multiple-widgets-reacting-when-i-interact-with-a-single-one-q-how-can-i-have-multiple-widgets-with-the-same-label-or-with-an-empty-label) |
|
||||||
|
| [How can I display an image? What is ImTextureID, how does it work?](#q-how-can-i-display-an-image-what-is-imtextureid-how-does-it-work)|
|
||||||
|
| [How can I use my own math types instead of ImVec2/ImVec4?](#q-how-can-i-use-my-own-math-types-instead-of-imvec2imvec4) |
|
||||||
|
| [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) |
|
||||||
|
| [How can I display custom shapes? (using low-level ImDrawList API)](#q-how-can-i-display-custom-shapes-using-low-level-imdrawlist-api) |
|
||||||
|
| **Q&A: Fonts, Text** |
|
||||||
|
| [How can I load a different font than the default?](#q-how-can-i-load-a-different-font-than-the-default) |
|
||||||
|
| [How can I easily use icons in my application?](#q-how-can-i-easily-use-icons-in-my-application) |
|
||||||
|
| [How can I load multiple fonts?](#q-how-can-i-load-multiple-fonts) |
|
||||||
|
| [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) |
|
||||||
|
| **Q&A: Community** |
|
||||||
|
| [How can I help?](#q-how-can-i-help) |
|
||||||
|
|
||||||
|
|
||||||
|
# Q&A: Basics
|
||||||
|
|
||||||
|
### Q: Where is the documentation?
|
||||||
|
|
||||||
|
**This library is poorly documented at the moment and expects of the user to be acquainted with C/C++.**
|
||||||
|
- Run the examples/ and explore them.
|
||||||
|
- 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.
|
||||||
|
- 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).
|
||||||
|
- Dozens of 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.
|
||||||
|
- Your programming IDE is your friend, find the type or function declaration to find comments associated to it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: Which version should I get?
|
||||||
|
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.
|
||||||
|
|
||||||
|
You may also peak at the [docking](https://github.com/ocornut/imgui/tree/docking) branch which includes:
|
||||||
|
- [Docking/Merging features](https://github.com/ocornut/imgui/issues/2109)
|
||||||
|
- [Multi-viewport features](https://github.com/ocornut/imgui/issues/1542)
|
||||||
|
|
||||||
|
Many projects are using this branch and it is kept in sync with master regularly.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: Why the names "Dear ImGui" vs "ImGui"?
|
||||||
|
|
||||||
|
**TL;DR: Please try to refer to this library as "Dear ImGui".**
|
||||||
|
|
||||||
|
The library started its life as "ImGui" due to the fact that I didn't give it a proper name when 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 on an alternate, longer name "Dear ImGui" that people can use to refer to this specific library.
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
||||||
|
|
||||||
|
|
||||||
|
# Q&A: Concerns
|
||||||
|
|
||||||
|
### Q: Who uses Dear ImGui?
|
||||||
|
|
||||||
|
You may take a look at:
|
||||||
|
|
||||||
|
- [Quotes](https://github.com/ocornut/imgui/wiki/Quotes)
|
||||||
|
- [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui)
|
||||||
|
- [Gallery](https://github.com/ocornut/imgui/issues/2847)
|
||||||
|
|
||||||
|
### Q: Can you create elaborate/serious tools with Dear ImGui?
|
||||||
|
|
||||||
|
Yes. People have written game editors, data browsers, debuggers, profilers and all sort 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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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 that the more typical RMGUI paradigm.
|
||||||
|
|
||||||
|
### Q: Can you reskin the look of Dear ImGui?
|
||||||
|
|
||||||
|
Somehow. You can alter the look of the interface to some degree: changing colors, sizes, padding, rounding, 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 user interface for games, although with ingenious use of the low-level API you can do it.
|
||||||
|
|
||||||
|
A reasonably skinned application may look like (screenshot from [#2529](https://github.com/ocornut/imgui/issues/2529#issuecomment-524281119))
|
||||||
|
![minipars](https://user-images.githubusercontent.com/314805/63589441-d9794f00-c5b1-11e9-8d96-cfc1b93702f7.png)
|
||||||
|
|
||||||
|
### Q: Why using C++ (as opposed to C)?
|
||||||
|
|
||||||
|
Dear ImGui takes advantage of a few C++ languages features for convenience but nothing anywhere Boost insanity/quagmire. Dear ImGui does NOT require C++11 so it can be used with most old C++ compilers. Dear ImGui doesn't use any C++ header file. Language-wise, function overloading and default parameters are used to make the API easier to use and code more terse. 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.
|
||||||
|
|
||||||
|
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 binding 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.
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
||||||
|
|
||||||
|
|
||||||
|
# Q&A: Integration
|
||||||
|
|
||||||
|
### Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or to my application?
|
||||||
|
|
||||||
|
You can read the `io.WantCaptureMouse`, `io.WantCaptureKeyboard` and `io.WantTextInput` flags from the ImGuiIO structure.
|
||||||
|
|
||||||
|
e.g. `if (ImGui::GetIO().WantCaptureMouse) { ... }`
|
||||||
|
|
||||||
|
- When `io.WantCaptureMouse` is set, imgui wants to use your mouse state, and you may want to discard/hide the inputs from the rest of your application.
|
||||||
|
- When `io.WantCaptureKeyboard` is set, imgui wants to use your keyboard state, and you may want to discard/hide the inputs from the rest of your application.
|
||||||
|
- When `io.WantTextInput` is set to may want to notify your OS to popup an on-screen keyboard, if available (e.g. on a mobile phone, or console OS).
|
||||||
|
|
||||||
|
**Note:** You should always pass your mouse/keyboard inputs to Dear ImGui, even when the io.WantCaptureXXX flag are set false.
|
||||||
|
This is because imgui needs to detect that you clicked in the void to unfocus its own windows.
|
||||||
|
|
||||||
|
**Note:** The `io.WantCaptureMouse` is more accurate that any manual attempt to "check if the mouse is hovering a window" (don't do that!). It handle mouse dragging correctly (both dragging that started over your application or over an imgui window) and handle e.g. modal windows blocking inputs. Those flags are updated by `ImGui::NewFrame()`. Preferably read the flags after calling NewFrame() if you can afford it, but reading them before is also perfectly fine, as the bool toggle fairly rarely. If you have on a touch device, you might find use for an early call to `UpdateHoveredWindowAndCaptureFlags()`.
|
||||||
|
|
||||||
|
**Note:** Text input widget releases focus on "Return KeyDown", so the subsequent "Return KeyUp" event that your application receive will typically have `io.WantCaptureKeyboard == false`. Depending on your application logic it may or not be inconvenient. 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.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)
|
||||||
|
- You can control Dear ImGui with a gamepad. Read about navigation in "Using gamepad/keyboard navigation controls".
|
||||||
|
(short version: map gamepad inputs into the io.NavInputs[] array + set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad`).
|
||||||
|
- You can share your computer mouse seamlessly with your console/tablet/phone using [Synergy](https://symless.com/synergy)
|
||||||
|
This is the preferred solution for developer productivity.
|
||||||
|
In particular, the [micro-synergy-client repository](https://github.com/symless/micro-synergy-client) has simple
|
||||||
|
and portable source code (uSynergy.c/.h) for a small embeddable client that you can use on any platform to connect
|
||||||
|
to your host computer, based on the Synergy 1.x protocol. Make sure you download the Synergy 1 server on your computer.
|
||||||
|
Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-like protocols.
|
||||||
|
- You may also use a third party solution such as [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 index for most details.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: I integrated Dear ImGui in my engine and the text or lines are blurry..
|
||||||
|
In your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f).
|
||||||
|
Also make sure your orthographic projection matrix and io.DisplaySize matches your actual framebuffer dimension.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
|
||||||
|
You are probably mishandling the clipping rectangles in your render function.
|
||||||
|
Rectangles provided by ImGui are defined as
|
||||||
|
`(x1=left,y1=top,x2=right,y2=bottom)`
|
||||||
|
and **NOT** as
|
||||||
|
`(x1,y1,width,height)`
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
||||||
|
|
||||||
|
|
||||||
|
# Q&A: Usage
|
||||||
|
|
||||||
|
### Q: Why are multiple widgets reacting when I interact with a single one? <br>Q: How can I have multiple widgets with the same label or with an empty label?
|
||||||
|
|
||||||
|
A primer on labels and the ID Stack...
|
||||||
|
|
||||||
|
Dear ImGui internally need to uniquely identify UI elements.
|
||||||
|
Elements that are typically not clickable (such as calls to the Text functions) don't need an ID.
|
||||||
|
Interactive widgets (such as calls to Button buttons) need a unique ID.
|
||||||
|
Unique ID are used internally to track active widgets and occasionally associate state to widgets.
|
||||||
|
Unique ID are implicitly built from the hash of multiple elements that identify the "path" to the UI element.
|
||||||
|
|
||||||
|
- Unique ID are often derived from a string label:
|
||||||
|
```c
|
||||||
|
Button("OK"); // Label = "OK", ID = hash of (..., "OK")
|
||||||
|
Button("Cancel"); // Label = "Cancel", ID = hash of (..., "Cancel")
|
||||||
|
```
|
||||||
|
- ID are uniquely scoped within windows, tree nodes, etc. which all pushes to the ID stack. Having
|
||||||
|
two buttons labeled "OK" in different windows or different tree locations is fine.
|
||||||
|
We used "..." above to signify whatever was already pushed to the ID stack previously:
|
||||||
|
```c
|
||||||
|
Begin("MyWindow");
|
||||||
|
Button("OK"); // Label = "OK", ID = hash of ("MyWindow", "OK")
|
||||||
|
End();
|
||||||
|
Begin("MyOtherWindow");
|
||||||
|
Button("OK"); // Label = "OK", ID = hash of ("MyOtherWindow", "OK")
|
||||||
|
End();
|
||||||
|
```
|
||||||
|
- If you have a same ID twice in the same location, you'll have a conflict:
|
||||||
|
```c
|
||||||
|
Button("OK");
|
||||||
|
Button("OK"); // ID collision! Interacting with either button will trigger the first one.
|
||||||
|
```
|
||||||
|
Fear not! this is easy to solve and there are many ways to solve it!
|
||||||
|
|
||||||
|
- Solving ID conflict in a simple/local context:
|
||||||
|
When passing a label you can optionally specify extra ID information within string itself.
|
||||||
|
Use "##" to pass a complement to the ID that won't be visible to the end-user.
|
||||||
|
This helps solving the simple collision cases when you know e.g. at compilation time which items
|
||||||
|
are going to be created:
|
||||||
|
```c
|
||||||
|
Begin("MyWindow");
|
||||||
|
Button("Play"); // Label = "Play", ID = hash of ("MyWindow", "Play")
|
||||||
|
Button("Play##foo1"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo1") // Different from above
|
||||||
|
Button("Play##foo2"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo2") // Different from above
|
||||||
|
End();
|
||||||
|
```
|
||||||
|
- If you want to completely hide the label, but still need an ID:
|
||||||
|
```c
|
||||||
|
Checkbox("##On", &b); // Label = "", ID = hash of (..., "##On") // No visible label, just a checkbox!
|
||||||
|
```
|
||||||
|
- Occasionally/rarely you might want change a label while preserving a constant ID. This allows
|
||||||
|
you to animate labels. For example you may want to include varying information in a window title bar,
|
||||||
|
but windows are uniquely identified by their ID. Use "###" to pass a label that isn't part of ID:
|
||||||
|
```c
|
||||||
|
Button("Hello###ID"); // Label = "Hello", ID = hash of (..., "###ID")
|
||||||
|
Button("World###ID"); // Label = "World", ID = hash of (..., "###ID") // Same as above, even if the label looks different
|
||||||
|
|
||||||
|
sprintf(buf, "My game (%f FPS)###MyGame", fps);
|
||||||
|
Begin(buf); // Variable title, ID = hash of "MyGame"
|
||||||
|
```
|
||||||
|
- Solving ID conflict in a more general manner:
|
||||||
|
Use PushID() / PopID() to create scopes and manipulate the ID stack, as to avoid ID conflicts
|
||||||
|
within the same window. This is the most convenient way of distinguishing ID when iterating and
|
||||||
|
creating many UI elements programmatically.
|
||||||
|
You can push a pointer, a string or an integer value into the ID stack.
|
||||||
|
Remember that ID are formed from the concatenation of _everything_ pushed into the ID stack.
|
||||||
|
At each level of the stack we store the seed used for items at this level of the ID stack.
|
||||||
|
```c
|
||||||
|
Begin("Window");
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
PushID(i); // Push i to the id tack
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of ("Window", i, "Click")
|
||||||
|
PopID();
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
MyObject* obj = Objects[i];
|
||||||
|
PushID(obj);
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of ("Window", obj pointer, "Click")
|
||||||
|
PopID();
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
MyObject* obj = Objects[i];
|
||||||
|
PushID(obj->Name);
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of ("Window", obj->Name, "Click")
|
||||||
|
PopID();
|
||||||
|
}
|
||||||
|
End();
|
||||||
|
```
|
||||||
|
- You can stack multiple prefixes into the ID stack:
|
||||||
|
```c
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of (..., "Click")
|
||||||
|
PushID("node");
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click")
|
||||||
|
PushID(my_ptr);
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of (..., "node", my_ptr, "Click")
|
||||||
|
PopID();
|
||||||
|
PopID();
|
||||||
|
```
|
||||||
|
- Tree nodes implicitly creates a scope for you by calling PushID().
|
||||||
|
```c
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of (..., "Click")
|
||||||
|
if (TreeNode("node")) // <-- this function call will do a PushID() for you (unless instructed not to, with a special flag)
|
||||||
|
{
|
||||||
|
Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click")
|
||||||
|
TreePop();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- When working with trees, ID are used to preserve the open/close state of each tree node.
|
||||||
|
Depending on your use cases you may want to use strings, indices or pointers as ID.
|
||||||
|
e.g. when following a single pointer that may change over time, using a static string as ID
|
||||||
|
will preserve your node open/closed state when the targeted object change.
|
||||||
|
e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
|
||||||
|
node open/closed state differently. See what makes more sense in your situation!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I display an image? What is ImTextureID, how does it work?
|
||||||
|
|
||||||
|
Short explanation:
|
||||||
|
- Please read Wiki entry for examples: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
|
||||||
|
- 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.
|
||||||
|
- Actual textures are identified in a way that is up to the user/engine. Those identifiers are stored and passed as ImTextureID (void*) value.
|
||||||
|
- Loading image files from the disk and turning them into a texture is not within the scope of Dear ImGui (for a good reason).
|
||||||
|
|
||||||
|
**Please read documentations or tutorials on your graphics API to understand how to display textures on the screen before moving onward.**
|
||||||
|
|
||||||
|
Long explanation:
|
||||||
|
- 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 API (OpenGL, DirectX, etc.).
|
||||||
|
- 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.
|
||||||
|
We carry the information to identify a "texture" in the ImTextureID type.
|
||||||
|
ImTextureID is nothing more that a void*, aka 4/8 bytes worth of data: just enough to store 1 pointer or 1 integer of your choice.
|
||||||
|
Dear ImGui doesn't know or understand what you are storing in ImTextureID, it merely pass ImTextureID values until they reach your rendering function.
|
||||||
|
- In the [examples/](https://github.com/ocornut/imgui/tree/master/examples) bindings, for each graphics API binding 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:
|
||||||
|
```
|
||||||
|
OpenGL:
|
||||||
|
- ImTextureID = GLuint
|
||||||
|
- See ImGui_ImplOpenGL3_RenderDrawData() function in imgui_impl_opengl3.cpp
|
||||||
|
|
||||||
|
DirectX9:
|
||||||
|
- ImTextureID = LPDIRECT3DTEXTURE9
|
||||||
|
- See ImGui_ImplDX9_RenderDrawData() function in imgui_impl_dx9.cpp
|
||||||
|
|
||||||
|
DirectX11:
|
||||||
|
- ImTextureID = ID3D11ShaderResourceView*
|
||||||
|
- See ImGui_ImplDX11_RenderDrawData() function in imgui_impl_dx11.cpp
|
||||||
|
|
||||||
|
DirectX12:
|
||||||
|
- ImTextureID = D3D12_GPU_DESCRIPTOR_HANDLE
|
||||||
|
- See ImGui_ImplDX12_RenderDrawData() function in imgui_impl_dx12.cpp
|
||||||
|
```
|
||||||
|
For example, in the OpenGL example binding we store raw OpenGL texture identifier (GLuint) inside ImTextureID.
|
||||||
|
Whereas in the DirectX11 example binding 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.
|
||||||
|
|
||||||
|
- 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 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.
|
||||||
|
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 bindings is probably the best choice.
|
||||||
|
(Advanced users may also decide to keep a low-level type in ImTextureID, and use ImDrawList callback and pass information to their renderer)
|
||||||
|
|
||||||
|
User code may do:
|
||||||
|
```cpp
|
||||||
|
// Cast our texture type to ImTextureID / void*
|
||||||
|
MyTexture* texture = g_CoffeeTableTexture;
|
||||||
|
ImGui::Image((void*)texture, ImVec2(texture->Width, texture->Height));
|
||||||
|
```
|
||||||
|
The renderer function called after ImGui::Render() will receive that same value that the user code passed:
|
||||||
|
```cpp
|
||||||
|
// Cast ImTextureID / void* stored in the draw command as our texture type
|
||||||
|
MyTexture* texture = (MyTexture*)pcmd->TextureId;
|
||||||
|
MyEngineBindTexture2D(texture);
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
This is by design and is actually a good thing, because it means your code has full control over your data types and how you display them.
|
||||||
|
If you want to display an image file (e.g. PNG file) into the screen, please refer to documentation and tutorials for the graphics API you are using.
|
||||||
|
|
||||||
|
Refer to the Wiki to find simplified examples for loading textures with OpenGL, DirectX9 and DirectX11: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
|
||||||
|
|
||||||
|
C/C++ tip: a void* is pointer-sized storage. You may safely store any pointer or integer into it by casting your value to ImTextureID / void*, and vice-versa.
|
||||||
|
Because both end-points (user code and rendering function) are under your control, you know exactly what is stored inside the ImTextureID / void*.
|
||||||
|
Examples:
|
||||||
|
```cpp
|
||||||
|
GLuint my_tex = XXX;
|
||||||
|
void* my_void_ptr;
|
||||||
|
my_void_ptr = (void*)(intptr_t)my_tex; // cast a GLuint into a void* (we don't take its address! we literally store the value inside the pointer)
|
||||||
|
my_tex = (GLuint)(intptr_t)my_void_ptr; // cast a void* into a GLuint
|
||||||
|
|
||||||
|
ID3D11ShaderResourceView* my_dx11_srv = XXX;
|
||||||
|
void* my_void_ptr;
|
||||||
|
my_void_ptr = (void*)my_dx11_srv; // cast a ID3D11ShaderResourceView* into an opaque void*
|
||||||
|
my_dx11_srv = (ID3D11ShaderResourceView*)my_void_ptr; // cast a void* into a ID3D11ShaderResourceView*
|
||||||
|
```
|
||||||
|
Finally, you may call ImGui::ShowMetricsWindow() to explore/visualize/understand how the ImDrawList are generated.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I use my own math types instead of ImVec2/ImVec4?
|
||||||
|
|
||||||
|
You can edit [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) and setup the IM_VEC2_CLASS_EXTRA/IM_VEC4_CLASS_EXTRA macros to add implicit type conversions.
|
||||||
|
This way you'll be able to use your own types everywhere, e.g. passing MyVector2 or glm::vec2 to ImGui functions instead of ImVec2.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I interact with standard C++ types (such as std::string and std::vector)?
|
||||||
|
- 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](https://github.com/ocornut/imgui/blob/master/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 display custom shapes? (using low-level ImDrawList API)
|
||||||
|
|
||||||
|
- You can use the low-level `ImDrawList` api to render shapes within a window.
|
||||||
|
|
||||||
|
```
|
||||||
|
ImGui::Begin("My shapes");
|
||||||
|
|
||||||
|
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
|
// Get the current ImGui cursor position
|
||||||
|
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||||
|
|
||||||
|
// Draw a red circle
|
||||||
|
draw_list->AddCircleFilled(ImVec2(p.x + 50, p.y + 50), 30.0f, IM_COL32(255, 0, 0, 255), 16);
|
||||||
|
|
||||||
|
// Draw a 3 pixel thick yellow line
|
||||||
|
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);
|
||||||
|
|
||||||
|
// Advance the ImGui cursor to claim space in the window (otherwise the window will appears small and needs to be resized)
|
||||||
|
ImGui::Dummy(ImVec2(200, 200));
|
||||||
|
|
||||||
|
ImGui::End();
|
||||||
|
```
|
||||||
|
![ImDrawList usage](https://raw.githubusercontent.com/wiki/ocornut/imgui/tutorials/CustomRendering01.png)
|
||||||
|
|
||||||
|
- Refer to "Demo > Examples > Custom Rendering" in the demo window and read the code of `ShowExampleAppCustomRendering()` in `imgui_demo.cpp` from more examples.
|
||||||
|
- 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`.
|
||||||
|
- 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_internal.h"` to use the internally defined math operators, but instead prefer using your own math library and set it up in `imconfig.h`.
|
||||||
|
- You can use `ImGui::GetBackgroundDrawList()` or `ImGui::GetForegroundDrawList()` to access draw lists which will be displayed behind and over every other dear imgui windows (one bg/fg drawlist per viewport). This is very convenient if you need to quickly display something on the screen that is not associated to a dear imgui window.
|
||||||
|
- You can also create your own dummy 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.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
||||||
|
|
||||||
|
|
||||||
|
# Q&A: Fonts, Text
|
||||||
|
|
||||||
|
### Q: How can I load a different font than the default?
|
||||||
|
Use the font atlas to load the TTF/OTF file you want:
|
||||||
|
|
||||||
|
```c
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
|
||||||
|
io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
|
||||||
|
```
|
||||||
|
|
||||||
|
Default is ProggyClean.ttf, monospace, rendered at size 13, embedded in dear imgui's source code.
|
||||||
|
|
||||||
|
(Tip: monospace fonts are convenient because they allow to facilitate horizontal alignment directly at the string level.)
|
||||||
|
|
||||||
|
(Read the [docs/FONTS.txt](https://github.com/ocornut/imgui/blob/master/docs/FONTS.txt) file for more details about font loading.)
|
||||||
|
|
||||||
|
New programmers: remember that in C/C++ and most programming languages if you want to use a
|
||||||
|
backslash \ within a string literal, you need to write it double backslash "\\":
|
||||||
|
|
||||||
|
```c
|
||||||
|
io.Fonts->AddFontFromFileTTF("MyFolder\MyFont.ttf", size); // WRONG (you are escape the M here!)
|
||||||
|
io.Fonts->AddFontFromFileTTF("MyFolder\\MyFont.ttf", size; // CORRECT
|
||||||
|
io.Fonts->AddFontFromFileTTF("MyFolder/MyFont.ttf", size); // ALSO CORRECT
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I easily use icons in my application?
|
||||||
|
The most convenient and practical way is to merge an icon font such as FontAwesome inside you
|
||||||
|
main font. Then you can refer to icons within your strings.
|
||||||
|
You may want to see ImFontConfig::GlyphMinAdvanceX to make your icon look monospace to facilitate alignment.
|
||||||
|
(Read the [docs/FONTS.txt](https://github.com/ocornut/imgui/blob/master/docs/FONTS.txt) file for more details about icons font loading.)
|
||||||
|
With some extra effort, you may use colorful icon by registering custom rectangle space inside the font atlas,
|
||||||
|
and copying your own graphics data into it. See docs/FONTS.txt about using the AddCustomRectFontGlyph API.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I load multiple fonts?
|
||||||
|
Use the font atlas to pack them into a single texture:
|
||||||
|
(Read the [docs/FONTS.txt](https://github.com/ocornut/imgui/blob/master/docs/FONTS.txt) file and the code in ImFontAtlas for more details.)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
ImFont* font0 = io.Fonts->AddFontDefault();
|
||||||
|
ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
|
||||||
|
ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
|
||||||
|
io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
|
||||||
|
// the first loaded font gets used by default
|
||||||
|
// use ImGui::PushFont()/ImGui::PopFont() to change the font at runtime
|
||||||
|
|
||||||
|
// Options
|
||||||
|
ImFontConfig config;
|
||||||
|
config.OversampleH = 2;
|
||||||
|
config.OversampleV = 1;
|
||||||
|
config.GlyphOffset.y -= 1.0f; // Move everything by 1 pixels up
|
||||||
|
config.GlyphExtraSpacing.x = 1.0f; // Increase spacing between characters
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config);
|
||||||
|
|
||||||
|
// Combine multiple fonts into one (e.g. for icon fonts)
|
||||||
|
static ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
|
||||||
|
ImFontConfig config;
|
||||||
|
config.MergeMode = true;
|
||||||
|
io.Fonts->AddFontDefault();
|
||||||
|
io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); // Merge japanese glyphs
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
|
||||||
|
When loading a font, pass custom Unicode ranges to specify the glyphs to load.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// Add default Japanese ranges
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, io.Fonts->GetGlyphRangesJapanese());
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
ImVector<ImWchar> ranges;
|
||||||
|
ImFontGlyphRangesBuilder builder;
|
||||||
|
builder.AddText("Hello world"); // Add a string (here "Hello world" contains 7 unique characters)
|
||||||
|
builder.AddChar(0x7262); // Add a specific character
|
||||||
|
builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges
|
||||||
|
builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted)
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", 16.0f, NULL, ranges.Data);
|
||||||
|
```
|
||||||
|
|
||||||
|
All your strings needs to use UTF-8 encoding. In C++11 you can encode a string literal in UTF-8
|
||||||
|
by using the u8"hello" syntax. 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!
|
||||||
|
Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8.
|
||||||
|
|
||||||
|
Text input: it is up to your application to pass the right character code by calling io.AddInputCharacter().
|
||||||
|
The applications in examples/ are doing that.
|
||||||
|
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).
|
||||||
|
You may also use MultiByteToWideChar() or ToUnicode() to retrieve Unicode codepoints from MultiByte characters or keyboard state.
|
||||||
|
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.
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
||||||
|
|
||||||
|
# Q&A: Community
|
||||||
|
|
||||||
|
### Q: How can I help?
|
||||||
|
- If you are experienced with Dear ImGui and C++, look at the [GitHub Issues](https://github.com/ocornut/imgui/issues), look at 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!
|
||||||
|
- Businesses: convince your company to fund development via support contracts/sponsoring! This is among the most useful thing you can do for Dear ImGui. With increased funding we will be able to hire more people working on this project.
|
||||||
|
- Individuals: you can also become a [Patron](http://www.patreon.com/imgui) or donate on PayPal! See README.
|
||||||
|
- Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
|
||||||
|
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers.
|
||||||
|
But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
##### [Return to Index](#index)
|
376
Source/ThirdParty/ImGuiLibrary/Docs/FONTS.txt
vendored
Normal file
376
Source/ThirdParty/ImGuiLibrary/Docs/FONTS.txt
vendored
Normal file
@ -0,0 +1,376 @@
|
|||||||
|
dear imgui
|
||||||
|
FONTS DOCUMENTATION
|
||||||
|
|
||||||
|
Also read https://www.dearimgui.org/faq for more fonts related infos.
|
||||||
|
|
||||||
|
The code in imgui.cpp embeds a copy of 'ProggyClean.ttf' (by Tristan Grimmer),
|
||||||
|
a 13 pixels high, pixel-perfect font used by default.
|
||||||
|
We embed it font in source code so you can use Dear ImGui without any file system access.
|
||||||
|
|
||||||
|
You may also load external .TTF/.OTF files.
|
||||||
|
The files in this folder are suggested fonts, provided as a convenience.
|
||||||
|
|
||||||
|
Please read the FAQ: https://www.dearimgui.org/faq
|
||||||
|
Please use the Discord server: http://discord.dearimgui.org and not the Github issue tracker for basic font loading questions.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
INDEX:
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
- Readme First / FAQ
|
||||||
|
- Fonts Loading Instructions
|
||||||
|
- Using Icons
|
||||||
|
- Using FreeType rasterizer
|
||||||
|
- Building Custom Glyph Ranges
|
||||||
|
- Using custom colorful icons
|
||||||
|
- Embedding Fonts in Source Code
|
||||||
|
- Credits/Licences for fonts included in repository
|
||||||
|
- Fonts Links
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
README FIRST / FAQ
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
- You can use the style editor ImGui::ShowStyleEditor() in the "Fonts" section to browse your fonts
|
||||||
|
and understand what's going on if you have an issue.
|
||||||
|
- Fonts are rasterized in a single texture at the time of calling either of io.Fonts->GetTexDataAsAlpha8()/GetTexDataAsRGBA32()/Build().
|
||||||
|
- Make sure your font ranges data are persistent and available at the time the font atlas is being built.
|
||||||
|
- Use C++11 u8"my text" syntax to encode literal strings as UTF-8. e.g.:
|
||||||
|
u8"hello"
|
||||||
|
u8"こんにちは" // this will be encoded as UTF-8
|
||||||
|
- If you want to include a backslash \ character in your string literal, you need to double them e.g. "folder\\filename".
|
||||||
|
Read FAQ for details.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
FONTS LOADING INSTRUCTIONS
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Load default font:
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.Fonts->AddFontDefault();
|
||||||
|
|
||||||
|
Load .TTF/.OTF file with:
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
|
||||||
|
|
||||||
|
Load multiple fonts:
|
||||||
|
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
ImFont* font1 = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
|
||||||
|
ImFont* font2 = io.Fonts->AddFontFromFileTTF("anotherfont.otf", size_pixels);
|
||||||
|
|
||||||
|
// Select font at runtime
|
||||||
|
ImGui::Text("Hello"); // use the default font (which is the first loaded font)
|
||||||
|
ImGui::PushFont(font2);
|
||||||
|
ImGui::Text("Hello with another font");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
For advanced options create a ImFontConfig structure and pass it to the AddFont function (it will be copied internally):
|
||||||
|
|
||||||
|
ImFontConfig config;
|
||||||
|
config.OversampleH = 2;
|
||||||
|
config.OversampleV = 1;
|
||||||
|
config.GlyphExtraSpacing.x = 1.0f;
|
||||||
|
ImFont* font = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config);
|
||||||
|
|
||||||
|
Combine two fonts into one:
|
||||||
|
|
||||||
|
// Load a first font
|
||||||
|
ImFont* font = io.Fonts->AddFontDefault();
|
||||||
|
|
||||||
|
// Add character ranges and merge into the previous font
|
||||||
|
// The ranges array is not copied by the AddFont* functions and is used lazily
|
||||||
|
// so ensure it is available at the time of building or calling GetTexDataAsRGBA32().
|
||||||
|
static const ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; // Will not be copied by AddFont* so keep in scope.
|
||||||
|
ImFontConfig config;
|
||||||
|
config.MergeMode = true;
|
||||||
|
io.Fonts->AddFontFromFileTTF("DroidSans.ttf", 18.0f, &config, io.Fonts->GetGlyphRangesJapanese());
|
||||||
|
io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 18.0f, &config, icons_ranges);
|
||||||
|
io.Fonts->Build();
|
||||||
|
|
||||||
|
Font atlas is too large?
|
||||||
|
|
||||||
|
- If you have very large number of glyphs or multiple fonts, the texture may become too big for your graphics API.
|
||||||
|
- The typical result of failing to upload a texture is if every glyphs appears as white rectangles.
|
||||||
|
- In particular, using a large range such as GetGlyphRangesChineseSimplifiedCommon() is not recommended
|
||||||
|
unless you set OversampleH/OversampleV to 1 and use a small font size.
|
||||||
|
- Mind the fact that some graphics drivers have texture size limitation.
|
||||||
|
- If you are building a PC application, mind the fact that users may run on hardware with lower specs than yours.
|
||||||
|
|
||||||
|
Some solutions:
|
||||||
|
|
||||||
|
- 1) Reduce glyphs ranges by calculating them from source localization data.
|
||||||
|
You can use ImFontGlyphRangesBuilder for this purpose, this will be the biggest win!
|
||||||
|
- 2) You may reduce oversampling, e.g. config.OversampleH = config.OversampleV = 1, this will largely reduce your texture size.
|
||||||
|
- 3) Set io.Fonts.TexDesiredWidth to specify a texture width to minimize texture height (see comment in ImFontAtlas::Build function).
|
||||||
|
- 4) Set io.Fonts.Flags |= ImFontAtlasFlags_NoPowerOfTwoHeight; to disable rounding the texture height to the next power of two.
|
||||||
|
- Read about oversampling here: https://github.com/nothings/stb/blob/master/tests/oversample
|
||||||
|
|
||||||
|
|
||||||
|
Add a fourth parameter to bake specific font ranges only:
|
||||||
|
|
||||||
|
// Basic Latin, Extended Latin
|
||||||
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault());
|
||||||
|
|
||||||
|
// Default + Selection of 2500 Ideographs used by Simplified Chinese
|
||||||
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChineseSimplifiedCommon());
|
||||||
|
|
||||||
|
// Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
||||||
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese());
|
||||||
|
|
||||||
|
See "BUILDING CUSTOM GLYPH RANGES" section to create your own ranges.
|
||||||
|
Offset font vertically by altering the io.Font->DisplayOffset value:
|
||||||
|
|
||||||
|
ImFont* font = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
|
||||||
|
font->DisplayOffset.y = 1; // Render 1 pixel down
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
USING ICONS
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Using an icon font (such as FontAwesome: http://fontawesome.io or OpenFontIcons. https://github.com/traverseda/OpenFontIcons)
|
||||||
|
is an easy and practical way to use icons in your Dear ImGui application.
|
||||||
|
A common pattern is to merge the icon font within your main font, so you can embed icons directly from your strings without
|
||||||
|
having to change fonts back and forth.
|
||||||
|
|
||||||
|
To refer to the icon UTF-8 codepoints from your C++ code, you may use those headers files created by Juliette Foucaut:
|
||||||
|
|
||||||
|
https://github.com/juliettef/IconFontCppHeaders
|
||||||
|
|
||||||
|
Those files contains a bunch of named #define which you can use to refer to specific icons of the font, e.g.:
|
||||||
|
|
||||||
|
#define ICON_FA_MUSIC "\xef\x80\x81"
|
||||||
|
#define ICON_FA_SEARCH "\xef\x80\x82"
|
||||||
|
|
||||||
|
Example Setup:
|
||||||
|
|
||||||
|
// Merge icons into default tool font
|
||||||
|
#include "IconsFontAwesome.h"
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.Fonts->AddFontDefault();
|
||||||
|
|
||||||
|
ImFontConfig config;
|
||||||
|
config.MergeMode = true;
|
||||||
|
config.GlyphMinAdvanceX = 13.0f; // Use if you want to make the icon monospaced
|
||||||
|
static const ImWchar icon_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
|
||||||
|
io.Fonts->AddFontFromFileTTF("fonts/fontawesome-webfont.ttf", 13.0f, &config, icon_ranges);
|
||||||
|
|
||||||
|
Example Usage:
|
||||||
|
|
||||||
|
// Usage, e.g.
|
||||||
|
ImGui::Text("%s among %d items", ICON_FA_SEARCH, count);
|
||||||
|
ImGui::Button(ICON_FA_SEARCH " Search");
|
||||||
|
|
||||||
|
Important to understand: C string _literals_ can be concatenated at compilation time, e.g. "hello" " world"
|
||||||
|
ICON_FA_SEARCH is defined as a string literal so this is the same as "A" "B" becoming "AB"
|
||||||
|
|
||||||
|
See Links below for other icons fonts and related tools.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
FREETYPE RASTERIZER, SMALL FONT SIZES
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Dear ImGui uses imstb_truetype.h to rasterize fonts (with optional oversampling).
|
||||||
|
This technique and its implementation are not ideal for fonts rendered at _small sizes_, which may appear a
|
||||||
|
little blurry or hard to read.
|
||||||
|
|
||||||
|
There is an implementation of the ImFontAtlas builder using FreeType that you can use in the misc/freetype/ folder.
|
||||||
|
|
||||||
|
FreeType supports auto-hinting which tends to improve the readability of small fonts.
|
||||||
|
Note that this code currently creates textures that are unoptimally too large (could be fixed with some work).
|
||||||
|
Also note that correct sRGB space blending will have an important effect on your font rendering quality.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
BUILDING CUSTOM GLYPH RANGES
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
You can use the ImFontGlyphRangesBuilder helper to create glyph ranges based on text input.
|
||||||
|
For example: for a game where your script is known, if you can feed your entire script to it and only build the characters the game needs.
|
||||||
|
|
||||||
|
ImVector<ImWchar> ranges;
|
||||||
|
ImFontGlyphRangesBuilder builder;
|
||||||
|
builder.AddText("Hello world"); // Add a string (here "Hello world" contains 7 unique characters)
|
||||||
|
builder.AddChar(0x7262); // Add a specific character
|
||||||
|
builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges
|
||||||
|
builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted)
|
||||||
|
|
||||||
|
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, ranges.Data);
|
||||||
|
io.Fonts->Build(); // Build the atlas while 'ranges' is still in scope and not deleted.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
USING CUSTOM COLORFUL ICONS
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
(This is a BETA api, use if you are familiar with dear imgui and with your rendering back-end)
|
||||||
|
|
||||||
|
You can use the ImFontAtlas::AddCustomRect() and ImFontAtlas::AddCustomRectFontGlyph() api to register rectangles
|
||||||
|
that will be packed into the font atlas texture. Register them before building the atlas, then call Build().
|
||||||
|
You can then use ImFontAtlas::GetCustomRectByIndex(int) to query the position/size of your rectangle within the
|
||||||
|
texture, and blit/copy any graphics data of your choice into those rectangles.
|
||||||
|
|
||||||
|
Pseudo-code:
|
||||||
|
|
||||||
|
// Add font, then register two custom 13x13 rectangles mapped to glyph 'a' and 'b' of this font
|
||||||
|
ImFont* font = io.Fonts->AddFontDefault();
|
||||||
|
int rect_ids[2];
|
||||||
|
rect_ids[0] = io.Fonts->AddCustomRectFontGlyph(font, 'a', 13, 13, 13+1);
|
||||||
|
rect_ids[1] = io.Fonts->AddCustomRectFontGlyph(font, 'b', 13, 13, 13+1);
|
||||||
|
|
||||||
|
// Build atlas
|
||||||
|
io.Fonts->Build();
|
||||||
|
|
||||||
|
// Retrieve texture in RGBA format
|
||||||
|
unsigned char* tex_pixels = NULL;
|
||||||
|
int tex_width, tex_height;
|
||||||
|
io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_width, &tex_height);
|
||||||
|
|
||||||
|
for (int rect_n = 0; rect_n < IM_ARRAYSIZE(rect_ids); rect_n++)
|
||||||
|
{
|
||||||
|
int rect_id = rects_ids[rect_n];
|
||||||
|
if (const ImFontAtlas::CustomRect* rect = io.Fonts->GetCustomRectByIndex(rect_id))
|
||||||
|
{
|
||||||
|
// Fill the custom rectangle with red pixels (in reality you would draw/copy your bitmap data here!)
|
||||||
|
for (int y = 0; y < rect->Height; y++)
|
||||||
|
{
|
||||||
|
ImU32* p = (ImU32*)tex_pixels + (rect->Y + y) * tex_width + (rect->X);
|
||||||
|
for (int x = rect->Width; x > 0; x--)
|
||||||
|
*p++ = IM_COL32(255, 0, 0, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
EMBEDDING FONTS IN SOURCE CODE
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Compile and use 'binary_to_compressed_c.cpp' to create a compressed C style array that you can embed in source code.
|
||||||
|
See the documentation in binary_to_compressed_c.cpp for instruction on how to use the tool.
|
||||||
|
You may find a precompiled version binary_to_compressed_c.exe for Windows instead of demo binaries package (see README).
|
||||||
|
The tool can optionally output Base85 encoding to reduce the size of _source code_ but the read-only arrays in the
|
||||||
|
actual binary will be about 20% bigger.
|
||||||
|
|
||||||
|
Then load the font with:
|
||||||
|
ImFont* font = io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels, ...);
|
||||||
|
or:
|
||||||
|
ImFont* font = io.Fonts->AddFontFromMemoryCompressedBase85TTF(compressed_data_base85, size_pixels, ...);
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
CREDITS/LICENSES FOR FONTS INCLUDED IN REPOSITORY
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Some fonts are available in the misc/fonts/ folder:
|
||||||
|
|
||||||
|
Roboto-Medium.ttf
|
||||||
|
|
||||||
|
Apache License 2.0
|
||||||
|
by Christian Robertson
|
||||||
|
https://fonts.google.com/specimen/Roboto
|
||||||
|
|
||||||
|
Cousine-Regular.ttf
|
||||||
|
|
||||||
|
by Steve Matteson
|
||||||
|
Digitized data copyright (c) 2010 Google Corporation.
|
||||||
|
Licensed under the SIL Open Font License, Version 1.1
|
||||||
|
https://fonts.google.com/specimen/Cousine
|
||||||
|
|
||||||
|
DroidSans.ttf
|
||||||
|
|
||||||
|
Copyright (c) Steve Matteson
|
||||||
|
Apache License, version 2.0
|
||||||
|
https://www.fontsquirrel.com/fonts/droid-sans
|
||||||
|
|
||||||
|
ProggyClean.ttf
|
||||||
|
|
||||||
|
Copyright (c) 2004, 2005 Tristan Grimmer
|
||||||
|
MIT License
|
||||||
|
recommended loading setting: Size = 13.0, DisplayOffset.Y = +1
|
||||||
|
http://www.proggyfonts.net/
|
||||||
|
|
||||||
|
ProggyTiny.ttf
|
||||||
|
Copyright (c) 2004, 2005 Tristan Grimmer
|
||||||
|
MIT License
|
||||||
|
recommended loading setting: Size = 10.0, DisplayOffset.Y = +1
|
||||||
|
http://www.proggyfonts.net/
|
||||||
|
|
||||||
|
Karla-Regular.ttf
|
||||||
|
Copyright (c) 2012, Jonathan Pinhorn
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
FONTS LINKS
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
ICON FONTS
|
||||||
|
|
||||||
|
C/C++ header for icon fonts (#define with code points to use in source code string literals)
|
||||||
|
https://github.com/juliettef/IconFontCppHeaders
|
||||||
|
|
||||||
|
FontAwesome
|
||||||
|
https://fortawesome.github.io/Font-Awesome
|
||||||
|
|
||||||
|
OpenFontIcons
|
||||||
|
https://github.com/traverseda/OpenFontIcons
|
||||||
|
|
||||||
|
Google Icon Fonts
|
||||||
|
https://design.google.com/icons/
|
||||||
|
|
||||||
|
Kenney Icon Font (Game Controller Icons)
|
||||||
|
https://github.com/nicodinh/kenney-icon-font
|
||||||
|
|
||||||
|
IcoMoon - Custom Icon font builder
|
||||||
|
https://icomoon.io/app
|
||||||
|
|
||||||
|
REGULAR FONTS
|
||||||
|
|
||||||
|
Google Noto Fonts (worldwide languages)
|
||||||
|
https://www.google.com/get/noto/
|
||||||
|
|
||||||
|
Open Sans Fonts
|
||||||
|
https://fonts.google.com/specimen/Open+Sans
|
||||||
|
|
||||||
|
(Japanese) M+ fonts by Coji Morishita are free
|
||||||
|
http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html
|
||||||
|
|
||||||
|
MONOSPACE FONTS (PIXEL PERFECT)
|
||||||
|
|
||||||
|
Proggy Fonts, by Tristan Grimmer
|
||||||
|
http://www.proggyfonts.net or http://upperbounds.net
|
||||||
|
|
||||||
|
Sweet16, Sweet16 Mono, by Martin Sedlak (Latin + Supplemental + Extended A)
|
||||||
|
https://github.com/kmar/Sweet16Font
|
||||||
|
Also include .inl file to use directly in dear imgui.
|
||||||
|
|
||||||
|
MONOSPACE FONTS (REGULAR)
|
||||||
|
|
||||||
|
Google Noto Mono Fonts
|
||||||
|
https://www.google.com/get/noto/
|
||||||
|
|
||||||
|
Typefaces for source code beautification
|
||||||
|
https://github.com/chrissimpkins/codeface
|
||||||
|
|
||||||
|
Programmation fonts
|
||||||
|
http://s9w.github.io/font_compare/
|
||||||
|
|
||||||
|
Inconsolata
|
||||||
|
http://www.levien.com/type/myfonts/inconsolata.html
|
||||||
|
|
||||||
|
Adobe Source Code Pro: Monospaced font family for user interface and coding environments
|
||||||
|
https://github.com/adobe-fonts/source-code-pro
|
||||||
|
|
||||||
|
Monospace/Fixed Width Programmer's Fonts
|
||||||
|
http://www.lowing.org/fonts/
|
||||||
|
|
||||||
|
|
||||||
|
Or use Arial Unicode or other Unicode fonts provided with Windows for full characters coverage (not sure of their licensing).
|
237
Source/ThirdParty/ImGuiLibrary/Docs/README.md
vendored
Normal file
237
Source/ThirdParty/ImGuiLibrary/Docs/README.md
vendored
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
dear imgui
|
||||||
|
=====
|
||||||
|
[![Build Status](https://github.com/ocornut/imgui/workflows/build/badge.svg)](https://github.com/ocornut/imgui/actions?workflow=build)
|
||||||
|
[![Coverity Status](https://scan.coverity.com/projects/4720/badge.svg)](https://scan.coverity.com/projects/4720)
|
||||||
|
|
||||||
|
<sub>(This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal.)</sub>
|
||||||
|
|
||||||
|
Businesses: support continued development via invoiced technical support, maintenance, sponsoring contracts:
|
||||||
|
<br> _E-mail: contact @ dearimgui dot org_
|
||||||
|
|
||||||
|
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
||||||
|
<br> [![Patreon](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/patreon_02.png)](http://www.patreon.com/imgui)
|
||||||
|
|
||||||
|
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
||||||
|
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Dear ImGui is a **bloat-free graphical user interface library for C++**. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
|
||||||
|
|
||||||
|
Dear ImGui is designed to **enable fast iterations** and to **empower programmers** to create **content creation tools and visualization / debug tools** (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
| [Usage](#usage) - [How it works](#how-it-works) - [Demo](#demo) - [Integration](#integration) |
|
||||||
|
:----------------------------------------------------------: |
|
||||||
|
| [Upcoming changes](#upcoming-changes) - [Gallery](#gallery) - [Support, FAQ](#support-frequently-asked-questions-faq) - [How to help](#how-to-help) - [Sponsors](#sponsors) - [Credits](#credits) - [License](#license) |
|
||||||
|
| [Wiki](https://github.com/ocornut/imgui/wiki) - [Language & frameworks bindings](https://github.com/ocornut/imgui/wiki/Bindings) - [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) - [User quotes](https://github.com/ocornut/imgui/wiki/Quotes) |
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
**The core of Dear ImGui is self-contained within a few platform-agnostic files** which you can easily copy and compile into your application/engine. They are all the files in the root folder of the repository (imgui.cpp, imgui.h, imgui_demo.cpp, imgui_draw.cpp etc.).
|
||||||
|
|
||||||
|
**No specific build process is required**. You can add the .cpp files to your existing project.
|
||||||
|
|
||||||
|
You will need a backend to integrate Dear ImGui in your app. The backend passes mouse/keyboard/gamepad inputs and variety of settings to Dear ImGui, and is in charge of rendering the resulting vertices.
|
||||||
|
|
||||||
|
**Backends for a variety of graphics api and rendering platforms** are provided in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder, along with example applications. See the [Integration](#integration) section of this document for details. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.
|
||||||
|
|
||||||
|
After Dear ImGui is setup in your application, you can use it from \_anywhere\_ in your program loop:
|
||||||
|
|
||||||
|
Code:
|
||||||
|
```cp
|
||||||
|
ImGui::Text("Hello, world %d", 123);
|
||||||
|
if (ImGui::Button("Save"))
|
||||||
|
MySaveFunction();
|
||||||
|
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
|
||||||
|
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
|
||||||
|
```
|
||||||
|
Result:
|
||||||
|
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_02.png)
|
||||||
|
<br>_(settings: Dark style (left), Light style (right) / Font: Roboto-Medium, 16px / Rounding: 5)_
|
||||||
|
|
||||||
|
Code:
|
||||||
|
```cpp
|
||||||
|
// Create a window called "My First Tool", with a menu bar.
|
||||||
|
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
|
||||||
|
if (ImGui::BeginMenuBar())
|
||||||
|
{
|
||||||
|
if (ImGui::BeginMenu("File"))
|
||||||
|
{
|
||||||
|
if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ }
|
||||||
|
if (ImGui::MenuItem("Save", "Ctrl+S")) { /* Do stuff */ }
|
||||||
|
if (ImGui::MenuItem("Close", "Ctrl+W")) { my_tool_active = false; }
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
ImGui::EndMenuBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit a color (stored as ~4 floats)
|
||||||
|
ImGui::ColorEdit4("Color", my_color);
|
||||||
|
|
||||||
|
// Plot some values
|
||||||
|
const float my_values[] = { 0.2f, 0.1f, 1.0f, 0.5f, 0.9f, 2.2f };
|
||||||
|
ImGui::PlotLines("Frame Times", my_values, IM_ARRAYSIZE(my_values));
|
||||||
|
|
||||||
|
// Display contents in a scrolling region
|
||||||
|
ImGui::TextColored(ImVec4(1,1,0,1), "Important Stuff");
|
||||||
|
ImGui::BeginChild("Scrolling");
|
||||||
|
for (int n = 0; n < 50; n++)
|
||||||
|
ImGui::Text("%04d: Some text", n);
|
||||||
|
ImGui::EndChild();
|
||||||
|
ImGui::End();
|
||||||
|
```
|
||||||
|
Result:
|
||||||
|
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_03_color.gif)
|
||||||
|
|
||||||
|
Dear ImGui allows you **create elaborate tools** as well as very short-lived ones. On the extreme side of short-liveness: using the Edit&Continue (hot code reload) feature of modern compilers you can add a few widgets to tweaks variables while your application is running, and remove the code a minute later! Dear ImGui is not just for tweaking values. You can use it to trace a running algorithm by just emitting text commands. You can use it along with your own reflection data to browse your dataset live. You can use it to expose the internals of a subsystem in your engine, to create a logger, an inspection tool, a profiler, a debugger, an entire game making editor/framework, etc.
|
||||||
|
|
||||||
|
### How it works
|
||||||
|
|
||||||
|
Check out the Wiki's [About the IMGUI paradigm](https://github.com/ocornut/imgui/wiki#About-the-IMGUI-paradigm) section if you want to understand the core principles behind the IMGUI paradigm. An IMGUI tries to minimize superfluous state duplication, state synchronization and state retention from the user's point of view. It is less error prone (less code and less bugs) than traditional retained-mode interfaces, and lends itself to create dynamic user interfaces.
|
||||||
|
|
||||||
|
Dear ImGui outputs vertex buffers and command lists that you can easily render in your application. The number of draw calls and state changes required to render them is fairly small. Because Dear ImGui doesn't know or touch graphics state directly, you can call its functions anywhere in your code (e.g. in the middle of a running algorithm, or in the middle of your own rendering process). Refer to the sample applications in the examples/ folder for instructions on how to integrate dear imgui with your existing codebase.
|
||||||
|
|
||||||
|
_A common misunderstanding is to mistake immediate mode gui for immediate mode rendering, which usually implies hammering your driver/GPU with a bunch of inefficient draw calls and state changes as the gui functions are called. This is NOT what Dear ImGui does. Dear ImGui outputs vertex buffers and a small list of draw calls batches. It never touches your GPU directly. The draw call batches are decently optimal and you can render them later, in your app or even remotely._
|
||||||
|
|
||||||
|
### Demo
|
||||||
|
|
||||||
|
Calling the `ImGui::ShowDemoWindow()` function will create a demo window showcasing variety of features and examples. The code is always available for reference in `imgui_demo.cpp`.
|
||||||
|
|
||||||
|
![screenshot demo](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/v167-misc.png)
|
||||||
|
|
||||||
|
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
|
||||||
|
- [imgui-demo-binaries-20190715.zip](http://www.dearimgui.org/binaries/imgui-demo-binaries-20190715.zip) (Windows binaries, 1.72 WIP, built 2019/07/15, master branch, 5 executables)
|
||||||
|
|
||||||
|
The demo applications are not DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at different scale, and scale your style with `style.ScaleAllSizes()`.
|
||||||
|
|
||||||
|
### Integration
|
||||||
|
|
||||||
|
On most platforms and when using C++, **you should be able to use a combination of the [imgui_impl_xxxx](https://github.com/ocornut/imgui/tree/master/examples) files without modification** (e.g. `imgui_impl_win32.cpp` + `imgui_impl_dx11.cpp`). If your engine supports multiple platforms, consider using more of the imgui_impl_xxxx files instead of rewriting them: this will be less work for you and you can get Dear ImGui running immediately. You can _later_ decide to rewrite a custom binding using your custom engine functions if you wish so.
|
||||||
|
|
||||||
|
Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading one texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that. If you are an experienced programmer at ease with those concepts, it should take you less than two hours to integrate Dear ImGui in your custom engine. **Make sure to spend time reading the [FAQ](https://www.dearimgui.org/faq), comments, and some of the examples/ application!**
|
||||||
|
|
||||||
|
Officially maintained bindings (in repository):
|
||||||
|
- Renderers: DirectX9, DirectX10, DirectX11, DirectX12, OpenGL (legacy), OpenGL3/ES/ES2 (modern), Vulkan, Metal.
|
||||||
|
- Platforms: GLFW, SDL2, Win32, Glut, OSX.
|
||||||
|
- Frameworks: Emscripten, Allegro5, Marmalade.
|
||||||
|
|
||||||
|
Third-party bindings (see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings/) page):
|
||||||
|
- Languages: C, C#/.Net, ChaiScript, D, Go, Haxe/hxcpp, Java, JavaScript, Julia, Lua, Odin, Pascal, PureBasic, Python, Ruby, Rust, Swift...
|
||||||
|
- Frameworks: Amethyst, bsf, Cinder, Cocos2d-x, Diligent Engine, Flexium, GML/GameMakerStudio2, Irrlicht, Ogre, OpenFrameworks, OpenSceneGraph/OSG, ORX, px_render, LÖVE+Lua, Magnum, NanoRT, Qt, QtDirect3D, SFML, Software Rasterizers, Unreal Engine 4...
|
||||||
|
- Note that C bindings ([cimgui](https://github.com/cimgui/cimgui)) are auto-generated, you can use its json/lua output to generate bindings for other languages.
|
||||||
|
|
||||||
|
Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas.
|
||||||
|
|
||||||
|
### Upcoming Changes
|
||||||
|
|
||||||
|
Some of the goals for 2019+ are:
|
||||||
|
- Finish work on docking, tabs. (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch looking for feedback)
|
||||||
|
- Finish work on multiple viewports / multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch looking for feedback)
|
||||||
|
- Finish work on gamepad/keyboard controls. (see [#787](https://github.com/ocornut/imgui/issues/787))
|
||||||
|
- Add an automation and testing system, both to test the library and end-user apps. (see [#435](https://github.com/ocornut/imgui/issues/435))
|
||||||
|
- Make Columns better. They are currently pretty terrible! New Tables API coming Q4 2019!
|
||||||
|
- Make the examples look better, improve styles, improve font support, make the examples hi-DPI and multi-DPI aware.
|
||||||
|
|
||||||
|
### Gallery
|
||||||
|
|
||||||
|
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/2847)!
|
||||||
|
|
||||||
|
Custom engine
|
||||||
|
[![screenshot game](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v149/gallery_TheDragonsTrap-01-thumb.jpg)](https://cloud.githubusercontent.com/assets/8225057/20628927/33e14cac-b329-11e6-80f6-9524e93b048a.png)
|
||||||
|
|
||||||
|
Custom engine
|
||||||
|
[![screenshot tool](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white_preview.jpg)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white.png)
|
||||||
|
|
||||||
|
[Tracy Profiler](https://bitbucket.org/wolfpld/tracy)
|
||||||
|
![tracy profiler](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v173/tracy_profiler.jpg)
|
||||||
|
|
||||||
|
### Support, Frequently Asked Questions (FAQ)
|
||||||
|
|
||||||
|
Most common questions will be answered by the [Frequently Asked Questions (FAQ)](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md) page.
|
||||||
|
|
||||||
|
See: [Wiki](https://github.com/ocornut/imgui/wiki) for many links, references, articles.
|
||||||
|
|
||||||
|
See: [Articles about the IMGUI paradigm](https://github.com/ocornut/imgui/wiki#Articles-about-the-IMGUI-paradigm) to read/learn about the Immediate Mode GUI paradigm.
|
||||||
|
|
||||||
|
If you are new to Dear ImGui and have issues with: compiling, linking, adding fonts, wiring inputs, running or displaying Dear ImGui: you can use [Discord server](http://discord.dearimgui.org).
|
||||||
|
|
||||||
|
Otherwise, for any other questions, bug reports, requests, feedback, you may post on https://github.com/ocornut/imgui/issues. Please read and fill the New Issue template carefully.
|
||||||
|
|
||||||
|
Paid private support is available for business customers (E-mail: _contact @ dearimgui dot org_).
|
||||||
|
|
||||||
|
**Which version should I get?**
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You may also peak at the [Multi-Viewport](https://github.com/ocornut/imgui/issues/1542) and [Docking](https://github.com/ocornut/imgui/issues/2109) features in the `docking` branch. Many projects are using this branch and it is kept in sync with master regularly.
|
||||||
|
|
||||||
|
**Who uses Dear ImGui?**
|
||||||
|
|
||||||
|
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) and [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for a list of games/software which are publicly known to use dear imgui. Please add yours if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/2847)!
|
||||||
|
|
||||||
|
How to help
|
||||||
|
-----------
|
||||||
|
|
||||||
|
**How can I help?**
|
||||||
|
|
||||||
|
- You may participate in the [Discord server](http://discord.dearimgui.org), [GitHub forum/issues](https://github.com/ocornut/imgui/issues).
|
||||||
|
- You may help with development and submit pull requests! Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
|
||||||
|
- See [Help wanted](https://github.com/ocornut/imgui/wiki/Help-Wanted) on the [Wiki](https://github.com/ocornut/imgui/wiki/) for some more ideas.
|
||||||
|
- Have your company financially support this project.
|
||||||
|
|
||||||
|
**How can I help financing further development of Dear ImGui?**
|
||||||
|
|
||||||
|
Your contributions are keeping this project alive. The library is available under a free and permissive license, but continued maintenance and development are a full-time endeavor and I would like to grow the team. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out for invoiced technical support and maintenance contracts. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal. Thank you!
|
||||||
|
|
||||||
|
Businesses: support continued development via invoiced technical support, maintenance, sponsoring contracts:
|
||||||
|
<br> _E-mail: contact @ dearimgui dot org_
|
||||||
|
|
||||||
|
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
||||||
|
<br> [![Patreon](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/patreon_02.png)](http://www.patreon.com/imgui)
|
||||||
|
|
||||||
|
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
||||||
|
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
||||||
|
|
||||||
|
### Sponsors
|
||||||
|
|
||||||
|
Ongoing Dear ImGui development is financially supported by users and private sponsors, recently:
|
||||||
|
|
||||||
|
*Platinum-chocolate sponsors*
|
||||||
|
- Blizzard Entertainment
|
||||||
|
- Google
|
||||||
|
|
||||||
|
*Double-chocolate sponsors*
|
||||||
|
- Media Molecule, Mobigame, Aras Pranckevičius, Greggman, DotEmu, Nadeo, Supercell, Runner, Aiden Koss, Kylotonn.
|
||||||
|
|
||||||
|
*Salty caramel supporters*
|
||||||
|
- Remedy Entertainment, Next Level Games, Recognition Robotics, ikrima, Geoffrey Evans, Mercury Labs, Singularity Demo Group, Lionel Landwerlin, Ron Gilbert, Brandon Townsend, G3DVu, Cort Stratton, drudru, Harfang 3D, Jeff Roberts, Rainway inc, Ondra Voves, Mesh Consultants, Unit 2 Games, Neil Bickford, Bill Six, Graham Manders.
|
||||||
|
|
||||||
|
*Caramel supporters*
|
||||||
|
- Jerome Lanquetot, Daniel Collin, Ctrl Alt Ninja, Neil Henning, Neil Blakey-Milner, Aleksei, NeiloGD, Eric, Game Atelier, Vincent Hamm, Morten Skaaning, Colin Riley, Sergio Gonzales, Andrew Berridge, Roy Eltham, Game Preservation Society, Josh Faust, Martin Donlon, Codecat, Doug McNabb, Emmanuel Julien, Guillaume Chereau, Jeffrey Slutter, Jeremiah Deckard, r-lyeh, Nekith, Joshua Fisher, Malte Hoffmann, Mustafa Karaalioglu, Merlyn Morgan-Graham, Per Vognsen, Fabian Giesen, Jan Staubach, Matt Hargett, John Shearer, Jesse Chounard, kingcoopa, Jonas Bernemann, Johan Andersson, Michael Labbe, Tomasz Golebiowski, Louis Schnellbach, Jimmy Andrews, Bojan Endrovski, Robin Berg Pettersen, Rachel Crawford, Andrew Johnson, Sean Hunter, Jordan Mellow, Nefarius Software Solutions, Laura Wieme, Robert Nix, Mick Honey, Steven Kah Hien Wong, Bartosz Bielecki, Oscar Penas, A M, Liam Moynihan, Artometa, Mark Lee, Dimitri Diakopoulos, Pete Goodwin, Johnathan Roatch, nyu lea, Oswald Hurlem, Semyon Smelyanskiy, Le Bach, Jeong MyeongSoo, Chris Matthews, Astrofra, Frederik De Bleser, Anticrisis, Matt Reyer.
|
||||||
|
|
||||||
|
And all other past and present supporters; THANK YOU!
|
||||||
|
(Please contact me if you would like to be added or removed from this list)
|
||||||
|
|
||||||
|
Dear ImGui is using software and services kindly provided free of charge for open source projects:
|
||||||
|
- [PVS-Studio](https://www.viva64.com/en/b/0570/) for static analysis.
|
||||||
|
- [GitHub actions](https://github.com/features/actions) for continuous integration systems.
|
||||||
|
|
||||||
|
Credits
|
||||||
|
-------
|
||||||
|
|
||||||
|
Developed by [Omar Cornut](http://www.miracleworld.net) and every direct or indirect contributors to the GitHub. The early version of this library was developed with the support of [Media Molecule](http://www.mediamolecule.com) and first used internally on the game [Tearaway](http://tearaway.mediamolecule.com) (Vita).
|
||||||
|
|
||||||
|
I first discovered the IMGUI paradigm at [Q-Games](http://www.q-games.com) where Atman Binstock had dropped his own simple implementation in the codebase, which I spent quite some time improving and thinking about. It turned out that Atman was exposed to the concept directly by working with Casey. When I moved to Media Molecule I rewrote a new library trying to overcome the flaws and limitations of the first one I've worked with. It became this library and since then I have spent an unreasonable amount of time iterating and improving it.
|
||||||
|
|
||||||
|
Embeds [ProggyClean.ttf](http://upperbounds.net) font by Tristan Grimmer (MIT license).
|
||||||
|
|
||||||
|
Embeds [stb_textedit.h, stb_truetype.h, stb_rect_pack.h](https://github.com/nothings/stb/) by Sean Barrett (public domain).
|
||||||
|
|
||||||
|
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
Dear ImGui is licensed under the MIT License, see [LICENSE.txt](https://github.com/ocornut/imgui/blob/master/LICENSE.txt) for more information.
|
@ -8,16 +8,13 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- doc/test: add a proper documentation+regression testing system (#435)
|
- doc/test: add a proper documentation+regression testing system (#435)
|
||||||
- doc/test: checklist app to verify binding/integration of imgui (test inputs, rendering, callback, etc.).
|
- doc/test: checklist app to verify binding/integration of imgui (test inputs, rendering, callback, etc.).
|
||||||
- doc/tips: tips of the day: website? applet in imgui_club?
|
- doc/tips: tips of the day: website? applet in imgui_club?
|
||||||
- project: folder or separate repository with maintained helpers (e.g. imgui_memory_editor.h, imgui_stl.h, maybe imgui_dock would be there?)
|
|
||||||
|
|
||||||
|
- window: preserve/restore relative focus ordering (persistent or not) (#2304) -> also see docking reference to same #.
|
||||||
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). (#690)
|
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). (#690)
|
||||||
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
|
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
|
||||||
- window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column) appears weird to end-user. clarify.
|
- window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column) appears weird to end-user. clarify.
|
||||||
- window: allow resizing of child windows (possibly given min/max for each axis?.)
|
- window: allow resizing of child windows (possibly given min/max for each axis?.)
|
||||||
- window: background options for child windows, border option (disable rounding).
|
- window: background options for child windows, border option (disable rounding).
|
||||||
- window: resizing from any sides? done. > need backends to honor mouse cursors properly. (#822)
|
|
||||||
- window: resize from borders: support some form of outer padding to make it easier to grab borders. (#822)
|
|
||||||
- window: fix resize glitch when collapsing an AlwaysAutoResize window.
|
|
||||||
- window: begin with *p_open == false could return false.
|
- window: begin with *p_open == false could return false.
|
||||||
- window: get size/pos helpers given names (see discussion in #249)
|
- window: get size/pos helpers given names (see discussion in #249)
|
||||||
- window: a collapsed window can be stuck behind the main menu bar?
|
- window: a collapsed window can be stuck behind the main menu bar?
|
||||||
@ -28,25 +25,36 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- window: expose contents size. (#1045)
|
- window: expose contents size. (#1045)
|
||||||
- window: using SetWindowPos() inside Begin() and moving the window with the mouse reacts a very ugly glitch. We should just defer the SetWindowPos() call.
|
- window: using SetWindowPos() inside Begin() and moving the window with the mouse reacts a very ugly glitch. We should just defer the SetWindowPos() call.
|
||||||
- window: GetWindowSize() returns (0,0) when not calculated? (#1045)
|
- window: GetWindowSize() returns (0,0) when not calculated? (#1045)
|
||||||
- window: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate.
|
|
||||||
- window: investigate better auto-positioning for new windows.
|
- window: investigate better auto-positioning for new windows.
|
||||||
|
- window: top most window flag? (#2574)
|
||||||
|
- window/opt: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate. -> this may require enforcing that it is illegal to submit contents if Begin returns false.
|
||||||
|
- window/child: the first draw command of a child window could be moved into the current draw command of the parent window (unless child+tooltip?).
|
||||||
|
- window/child: border could be emitted in parent as well.
|
||||||
|
- window/child: allow SetNextWindowContentSize() to work on child windows.
|
||||||
|
- window/clipping: some form of clipping when DisplaySize (or corresponding viewport) is zero.
|
||||||
|
- window/tab: add a way to signify that a window or docked window requires attention (e.g. blinking title bar).
|
||||||
|
! scrolling: exposing horizontal scrolling with Shift+Wheel even when scrollbar is disabled expose lots of issues (#2424, #1463)
|
||||||
|
- scrolling: while holding down a scrollbar, try to keep the same contents visible (at least while not moving mouse)
|
||||||
- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
|
- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
|
||||||
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
|
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
|
||||||
- scrolling/style: shadows on scrollable areas to denote that there is more contents
|
- scrolling/style: shadows on scrollable areas to denote that there is more contents
|
||||||
|
|
||||||
- drawdata: make it easy to clone (or swap?) a ImDrawData so user can easily save that data if they use threaded rendering.
|
- drawdata: make it easy to clone (or swap?) a full ImDrawData so user can easily save that data if they use threaded rendering. (e.g. #2646)
|
||||||
|
! drawlist: add calctextsize func to facilitate consistent code from user pov (currently need to use ImGui or ImFont alternatives!)
|
||||||
- drawlist: end-user probably can't call Clear() directly because we expect a texture to be pushed in the stack.
|
- drawlist: end-user probably can't call Clear() directly because we expect a texture to be pushed in the stack.
|
||||||
- drawlist: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
|
- drawlist: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
|
||||||
- drawlist: primitives/helpers to manipulate vertices post submission, so e.g. a quad/rect can be resized to fit later submitted content, _without_ using the ChannelSplit api
|
- drawlist: primitives/helpers to manipulate vertices post submission, so e.g. a quad/rect can be resized to fit later submitted content, _without_ using the ChannelSplit api
|
||||||
- drawlist: make it easier to toggle AA per primitive, so we can use e.g. non-AA fill + AA borders more naturally
|
- drawlist: make it easier to toggle AA per primitive, so we can use e.g. non-AA fill + AA borders more naturally
|
||||||
- drawlist: non-AA strokes have gaps between points (#593, #288), especially RenderCheckmark().
|
- drawlist: non-AA strokes have gaps between points (#593, #288), glitch especially on RenderCheckmark() and ColorPicker4().
|
||||||
- drawlist: would be good to be able to deep copy of ImDrawData (we have a deep copy of ImDrawList now).
|
- drawlist: would be good to be able to deep copy of ImDrawData (we have a deep copy of ImDrawList now).
|
||||||
- drawlist: rendering: provide a way for imgui to output to a single/global vertex buffer, re-order indices only at the end of the frame (ref: https://gist.github.com/floooh/10388a0afbe08fce9e617d8aefa7d302)
|
- drawlist: rendering: provide a way for imgui to output to a single/global vertex buffer, re-order indices only at the end of the frame (ref: https://gist.github.com/floooh/10388a0afbe08fce9e617d8aefa7d302)
|
||||||
- drawlist: callback: add an extra void* in ImDrawCallback to allow passing render-local data to the callback (would break API).
|
- drawlist: callback: add an extra void* in ImDrawCallback to allow passing render-local data to the callback (would break API).
|
||||||
|
- drawlist: AddRect vs AddLine position confusing (#2441)
|
||||||
|
- drawlist: channel splitter should be external helper and not stored in ImDrawList.
|
||||||
- drawlist/opt: store rounded corners in texture to use 1 quad per corner (filled and wireframe) to lower the cost of rounding. (#1962)
|
- drawlist/opt: store rounded corners in texture to use 1 quad per corner (filled and wireframe) to lower the cost of rounding. (#1962)
|
||||||
- drawlist/opt: AddRect() axis aligned pixel aligned (no-aa) could use 8 triangles instead of 16 and no normal calculation.
|
- drawlist/opt: AddRect() axis aligned pixel aligned (no-aa) could use 8 triangles instead of 16 and no normal calculation.
|
||||||
|
- drawlist/opt: thick AA line could be doable in same number of triangles as 1.0 AA line by storing gradient+full color in atlas.
|
||||||
|
|
||||||
- main: considering adding an Init() function? some constructs are awkward in the implementation because of the lack of them.
|
|
||||||
- main: find a way to preserve relative orders of multiple reappearing windows (so an app toggling between "modes" e.g. fullscreen vs all tools) won't lose relative ordering.
|
- main: find a way to preserve relative orders of multiple reappearing windows (so an app toggling between "modes" e.g. fullscreen vs all tools) won't lose relative ordering.
|
||||||
- main: IsItemHovered() make it more consistent for various type of widgets, widgets with multiple components, etc. also effectively IsHovered() region sometimes differs from hot region, e.g tree nodes
|
- main: IsItemHovered() make it more consistent for various type of widgets, widgets with multiple components, etc. also effectively IsHovered() region sometimes differs from hot region, e.g tree nodes
|
||||||
- main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
|
- main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
|
||||||
@ -55,11 +63,16 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc. (#395)
|
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc. (#395)
|
||||||
- widgets: clean up widgets internal toward exposing everything and stabilizing imgui_internals.h.
|
- widgets: clean up widgets internal toward exposing everything and stabilizing imgui_internals.h.
|
||||||
- widgets: add visuals for Disabled/ReadOnly mode and expose publicly (#211)
|
- widgets: add visuals for Disabled/ReadOnly mode and expose publicly (#211)
|
||||||
- widgets: add always-allow-overlap mode.
|
- widgets: add always-allow-overlap mode. This should perhaps be the default? one problem is that highlight after mouse-wheel scrolling gets deferred, makes scrolling more flickery.
|
||||||
- widgets: start exposing PushItemFlag() and ImGuiItemFlags
|
- widgets: start exposing PushItemFlag() and ImGuiItemFlags
|
||||||
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
|
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
|
||||||
- widgets: activate by identifier (trigger button, focus given id)
|
- widgets: activate by identifier (trigger button, focus given id)
|
||||||
- widgets: a way to represent "mixed" values, so e.g. all values replaced with **, including check-boxes, colors, etc. with support for multi-components widgets (e.g. SliderFloat3, make only "Y" mixed)
|
- widgets: a way to represent "mixed" values, so e.g. all values replaced with *, including check-boxes, colors, etc. with support for multi-components widgets (e.g. SliderFloat3, make only "Y" mixed) (#2644)
|
||||||
|
- widgets: selectable: generic BeginSelectable()/EndSelectable() mechanism.
|
||||||
|
- widgets: selectable: a way to visualize partial/mixed selection (e.g. parent tree node has children with mixed selection)
|
||||||
|
- widgets: checkbox: checkbox with custom glyph inside frame.
|
||||||
|
- widgets: coloredit: keep reporting as active when picker is on?
|
||||||
|
- widgets: group/scalarn functions: expose more per-component information. e.g. store NextItemData.ComponentIdx set by scalarn function, groups can expose them back somehow.
|
||||||
|
|
||||||
- input text: clean up the mess caused by converting UTF-8 <> wchar. the code is rather inefficient right now and super fragile.
|
- input text: clean up the mess caused by converting UTF-8 <> wchar. the code is rather inefficient right now and super fragile.
|
||||||
- input text: reorganize event handling, allow CharFilter to modify buffers, allow multiple events? (#541)
|
- input text: reorganize event handling, allow CharFilter to modify buffers, allow multiple events? (#541)
|
||||||
@ -73,7 +86,14 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- input text: add discard flag (e.g. ImGuiInputTextFlags_DiscardActiveBuffer) or make it easier to clear active focus for text replacement during edition (#725)
|
- input text: add discard flag (e.g. ImGuiInputTextFlags_DiscardActiveBuffer) or make it easier to clear active focus for text replacement during edition (#725)
|
||||||
- input text: display bug when clicking a drag/slider after an input text in a different window has all-selected text (order dependent). actually a very old bug but no one appears to have noticed it.
|
- input text: display bug when clicking a drag/slider after an input text in a different window has all-selected text (order dependent). actually a very old bug but no one appears to have noticed it.
|
||||||
- input text: allow centering/positioning text so that ctrl+clicking Drag or Slider keeps the textual value at the same pixel position.
|
- input text: allow centering/positioning text so that ctrl+clicking Drag or Slider keeps the textual value at the same pixel position.
|
||||||
- input text: what's the easiest way to implement a nice IP/Mac address input editor?
|
- input text: decorrelate layout from inputs - e.g. what's the easiest way to implement a nice IP/Mac address input editor?
|
||||||
|
- input text: global callback system so user can plug in an expression evaluator easily. (#1691)
|
||||||
|
- input text: force scroll to end or scroll to a given line/contents (so user can implement a log or a search feature)
|
||||||
|
- input text: a way to preview completion (e.g. disabled text completing from the cursor)
|
||||||
|
- input text: a side bar that could e.g. preview where errors are. probably left to the user to draw but we'd need to give them the info there.
|
||||||
|
- input text: a way for the user to provide syntax coloring.
|
||||||
|
- input text: Shift+TAB with ImGuiInputTextFlags_AllowTabInput could eat preceding blanks, up to tab_count.
|
||||||
|
- input text: facilitate patterns like if (InputText(..., obj.get_string_ref()) { obj.set_string(...); } relying on internally held buffer.
|
||||||
- input text multi-line: don't directly call AddText() which does an unnecessary vertex reserve for character count prior to clipping. and/or more line-based clipping to AddText(). and/or reorganize TextUnformatted/RenderText for more efficiency for large text (e.g TextUnformatted could clip and log separately, etc).
|
- input text multi-line: don't directly call AddText() which does an unnecessary vertex reserve for character count prior to clipping. and/or more line-based clipping to AddText(). and/or reorganize TextUnformatted/RenderText for more efficiency for large text (e.g TextUnformatted could clip and log separately, etc).
|
||||||
- input text multi-line: support for cut/paste without selection (cut/paste the current line)
|
- input text multi-line: support for cut/paste without selection (cut/paste the current line)
|
||||||
- input text multi-line: line numbers? status bar? (follow up on #200)
|
- input text multi-line: line numbers? status bar? (follow up on #200)
|
||||||
@ -91,16 +111,23 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- layout: horizontal flow until no space left (#404)
|
- layout: horizontal flow until no space left (#404)
|
||||||
- layout: more generic alignment state (left/right/centered) for single items?
|
- layout: more generic alignment state (left/right/centered) for single items?
|
||||||
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
|
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
|
||||||
- layout: BeginGroup() needs a border option. (~#1496)
|
|
||||||
- layout: vertical alignment of mixed height items (e.g. buttons) within a same line (#1284)
|
- layout: vertical alignment of mixed height items (e.g. buttons) within a same line (#1284)
|
||||||
|
- layout: null layout mode were items are not rendered but user can query GetItemRectMin()/Max/Size.
|
||||||
|
- layout: (R&D) local multi-pass layout mode.
|
||||||
|
- layout: (R&D) bind authored layout data (created by an off-line tool), items fetch their pos/size at submission, self-optimize data structures to stable linear access.
|
||||||
|
|
||||||
|
- group: BeginGroup() needs a border option. (~#1496)
|
||||||
|
- group: IsHovered() after EndGroup() covers whole aabb rather than the intersection of individual items. Is that desirable?
|
||||||
|
- group: merge deactivation/activation within same group (fwd WasEdited flag). (#2550)
|
||||||
|
|
||||||
- columns: sizing policy (e.g. for each column: fixed size, %, fill, distribute default size among fills) (#513, #125)
|
- columns: sizing policy (e.g. for each column: fixed size, %, fill, distribute default size among fills) (#513, #125)
|
||||||
- columns: add a conditional parameter to SetColumnOffset() (#513, #125)
|
- columns: add a conditional parameter to SetColumnOffset() (#513, #125)
|
||||||
- columns: headers. reorderable. (#513, #125)
|
- columns: headers. re-orderable. (#513, #125)
|
||||||
- columns: optional sorting modifiers (up/down), sort list so sorting can be done multi-criteria. notify user when sort order changed.
|
- columns: optional sorting modifiers (up/down), sort list so sorting can be done multi-criteria. notify user when sort order changed.
|
||||||
- columns: option to alternate background colors on odd/even scanlines.
|
- columns: option to alternate background colors on odd/even scanlines.
|
||||||
- columns: allow columns to recurse.
|
- columns: allow columns to recurse.
|
||||||
- columns: allow a same columns set to be interrupted by e.g. CollapsingHeader and resume with columns in sync when moving them.
|
- columns: allow a same columns set to be interrupted by e.g. CollapsingHeader and resume with columns in sync when moving them.
|
||||||
|
- columns: sizing is lossy when columns width is very small (default width may turn negative etc.)
|
||||||
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (#125)
|
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (#125)
|
||||||
- columns: flag to add horizontal separator above/below?
|
- columns: flag to add horizontal separator above/below?
|
||||||
- columns/layout: setup minimum line height (equivalent of automatically calling AlignFirstTextHeightToWidgets)
|
- columns/layout: setup minimum line height (equivalent of automatically calling AlignFirstTextHeightToWidgets)
|
||||||
@ -120,20 +147,23 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- clipper: ability to force display 1 item in the list would be convenient (for patterns where we need to set active id etc.)
|
- clipper: ability to force display 1 item in the list would be convenient (for patterns where we need to set active id etc.)
|
||||||
- clipper: ability to disable the clipping through a simple flag/bool.
|
- clipper: ability to disable the clipping through a simple flag/bool.
|
||||||
- clipper: ability to run without knowing full count in advance.
|
- clipper: ability to run without knowing full count in advance.
|
||||||
|
- clipper: horizontal clipping support. (#2580)
|
||||||
|
|
||||||
- splitter/separator: formalize the splitter idiom into an official api (we want to handle n-way split) (#319)
|
- separator: expose flags (#759)
|
||||||
|
- separator: width, thickness, centering (#1643)
|
||||||
|
- splitter: formalize the splitter idiom into an official api (we want to handle n-way split) (#319)
|
||||||
|
|
||||||
- dock: docking extension
|
- dock: merge docking branch (#2109)
|
||||||
- dock: dock out from a collapsing header? would work nicely but need emitting window to keep submitting the code.
|
- dock: dock out from a collapsing header? would work nicely but need emitting window to keep submitting the code.
|
||||||
|
|
||||||
- tabs: re-ordering, close buttons, context menu, persistent order (#261, #351)
|
- tabs: make EndTabBar fail if users doesn't respect BeginTabBar return value, for consistency/future-proofing.
|
||||||
|
- tabs: persistent order/focus in BeginTabBar() api (#261, #351)
|
||||||
|
|
||||||
- ext: stl-ish friendly extension (imgui_stl.h) that has wrapper for std::string, std::vector etc.
|
|
||||||
|
|
||||||
- button: provide a button that looks framed.
|
|
||||||
- image/image button: misalignment on padded/bordered button?
|
- image/image button: misalignment on padded/bordered button?
|
||||||
- image/image button: parameters are confusing, image() has tint_col,border_col whereas imagebutton() has bg_col/tint_col. Even thou they are different parameters ordering could be more consistent. can we fix that?
|
- image/image button: parameters are confusing, image() has tint_col,border_col whereas imagebutton() has bg_col/tint_col. Even thou they are different parameters ordering could be more consistent. can we fix that?
|
||||||
- image button: not taking an explicit id is odd.
|
- image button: not taking an explicit id can be problematic. (#2464, #1390)
|
||||||
|
- button: provide a button that looks framed. (?)
|
||||||
|
- slider/drag: ctrl+click when format doesn't include a % character.. disable? display underlying value in default format? (see TempInputTextScalar)
|
||||||
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
|
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
|
||||||
- slider: initial absolute click is imprecise. change to relative movement slider (same as scrollbar). (#1946)
|
- slider: initial absolute click is imprecise. change to relative movement slider (same as scrollbar). (#1946)
|
||||||
- slider: add dragging-based widgets to edit values with mouse (on 2 axises), saving screen real-estate.
|
- slider: add dragging-based widgets to edit values with mouse (on 2 axises), saving screen real-estate.
|
||||||
@ -142,7 +172,9 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- slider: step option (#1183)
|
- slider: step option (#1183)
|
||||||
- slider style: fill % of the bar instead of positioning a drag.
|
- slider style: fill % of the bar instead of positioning a drag.
|
||||||
- knob: rotating knob widget (#942)
|
- knob: rotating knob widget (#942)
|
||||||
|
- drag float: power/logarithmic slider and drags are weird. (#1316)
|
||||||
- drag float: up/down axis
|
- drag float: up/down axis
|
||||||
|
- drag float: power != 0.0f with current value being outside the range keeps the value stuck.
|
||||||
- drag float: added leeway on edge (e.g. a few invisible steps past the clamp limits)
|
- drag float: added leeway on edge (e.g. a few invisible steps past the clamp limits)
|
||||||
|
|
||||||
- combo: use clipper: make it easier to disable clipper with a single flag.
|
- combo: use clipper: make it easier to disable clipper with a single flag.
|
||||||
@ -156,7 +188,9 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- listbox: user may want to initial scroll to focus on the one selected value?
|
- listbox: user may want to initial scroll to focus on the one selected value?
|
||||||
- listbox: expose hovered item for a basic ListBox
|
- listbox: expose hovered item for a basic ListBox
|
||||||
- listbox: keyboard navigation.
|
- listbox: keyboard navigation.
|
||||||
|
- listbox: disable capturing mouse wheel if the listbox has no scrolling. (#1681)
|
||||||
- listbox: scrolling should track modified selection.
|
- listbox: scrolling should track modified selection.
|
||||||
|
- listbox: future api should allow to enable horizontal scrolling (#2510)
|
||||||
|
|
||||||
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
|
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
|
||||||
- popups/modal: make modal title bar blink when trying to click outside the modal
|
- popups/modal: make modal title bar blink when trying to click outside the modal
|
||||||
@ -178,103 +212,125 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- shortcuts: programmatically access shortcuts "Focus("&Save"))
|
- shortcuts: programmatically access shortcuts "Focus("&Save"))
|
||||||
- menus: menu-bar: main menu-bar could affect clamping of windows position (~ akin to modifying DisplayMin)
|
- menus: menu-bar: main menu-bar could affect clamping of windows position (~ akin to modifying DisplayMin)
|
||||||
- menus: hovering from menu to menu on a menu-bar has 1 frame without any menu, which is a little annoying. ideally either 0 either longer.
|
- menus: hovering from menu to menu on a menu-bar has 1 frame without any menu, which is a little annoying. ideally either 0 either longer.
|
||||||
|
- menus: could merge draw call in most cases (how about storing an optional aabb in ImDrawCmd to move the burden of merging in a single spot).
|
||||||
|
|
||||||
- text: selectable text (for copy) as a generic feature (ItemFlags?)
|
- text: selectable text (for copy) as a generic feature (ItemFlags?)
|
||||||
- text: proper alignment options in imgui_internal.h
|
- text: proper alignment options in imgui_internal.h
|
||||||
- text wrapped: figure out better way to use TextWrapped() in an always auto-resize context (tooltip, etc.) (#249)
|
|
||||||
- text: it's currently impossible to have a window title with "##". perhaps an official workaround would be nice. \ style inhibitor? non-visible ascii code to insert between #?
|
- text: it's currently impossible to have a window title with "##". perhaps an official workaround would be nice. \ style inhibitor? non-visible ascii code to insert between #?
|
||||||
- text: provided a framed text helper, e.g. https://pastebin.com/1Laxy8bT
|
- text: provided a framed text helper, e.g. https://pastebin.com/1Laxy8bT
|
||||||
|
- text: refactor TextUnformatted (or underlying function) to more explicitly request if we need width measurement or not
|
||||||
- text link/url button: underlined. should api expose an ID or use text contents as ID? which colors enum to use?
|
- text link/url button: underlined. should api expose an ID or use text contents as ID? which colors enum to use?
|
||||||
|
- text/wrapped: should be a more first-class citizen, e.g. wrapped text within a Selectable with known width
|
||||||
|
- text/wrapped: figure out better way to use TextWrapped() in an always auto-resize context (tooltip, etc.) (#249)
|
||||||
|
|
||||||
- tree node / optimization: avoid formatting when clipped.
|
|
||||||
- tree node: tree-node/header right-most side doesn't take account of horizontal scrolling.
|
|
||||||
- tree node: add treenode/treepush int variants? not there because (void*) cast from int warns on some platforms/settings?
|
- tree node: add treenode/treepush int variants? not there because (void*) cast from int warns on some platforms/settings?
|
||||||
- tree node: try to apply scrolling at time of TreePop() if node was just opened and end of node is past scrolling limits?
|
- tree node: try to apply scrolling at time of TreePop() if node was just opened and end of node is past scrolling limits?
|
||||||
- tree node / selectable render mismatch which is visible if you use them both next to each other (e.g. cf. property viewer)
|
- tree node / selectable render mismatch which is visible if you use them both next to each other (e.g. cf. property viewer)
|
||||||
- tree node: tweak color scheme to distinguish headers from selected tree node (#581)
|
- tree node: tweak color scheme to distinguish headers from selected tree node (#581)
|
||||||
- tree node: leaf/non-leaf highlight mismatch.
|
- tree node: leaf/non-leaf highlight mismatch.
|
||||||
|
- tree node: _NoIndentOnOpen flag? would require to store a per-depth bit mask to store info for pop (or whatever is cheaper)
|
||||||
|
- tree node/opt: could avoid formatting when clipped (flag assuming we don't care about width/height, assume single line height?)
|
||||||
|
|
||||||
- settings: write more decent code to allow saving/loading new fields: columns, selected tree nodes?
|
- settings: write more decent code to allow saving/loading new fields: columns, selected tree nodes?
|
||||||
- settings: api for per-tool simple persistent data (bool,int,float,columns sizes,etc.) in .ini file (#437)
|
- settings: api for per-tool simple persistent data (bool,int,float,columns sizes,etc.) in .ini file (#437)
|
||||||
- stb: add defines to disable stb implementations
|
- settings/persistence: helpers to make TreeNodeBehavior persist (even during dev!) - may need to store some semantic and/or data type in ImGuiStoragePair
|
||||||
|
|
||||||
!- style: better default styles. (#707)
|
- style: better default styles. (#707)
|
||||||
- style: add a highlighted text color (for headers, etc.)
|
- style: add a highlighted text color (for headers, etc.)
|
||||||
- style: border types: out-screen, in-screen, etc. (#447)
|
- style: border types: out-screen, in-screen, etc. (#447)
|
||||||
- style: add window shadow (fading away from the window. Paint-style calculation of vertices alpha after drawlist would be easier)
|
- style: add window shadow (fading away from the window. Paint-style calculation of vertices alpha after drawlist would be easier)
|
||||||
- style: a concept of "compact style" that the end-user can easily rely on (e.g. PushStyleCompact()?) that maps to other settings? avoid implementing duplicate helpers such as SmallCheckbox(), etc.
|
- style: a concept of "compact style" that the end-user can easily rely on (e.g. PushStyleCompact()?) that maps to other settings? avoid implementing duplicate helpers such as SmallCheckbox(), etc.
|
||||||
- style: try to make PushStyleVar() more robust to incorrect parameters (to be more friendly to edit & continues situation).
|
- style: try to make PushStyleVar() more robust to incorrect parameters (to be more friendly to edit & continues situation).
|
||||||
- style: global scale setting.
|
- style: global scale setting.
|
||||||
|
- style: FramePadding could be different for up vs down (#584)
|
||||||
- style: WindowPadding needs to be EVEN as the 0.5 multiplier used on this value probably have a subtle effect on clip rectangle
|
- style: WindowPadding needs to be EVEN as the 0.5 multiplier used on this value probably have a subtle effect on clip rectangle
|
||||||
- style: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space? (#438, #707, #1223)
|
- style: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space? (#438, #707, #1223)
|
||||||
- style: gradients fill (#1223) ~ 2 bg colors for each fill? tricky with rounded shapes and using textures for corners.
|
- style: gradients fill (#1223) ~ 2 bg colors for each fill? tricky with rounded shapes and using textures for corners.
|
||||||
- style editor: color child window height expressed in multiple of line height.
|
- style editor: color child window height expressed in multiple of line height.
|
||||||
|
|
||||||
- log: LogButtons() options for specifying depth and/or hiding depth slider
|
|
||||||
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
|
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
|
||||||
- log: be able to log anything (e.g. right-click on a window/tree-node, shows context menu? log into tty/file/clipboard)
|
- log: be able to log anything (e.g. right-click on a window/tree-node, shows context menu? log into tty/file/clipboard)
|
||||||
- log: let user copy any window content to clipboard easily (CTRL+C on windows? while moving it? context menu?). code is commented because it fails with multiple Begin/End pairs.
|
- log: let user copy any window content to clipboard easily (CTRL+C on windows? while moving it? context menu?). code is commented because it fails with multiple Begin/End pairs.
|
||||||
|
- log: obsolete LogButtons() all together.
|
||||||
|
- log: LogButtons() options for specifying depth and/or hiding depth slider
|
||||||
|
|
||||||
- filters: set a current filter that tree node can automatically query to hide themselves
|
- filters: set a current filter that tree node can automatically query to hide themselves
|
||||||
- filters: handle wild-cards (with implicit leading/trailing *), reg-exprs
|
- filters: handle wild-cards (with implicit leading/trailing *), reg-exprs
|
||||||
- filters: fuzzy matches (may use code at blog.forrestthewoods.com/4cffeed33fdb)
|
- filters: fuzzy matches (may use code at blog.forrestthewoods.com/4cffeed33fdb)
|
||||||
|
|
||||||
- drag and drop: have some way to know when a drag begin from BeginDragDropSource() pov.
|
- drag and drop: drag tooltip hovering over source widget with IsItemHovered/SetTooltip flickers.
|
||||||
|
- drag and drop: fix/support/options for overlapping drag sources.
|
||||||
|
- drag and drop: releasing a drop shows the "..." tooltip for one frame - since e13e598 (#1725)
|
||||||
|
- drag and drop: drag source on a group object (would need e.g. an invisible button covering group in EndGroup) https://twitter.com/paniq/status/1121446364909535233
|
||||||
|
- drag and drop: have some way to know when a drag begin from BeginDragDropSource() pov. (see 2018/01/11 post in #143)
|
||||||
- drag and drop: allow preview tooltip to be submitted from a different place than the drag source. (#1725)
|
- drag and drop: allow preview tooltip to be submitted from a different place than the drag source. (#1725)
|
||||||
- drag and drop: allow using with other mouse buttons (where activeid won't be set). (#1637)
|
- drag and drop: allow using with other mouse buttons (where activeid won't be set). (#1637)
|
||||||
- drag and drop: make it easier and provide a demo to have tooltip both are source and target site, with a more detailed one on target site (tooltip ordering problem)
|
- drag and drop: make it easier and provide a demo to have tooltip both are source and target site, with a more detailed one on target site (tooltip ordering problem)
|
||||||
- drag and drop: test with reordering nodes (in a list, or a tree node). (#143)
|
- drag and drop: demo with reordering nodes (in a list, or a tree node). (#143)
|
||||||
- drag and drop: test integrating with os drag and drop (make it easy to do a naive WM_DROPFILE integration)
|
- drag and drop: test integrating with os drag and drop (make it easy to do a naive WM_DROPFILE integration)
|
||||||
- drag and drop: make payload optional? (#143)
|
- drag and drop: allow for multiple payload types. (#143)
|
||||||
- drag and drop: feedback when hovering a modal (cursor?)
|
- drag and drop: make payload optional? payload promise? (see 2018/01/11 post in #143)
|
||||||
|
- drag and drop: (#143) "both an in-process pointer and a promise to generate a serialized version, for whether the drag ends inside or outside the same process"
|
||||||
|
- drag and drop: feedback when hovering a region blocked by modal (mouse cursor "NO"?)
|
||||||
|
|
||||||
- node/graph editor (#306)
|
- node/graph editor (#306)
|
||||||
- pie menus patterns (#434)
|
- pie menus patterns (#434)
|
||||||
- markup: simple markup language for color change? (#902)
|
- markup: simple markup language for color change? (#902)
|
||||||
|
|
||||||
!- font: need handling of missing glyphs by not packing/rasterizing glyph 0 of a given font.
|
- font: MergeMode: flags to select overwriting or not (this is now very easy with refactored ImFontAtlasBuildWithStbTruetype)
|
||||||
- font: MergeMode: flags to select overwriting or not.
|
|
||||||
- font: MergeMode: duplicate glyphs are stored in the atlas texture which is suboptimal.
|
|
||||||
- font: free the Alpha buffer if user only requested RGBA.
|
- font: free the Alpha buffer if user only requested RGBA.
|
||||||
!- font: better CalcTextSizeA() API, at least for simple use cases. current one is horrible (perhaps have simple vs extended versions).
|
!- font: better CalcTextSizeA() API, at least for simple use cases. current one is horrible (perhaps have simple vs extended versions).
|
||||||
|
- font: for the purpose of RenderTextEllipsis(), it might be useful that CalcTextSizeA() can ignore the trailing padding?
|
||||||
- font: a CalcTextHeight() helper could run faster than CalcTextSize().y
|
- font: a CalcTextHeight() helper could run faster than CalcTextSize().y
|
||||||
- font: enforce monospace through ImFontConfig (for icons?) + create dual ImFont output from same input, reusing rasterized data but with different glyphs/AdvanceX
|
- font: enforce monospace through ImFontConfig (for icons?) + create dual ImFont output from same input, reusing rasterized data but with different glyphs/AdvanceX
|
||||||
- font: finish CustomRectRegister() to allow mapping Unicode codepoint to custom texture data
|
- font: finish CustomRectRegister() to allow mapping Unicode codepoint to custom texture data
|
||||||
|
- font: make it easier to submit own bitmap font (same texture, another texture?). (#2127, #2575)
|
||||||
- font: PushFontSize API (#1018)
|
- font: PushFontSize API (#1018)
|
||||||
- font: MemoryTTF taking ownership confusing/not obvious, maybe default should be opposite?
|
- font: MemoryTTF taking ownership confusing/not obvious, maybe default should be opposite?
|
||||||
|
- font: storing MinAdvanceX per font would allow us to skip calculating line width (under a threshold of character count) in loops looking for block width
|
||||||
|
- font/demo: add tools to show glyphs used by a text blob, display U16 value, list missing glyphs.
|
||||||
|
- font/demo: demonstrate use of ImFontGlyphRangesBuilder.
|
||||||
- font/atlas: add a missing Glyphs.reserve()
|
- font/atlas: add a missing Glyphs.reserve()
|
||||||
- font/atlas: incremental updates
|
- font/atlas: incremental updates
|
||||||
- font/atlas: dynamic font atlas to avoid baking huge ranges into bitmap and make scaling easier.
|
- font/atlas: dynamic font atlas to avoid baking huge ranges into bitmap and make scaling easier.
|
||||||
- font/atlas: allow user to submit its own primitive to be rectpacked, and allow to map them on a Unicode point.
|
|
||||||
- font/draw: vertical and/or rotated text renderer (#705) - vertical is easier clipping wise
|
- font/draw: vertical and/or rotated text renderer (#705) - vertical is easier clipping wise
|
||||||
- font/draw: need to be able to specify wrap start position.
|
- font/draw: need to be able to specify wrap start position.
|
||||||
- font/draw: better reserve policy for large horizontal block of text (shouldn't reserve for all clipped lines)
|
- font/draw: better reserve policy for large horizontal block of text (shouldn't reserve for all clipped lines)
|
||||||
- font: imgui_freetype.h alternative renderer (#618)
|
- font/draw: underline, squiggle line rendering helpers.
|
||||||
- font: optimization: for monospace font (like the default one) we can trim IndexXAdvance as long as trailing value is == FallbackXAdvance (need to make sure TAB is still correct).
|
- font: optimization: for monospace font (like the default one) we can trim IndexXAdvance as long as trailing value is == FallbackXAdvance (need to make sure TAB is still correct), would save on cache line.
|
||||||
- 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 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: 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: fix AddRemapChar() to work before atlas has been built.
|
||||||
- font: (api breaking) removed "TTF" from symbol names. also because it now supports OTF.
|
- font: what would it take to support codepoint higher than 0xFFFF? (smileys, etc.) (#2538, #2541)
|
||||||
|
- 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?
|
||||||
|
|
||||||
|
- nav: some features such as PageUp/Down/Home/End should probably work without ImGuiConfigFlags_NavEnableKeyboard? (where do we draw the line?)
|
||||||
|
- nav: configuration flag to disable global shortcuts (currently only CTRL-Tab) ?
|
||||||
|
- nav: Home/End behavior when navigable item is not fully visible at the edge of scrolling? should be backtrack to keep item into view?
|
||||||
|
- nav: NavScrollToBringItemIntoView() with item bigger than view should focus top-right? Repro: using Nav in "About Window"
|
||||||
- nav: wrap around logic to allow e.g. grid based layout (pressing NavRight on the right-most element would go to the next row, etc.). see internal's NavMoveRequestTryWrapping().
|
- nav: wrap around logic to allow e.g. grid based layout (pressing NavRight on the right-most element would go to the next row, etc.). see internal's NavMoveRequestTryWrapping().
|
||||||
- nav: patterns to make it possible for arrows key to update selection
|
- nav: patterns to make it possible for arrows key to update selection
|
||||||
- nav: restore/find nearest navid when current one disappear (e.g. pressed a button that disappear, or perhaps auto restoring when current button change name)
|
- nav: restore/find nearest NavId when current one disappear (e.g. pressed a button that disappear, or perhaps auto restoring when current button change name)
|
||||||
- nav: SetItemDefaultFocus() level of priority, so widget like Selectable when inside a popup could claim a low-priority default focus on the first selected iem
|
- nav: SetItemDefaultFocus() level of priority, so widget like Selectable when inside a popup could claim a low-priority default focus on the first selected iem
|
||||||
- nav: allow input system to be be more tolerant of io.DeltaTime=0.0f
|
|
||||||
- nav: ESC within a menu of a child window seems to exit the child window.
|
- nav: ESC within a menu of a child window seems to exit the child window.
|
||||||
- nav: NavFlattened: ESC on a flattened child should select something.
|
- nav: NavFlattened: ESC on a flattened child should select something.
|
||||||
- nav: NavFlattened: broken: in typical usage scenario, the items of a fully clipped child are currently not considered to enter into a NavFlattened child.
|
- nav: NavFlattened: broken: in typical usage scenario, the items of a fully clipped child are currently not considered to enter into a NavFlattened child.
|
||||||
- nav: NavFlattened: init request doesn't select items that are part of a NavFlattened child
|
- nav: NavFlattened: init request doesn't select items that are part of a NavFlattened child
|
||||||
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
|
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
|
||||||
- nav: Left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
|
- nav: Left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
|
||||||
- nav: menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
|
- nav/menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
|
||||||
- nav: menus: allow pressing Menu to leave a sub-menu.
|
- nav/menus: allow pressing Menu to leave a sub-menu.
|
||||||
|
- nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB)
|
||||||
|
- nav/menus: when using the main menu bar, even though we restore focus after, the underlying window loses its title bar highlight during menu manipulation. could we prevent it?
|
||||||
|
- nav/menus: main menu bar currently cannot restore a NULL focus. Could save NavWindow at the time of being focused, similarly to what popup do?
|
||||||
- nav: simulate right-click or context activation? (SHIFT+F10)
|
- nav: simulate right-click or context activation? (SHIFT+F10)
|
||||||
- nav: tabs should go through most/all widgets (in submission order?).
|
- nav: tabs should go through most/all widgets (in submission order?).
|
||||||
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
|
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
|
||||||
- nav: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys.
|
- nav: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys.
|
||||||
- nav: when activating a button that changes label (without a static ID) or disappear, can we somehow automatically recover into a nearest highlight item?
|
- nav: when activating a button that changes label (without a static ID) or disappear, can we somehow automatically recover into a nearest highlight item?
|
||||||
- nav: there's currently no way to completely clear focus with the keyboard. depending on patterns used by the application to dispatch inputs, it may be desirable.
|
- nav: there's currently no way to completely clear focus with the keyboard. depending on patterns used by the application to dispatch inputs, it may be desirable.
|
||||||
- nav: configuration flag to disable global shortcuts (currently only CTRL-tab) ?
|
|
||||||
- focus: preserve ActiveId/focus stack state, e.g. when opening a menu and close it, previously selected InputText() focus gets restored (#622)
|
- focus: preserve ActiveId/focus stack state, e.g. when opening a menu and close it, previously selected InputText() focus gets restored (#622)
|
||||||
- focus: SetKeyboardFocusHere() on with >= 0 offset could be done on same frame (else latch and modulate on beginning of next frame)
|
- focus: SetKeyboardFocusHere() on with >= 0 offset could be done on same frame (else latch and modulate on beginning of next frame)
|
||||||
- focus: unable to use SetKeyboardFocusHere() on clipped widgets. (#787)
|
- focus: unable to use SetKeyboardFocusHere() on clipped widgets. (#787)
|
||||||
@ -284,32 +340,42 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- inputs: support track pad style scrolling & slider edit.
|
- inputs: support track pad style scrolling & slider edit.
|
||||||
- inputs/io: backspace and arrows in the context of a text input could use system repeat rate.
|
- inputs/io: backspace and arrows in the context of a text input could use system repeat rate.
|
||||||
- inputs/io: clarify/standardize/expose repeat rate and repeat delays (#1808)
|
- inputs/io: clarify/standardize/expose repeat rate and repeat delays (#1808)
|
||||||
|
- inputs: add mouse cursor for unavailable/no? IDC_NO/SDL_SYSTEM_CURSOR_NO.
|
||||||
|
- inputs/scrolling: support for smooth scrolling (#2462, #2569)
|
||||||
|
|
||||||
- misc: idle refresh: expose cursor blink animation timer for backend to be able to lower framerate.
|
- misc: idle: expose "woken up" boolean (set by inputs) and/or animation time (for cursor blink) for back-end to be able stop refreshing easily.
|
||||||
|
- misc: idle: if cursor blink if the _only_ visible animation, core imgui could rewrite vertex alpha to avoid CPU pass on ImGui:: calls.
|
||||||
|
- misc: idle: if cursor blink if the _only_ visible animation, could even expose a dirty rectangle that optionally can be leverage by some app to render in a smaller viewport, getting rid of much pixel shading cost.
|
||||||
- misc: make the ImGuiCond values linear (non-power-of-two). internal storage for ImGuiWindow can use integers to combine into flags (Why?)
|
- misc: make the ImGuiCond values linear (non-power-of-two). internal storage for ImGuiWindow can use integers to combine into flags (Why?)
|
||||||
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
|
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
|
||||||
- misc: PushItemFlag(): add a flag to disable keyboard capture when used with mouse? (#1682)
|
- misc: PushItemFlag(): add a flag to disable keyboard capture when used with mouse? (#1682)
|
||||||
- misc: use more size_t in public api?
|
- misc: use more size_t in public api?
|
||||||
- misc: ImVector: erase_unsorted() helper
|
- misc: possible compile-time support for string view/range instead of char* would e.g. facilitate usage with Rust (#683)
|
||||||
- misc: imgui_cpp: perhaps a misc/ header file with more friendly helper (e.g. type-infer versions of DragScalar, vector<> variants if appropriate for some functions).
|
- misc: possible compile-time support for wchar_t instead of char*?
|
||||||
|
|
||||||
- backend: bgfx? https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0
|
- backend: bgfx? https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0
|
||||||
- web/emscriptem: refactor some examples to facilitate integration with emscripten main loop system. (#1713, #336)
|
- emscriptem: with refactored examples, we could provide a direct imgui_impl_emscripten platform layer (see eg. https://github.com/floooh/sokol-samples/blob/master/html5/imgui-emsc.cc#L42)
|
||||||
- web/emscriptem: with refactored examples, we could provide a direct imgui_impl_emscripten platform layer (see eg. https://github.com/floooh/sokol-samples/blob/master/html5/imgui-emsc.cc#L42)
|
|
||||||
|
|
||||||
- remote: make a system like RemoteImGui first-class citizen/project (#75)
|
- remote: make a system like RemoteImGui first-class citizen/project (#75)
|
||||||
|
|
||||||
- demo: find a way to demonstrate textures in the examples application, as it such a a common issue for new users.
|
- demo: find a way to demonstrate textures in the examples application, as it such a common issue for new users.
|
||||||
|
- demo: demonstrate using PushStyleVar() in more details.
|
||||||
- demo: add vertical separator demo
|
- demo: add vertical separator demo
|
||||||
- demo: add virtual scrolling example?
|
- demo: add virtual scrolling example?
|
||||||
- demo: demonstration Plot offset
|
- demo: demonstrate Plot offset
|
||||||
|
- demo: window size constraint: square demo is broken when resizing from edges (#1975), would need to rework the callback system to solve this
|
||||||
- examples: window minimize, maximize (#583)
|
- examples: window minimize, maximize (#583)
|
||||||
- examples: provide a zero frame-rate/idle example.
|
- examples: provide a zero frame-rate/idle example.
|
||||||
- examples: apple: example_apple should be using modern GL3.
|
- examples: apple: example_apple should be using modern GL3.
|
||||||
- examples: glfw: could go idle when minimized? if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) { glfwWaitEvents(); continue; } // issue: DeltaTime will be super high on resume, perhaps provide a way to let impl know (#440)
|
- examples: glfw: could go idle when minimized? if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) { glfwWaitEvents(); continue; } // issue: DeltaTime will be super high on resume, perhaps provide a way to let impl know (#440)
|
||||||
|
- examples: opengl: rename imgui_impl_opengl2 to impl_opengl_legacy and imgui_impl_opengl3 to imgui_impl_opengl? (#1900)
|
||||||
|
- examples: opengl: could use a single vertex buffer and glBufferSubData for uploads?
|
||||||
|
- examples: opengl: explicitly disable GL_STENCIL_TEST in bindings.
|
||||||
|
- examples: vulkan: viewport: support for synchronized swapping of multiple swap chains.
|
||||||
- optimization: replace vsnprintf with stb_printf? or enable the defines/infrastructure to allow it (#1038)
|
- optimization: replace vsnprintf with stb_printf? or enable the defines/infrastructure to allow it (#1038)
|
||||||
- optimization: add clipping for multi-component widgets (SliderFloatX, ColorEditX, etc.). one problem is that nav branch can't easily clip parent group when there is a move request.
|
- optimization: add clipping for multi-component widgets (SliderFloatX, ColorEditX, etc.). one problem is that nav branch can't easily clip parent group when there is a move request.
|
||||||
- optimization: add a flag to disable most of rendering, for the case where the user expect to skip it (#335)
|
- optimization: add a flag to disable most of rendering, for the case where the user expect to skip it (#335)
|
||||||
|
- optimization: fully covered window (covered by another with non-translucent bg + WindowRounding worth of padding) may want to clip rendering.
|
||||||
- optimization: use another hash function than crc32, e.g. FNV1a
|
- optimization: use another hash function than crc32, e.g. FNV1a
|
||||||
- optimization/render: merge command-lists with same clip-rect into one even if they aren't sequential? (as long as in-between clip rectangle don't overlap)?
|
- optimization/render: merge command-lists with same clip-rect into one even if they aren't sequential? (as long as in-between clip rectangle don't overlap)?
|
||||||
- optimization: turn some the various stack vectors into statically-sized arrays
|
- optimization: turn some the various stack vectors into statically-sized arrays
|
@ -3,10 +3,10 @@
|
|||||||
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
||||||
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// A) You may edit imconfig.h (and not overwrite it when updating imgui, or maintain a patch/branch with your modifications to imconfig.h)
|
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/branch with your modifications to imconfig.h)
|
||||||
// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h"
|
// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h"
|
||||||
// If you do so you need to make sure that configuration settings are defined consistently _everywhere_ dear imgui is used, which include
|
// If you do so you need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include
|
||||||
// the imgui*.cpp files but also _any_ of your code that uses imgui. This is because some compile-time options have an affect on data structures.
|
// the imgui*.cpp files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
|
||||||
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
||||||
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -17,7 +17,8 @@
|
|||||||
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
||||||
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
||||||
|
|
||||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows.
|
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||||
|
// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||||
//#define IMGUI_API __declspec( dllexport )
|
//#define IMGUI_API __declspec( dllexport )
|
||||||
//#define IMGUI_API __declspec( dllimport )
|
//#define IMGUI_API __declspec( dllimport )
|
||||||
|
|
||||||
@ -25,14 +26,18 @@
|
|||||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
|
||||||
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
|
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
|
||||||
//---- It is very strongly recommended to NOT disable the demo windows during development. Please read the comments in imgui_demo.cpp.
|
// It is very strongly recommended to NOT disable the demo windows during development. Please read the comments in imgui_demo.cpp.
|
||||||
//#define IMGUI_DISABLE_DEMO_WINDOWS
|
//#define IMGUI_DISABLE_DEMO_WINDOWS
|
||||||
|
//#define IMGUI_DISABLE_METRICS_WINDOW
|
||||||
|
|
||||||
//---- Don't implement some functions to reduce linkage requirements.
|
//---- Don't implement some functions to reduce linkage requirements.
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
|
||||||
//#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself if you don't want to link with vsnprintf.
|
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
|
||||||
//#define IMGUI_DISABLE_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 wrapper so you can implement them yourself. Declare your prototypes in imconfig.h.
|
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||||
|
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||||
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||||
|
|
||||||
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
||||||
@ -60,9 +65,26 @@
|
|||||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//---- Use 32-bit vertex indices (default is 16-bit) to allow meshes with more than 64K vertices. Render function needs to support it.
|
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||||
|
// Your renderer back-end will need to support it (most example renderer back-ends support both 16/32-bit indices).
|
||||||
|
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||||
|
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||||
//#define ImDrawIdx unsigned int
|
//#define ImDrawIdx unsigned int
|
||||||
|
|
||||||
|
//---- Override ImDrawCallback signature (will need to modify renderer back-ends accordingly)
|
||||||
|
//struct ImDrawList;
|
||||||
|
//struct ImDrawCmd;
|
||||||
|
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
|
||||||
|
//#define ImDrawCallback MyImDrawCallback
|
||||||
|
|
||||||
|
//---- Debug Tools
|
||||||
|
// Use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.
|
||||||
|
//#define IM_DEBUG_BREAK IM_ASSERT(0)
|
||||||
|
//#define IM_DEBUG_BREAK __debugbreak()
|
||||||
|
// Have the Item Picker break in the ItemAdd() function instead of ItemHoverable() - which is earlier in the code, will catch a few extra items, allow picking items other than Hovered one.
|
||||||
|
// This adds a small runtime cost which is why it is not enabled by default.
|
||||||
|
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
|
||||||
|
|
||||||
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
||||||
/*
|
/*
|
||||||
namespace ImGui
|
namespace ImGui
|
||||||
|
1457
Source/ThirdParty/ImGuiLibrary/Include/imgui.h
vendored
1457
Source/ThirdParty/ImGuiLibrary/Include/imgui.h
vendored
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
|||||||
// imgui_stl.h
|
|
||||||
// Wrappers for C++ standard library (STL) types (std::string, etc.)
|
|
||||||
// This is also an example of how you may wrap your own similar types.
|
|
||||||
|
|
||||||
// Compatibility:
|
|
||||||
// - std::string support is only guaranteed to work from C++11.
|
|
||||||
// If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture)
|
|
||||||
|
|
||||||
// Changelog:
|
|
||||||
// - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace ImGui
|
|
||||||
{
|
|
||||||
// ImGui::InputText() with std::string
|
|
||||||
// Because text input needs dynamic resizing, we need to setup a callback to grow the capacity
|
|
||||||
IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
||||||
IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
||||||
}
|
|
2
Source/ThirdParty/ImGuiLibrary/LICENSE.txt
vendored
2
Source/ThirdParty/ImGuiLibrary/LICENSE.txt
vendored
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2018 Omar Cornut
|
Copyright (c) 2014-2019 Omar Cornut
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
5319
Source/ThirdParty/ImGuiLibrary/Private/imgui.cpp
vendored
5319
Source/ThirdParty/ImGuiLibrary/Private/imgui.cpp
vendored
File diff suppressed because it is too large
Load Diff
2177
Source/ThirdParty/ImGuiLibrary/Private/imgui_demo.cpp
vendored
2177
Source/ThirdParty/ImGuiLibrary/Private/imgui_demo.cpp
vendored
File diff suppressed because it is too large
Load Diff
1164
Source/ThirdParty/ImGuiLibrary/Private/imgui_draw.cpp
vendored
1164
Source/ThirdParty/ImGuiLibrary/Private/imgui_draw.cpp
vendored
File diff suppressed because it is too large
Load Diff
1203
Source/ThirdParty/ImGuiLibrary/Private/imgui_internal.h
vendored
1203
Source/ThirdParty/ImGuiLibrary/Private/imgui_internal.h
vendored
File diff suppressed because it is too large
Load Diff
4092
Source/ThirdParty/ImGuiLibrary/Private/imgui_widgets.cpp
vendored
4092
Source/ThirdParty/ImGuiLibrary/Private/imgui_widgets.cpp
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,10 @@
|
|||||||
// stb_rect_pack.h - v0.11 - public domain - rectangle packing
|
// [DEAR IMGUI]
|
||||||
|
// This is a slightly modified version of stb_rect_pack.h 1.00.
|
||||||
|
// Those changes would need to be pushed into nothings/stb:
|
||||||
|
// - Added STBRP__CDECL
|
||||||
|
// Grep for [DEAR IMGUI] to find the changes.
|
||||||
|
|
||||||
|
// stb_rect_pack.h - v1.00 - public domain - rectangle packing
|
||||||
// Sean Barrett 2014
|
// Sean Barrett 2014
|
||||||
//
|
//
|
||||||
// Useful for e.g. packing rectangular textures into an atlas.
|
// Useful for e.g. packing rectangular textures into an atlas.
|
||||||
@ -31,9 +37,12 @@
|
|||||||
//
|
//
|
||||||
// Bugfixes / warning fixes
|
// Bugfixes / warning fixes
|
||||||
// Jeremy Jaussaud
|
// Jeremy Jaussaud
|
||||||
|
// Fabian Giesen
|
||||||
//
|
//
|
||||||
// Version history:
|
// Version history:
|
||||||
//
|
//
|
||||||
|
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
|
||||||
|
// 0.99 (2019-02-07) warning fixes
|
||||||
// 0.11 (2017-03-03) return packing success/fail result
|
// 0.11 (2017-03-03) return packing success/fail result
|
||||||
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
|
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
|
||||||
// 0.09 (2016-08-27) fix compiler warnings
|
// 0.09 (2016-08-27) fix compiler warnings
|
||||||
@ -204,6 +213,7 @@ struct stbrp_context
|
|||||||
#define STBRP_ASSERT assert
|
#define STBRP_ASSERT assert
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// [DEAR IMGUI] Added STBRP__CDECL
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define STBRP__NOTUSED(v) (void)(v)
|
#define STBRP__NOTUSED(v) (void)(v)
|
||||||
#define STBRP__CDECL __cdecl
|
#define STBRP__CDECL __cdecl
|
||||||
@ -349,6 +359,13 @@ static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int widt
|
|||||||
width -= width % c->align;
|
width -= width % c->align;
|
||||||
STBRP_ASSERT(width % c->align == 0);
|
STBRP_ASSERT(width % c->align == 0);
|
||||||
|
|
||||||
|
// if it can't possibly fit, bail immediately
|
||||||
|
if (width > c->width || height > c->height) {
|
||||||
|
fr.prev_link = NULL;
|
||||||
|
fr.x = fr.y = 0;
|
||||||
|
return fr;
|
||||||
|
}
|
||||||
|
|
||||||
node = c->active_head;
|
node = c->active_head;
|
||||||
prev = &c->active_head;
|
prev = &c->active_head;
|
||||||
while (node->x + width <= c->width) {
|
while (node->x + width <= c->width) {
|
||||||
@ -412,7 +429,7 @@ static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int widt
|
|||||||
}
|
}
|
||||||
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
|
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
|
||||||
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
|
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
|
||||||
if (y + height < c->height) {
|
if (y + height <= c->height) {
|
||||||
if (y <= best_y) {
|
if (y <= best_y) {
|
||||||
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
|
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
|
||||||
best_x = xpos;
|
best_x = xpos;
|
||||||
@ -512,6 +529,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [DEAR IMGUI] Added STBRP__CDECL
|
||||||
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
|
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||||
@ -523,6 +541,7 @@ static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
|
|||||||
return (p->w > q->w) ? -1 : (p->w < q->w);
|
return (p->w > q->w) ? -1 : (p->w < q->w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [DEAR IMGUI] Added STBRP__CDECL
|
||||||
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
|
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||||
@ -543,9 +562,6 @@ STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int nu
|
|||||||
// we use the 'was_packed' field internally to allow sorting/unsorting
|
// we use the 'was_packed' field internally to allow sorting/unsorting
|
||||||
for (i=0; i < num_rects; ++i) {
|
for (i=0; i < num_rects; ++i) {
|
||||||
rects[i].was_packed = i;
|
rects[i].was_packed = i;
|
||||||
#ifndef STBRP_LARGE_RECTS
|
|
||||||
STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort according to heuristic
|
// sort according to heuristic
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
// [ImGui] this is a slightly modified version of stb_textedit.h 1.12. Those changes would need to be pushed into nothings/stb
|
// [DEAR IMGUI]
|
||||||
// [ImGui] - 2018-06: fixed undo/redo after pasting large amount of text (over 32 kb). Redo will still fail when undo buffers are exhausted, but text won't be corrupted (see nothings/stb issue #620)
|
// This is a slightly modified version of stb_textedit.h 1.13.
|
||||||
// [ImGui] - 2018-06: fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
// Those changes would need to be pushed into nothings/stb:
|
||||||
// [ImGui] - fixed some minor warnings
|
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
||||||
|
// Grep for [DEAR IMGUI] to find the changes.
|
||||||
|
|
||||||
// stb_textedit.h - v1.12 - public domain - Sean Barrett
|
// stb_textedit.h - v1.13 - public domain - Sean Barrett
|
||||||
// Development of this library was sponsored by RAD Game Tools
|
// Development of this library was sponsored by RAD Game Tools
|
||||||
//
|
//
|
||||||
// This C header file implements the guts of a multi-line text-editing
|
// This C header file implements the guts of a multi-line text-editing
|
||||||
@ -34,6 +35,7 @@
|
|||||||
//
|
//
|
||||||
// VERSION HISTORY
|
// VERSION HISTORY
|
||||||
//
|
//
|
||||||
|
// 1.13 (2019-02-07) fix bug in undo size management
|
||||||
// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash
|
// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash
|
||||||
// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield
|
// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield
|
||||||
// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual
|
// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual
|
||||||
@ -563,7 +565,6 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
|
|||||||
|
|
||||||
// now scan to find xpos
|
// now scan to find xpos
|
||||||
find->x = r.x0;
|
find->x = r.x0;
|
||||||
i = 0;
|
|
||||||
for (i=0; first+i < n; ++i)
|
for (i=0; first+i < n; ++i)
|
||||||
find->x += STB_TEXTEDIT_GETWIDTH(str, first, i);
|
find->x += STB_TEXTEDIT_GETWIDTH(str, first, i);
|
||||||
}
|
}
|
||||||
@ -693,7 +694,7 @@ static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state)
|
|||||||
static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
|
static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
|
||||||
{
|
{
|
||||||
if (STB_TEXT_HAS_SELECTION(state)) {
|
if (STB_TEXT_HAS_SELECTION(state)) {
|
||||||
stb_textedit_delete_selection(str,state); // implicity clamps
|
stb_textedit_delete_selection(str,state); // implicitly clamps
|
||||||
state->has_preferred_x = 0;
|
state->has_preferred_x = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -745,7 +746,7 @@ retry:
|
|||||||
state->has_preferred_x = 0;
|
state->has_preferred_x = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stb_textedit_delete_selection(str,state); // implicity clamps
|
stb_textedit_delete_selection(str,state); // implicitly clamps
|
||||||
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
|
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
|
||||||
stb_text_makeundo_insert(state, state->cursor, 1);
|
stb_text_makeundo_insert(state, state->cursor, 1);
|
||||||
++state->cursor;
|
++state->cursor;
|
||||||
@ -1133,7 +1134,14 @@ static void stb_textedit_discard_redo(StbUndoState *state)
|
|||||||
state->undo_rec[i].char_storage += n;
|
state->undo_rec[i].char_storage += n;
|
||||||
}
|
}
|
||||||
// now move all the redo records towards the end of the buffer; the first one is at 'redo_point'
|
// now move all the redo records towards the end of the buffer; the first one is at 'redo_point'
|
||||||
STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, (size_t) ((STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point)*sizeof(state->undo_rec[0])));
|
// {DEAR IMGUI]
|
||||||
|
size_t move_size = (size_t)((STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0]));
|
||||||
|
const char* buf_begin = (char*)state->undo_rec; (void)buf_begin;
|
||||||
|
const char* buf_end = (char*)state->undo_rec + sizeof(state->undo_rec); (void)buf_end;
|
||||||
|
IM_ASSERT(((char*)(state->undo_rec + state->redo_point)) >= buf_begin);
|
||||||
|
IM_ASSERT(((char*)(state->undo_rec + state->redo_point + 1) + move_size) <= buf_end);
|
||||||
|
STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size);
|
||||||
|
|
||||||
// now move redo_point to point to the new one
|
// now move redo_point to point to the new one
|
||||||
++state->redo_point;
|
++state->redo_point;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
// stb_truetype.h - v1.19 - public domain
|
// [DEAR IMGUI]
|
||||||
|
// This is a slightly modified version of stb_truetype.h 1.20.
|
||||||
|
// Mostly fixing for compiler and static analyzer warnings.
|
||||||
|
// Grep for [DEAR IMGUI] to find the changes.
|
||||||
|
|
||||||
|
// stb_truetype.h - v1.20 - public domain
|
||||||
// authored from 2009-2016 by Sean Barrett / RAD Game Tools
|
// authored from 2009-2016 by Sean Barrett / RAD Game Tools
|
||||||
//
|
//
|
||||||
// This library processes TrueType files:
|
// This library processes TrueType files:
|
||||||
@ -49,6 +54,7 @@
|
|||||||
//
|
//
|
||||||
// VERSION HISTORY
|
// VERSION HISTORY
|
||||||
//
|
//
|
||||||
|
// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()
|
||||||
// 1.19 (2018-02-11) GPOS kerning, STBTT_fmod
|
// 1.19 (2018-02-11) GPOS kerning, STBTT_fmod
|
||||||
// 1.18 (2018-01-29) add missing function
|
// 1.18 (2018-01-29) add missing function
|
||||||
// 1.17 (2017-07-23) make more arguments const; doc fix
|
// 1.17 (2017-07-23) make more arguments const; doc fix
|
||||||
@ -75,7 +81,7 @@
|
|||||||
//
|
//
|
||||||
// USAGE
|
// USAGE
|
||||||
//
|
//
|
||||||
// Include this file in whatever places neeed to refer to it. In ONE C/C++
|
// Include this file in whatever places need to refer to it. In ONE C/C++
|
||||||
// file, write:
|
// file, write:
|
||||||
// #define STB_TRUETYPE_IMPLEMENTATION
|
// #define STB_TRUETYPE_IMPLEMENTATION
|
||||||
// before the #include of this file. This expands out the actual
|
// before the #include of this file. This expands out the actual
|
||||||
@ -248,7 +254,7 @@
|
|||||||
// Sample code 140 LOC /
|
// Sample code 140 LOC /
|
||||||
// Truetype parsing 620 LOC ---- 620 LOC TrueType
|
// Truetype parsing 620 LOC ---- 620 LOC TrueType
|
||||||
// Software rasterization 240 LOC \.
|
// Software rasterization 240 LOC \.
|
||||||
// Curve tesselation 120 LOC \__ 550 LOC Bitmap creation
|
// Curve tessellation 120 LOC \__ 550 LOC Bitmap creation
|
||||||
// Bitmap management 100 LOC /
|
// Bitmap management 100 LOC /
|
||||||
// Baked bitmap interface 70 LOC /
|
// Baked bitmap interface 70 LOC /
|
||||||
// Font name matching & access 150 LOC ---- 150
|
// Font name matching & access 150 LOC ---- 150
|
||||||
@ -556,6 +562,8 @@ STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int p
|
|||||||
//
|
//
|
||||||
// It's inefficient; you might want to c&p it and optimize it.
|
// It's inefficient; you might want to c&p it and optimize it.
|
||||||
|
|
||||||
|
STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap);
|
||||||
|
// Query the font vertical metrics without having to create a font first.
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -641,6 +649,12 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h
|
|||||||
// To use with PackFontRangesGather etc., you must set it before calls
|
// To use with PackFontRangesGather etc., you must set it before calls
|
||||||
// call to PackFontRangesGatherRects.
|
// call to PackFontRangesGatherRects.
|
||||||
|
|
||||||
|
STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
|
||||||
|
// If skip != 0, this tells stb_truetype to skip any codepoints for which
|
||||||
|
// there is no corresponding glyph. If skip=0, which is the default, then
|
||||||
|
// codepoints without a glyph recived the font's "missing character" glyph,
|
||||||
|
// typically an empty box by convention.
|
||||||
|
|
||||||
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above
|
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above
|
||||||
int char_index, // character to display
|
int char_index, // character to display
|
||||||
float *xpos, float *ypos, // pointers to current position in screen pixel space
|
float *xpos, float *ypos, // pointers to current position in screen pixel space
|
||||||
@ -669,6 +683,7 @@ struct stbtt_pack_context {
|
|||||||
int height;
|
int height;
|
||||||
int stride_in_bytes;
|
int stride_in_bytes;
|
||||||
int padding;
|
int padding;
|
||||||
|
int skip_missing;
|
||||||
unsigned int h_oversample, v_oversample;
|
unsigned int h_oversample, v_oversample;
|
||||||
unsigned char *pixels;
|
unsigned char *pixels;
|
||||||
void *nodes;
|
void *nodes;
|
||||||
@ -694,7 +709,7 @@ STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index);
|
|||||||
// file will only define one font and it always be at offset 0, so it will
|
// file will only define one font and it always be at offset 0, so it will
|
||||||
// return '0' for index 0, and -1 for all other indices.
|
// return '0' for index 0, and -1 for all other indices.
|
||||||
|
|
||||||
// The following structure is defined publically so you can declare one on
|
// The following structure is defined publicly so you can declare one on
|
||||||
// the stack or as a global or etc, but you should treat it as opaque.
|
// the stack or as a global or etc, but you should treat it as opaque.
|
||||||
struct stbtt_fontinfo
|
struct stbtt_fontinfo
|
||||||
{
|
{
|
||||||
@ -733,6 +748,7 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
|
|||||||
// and you want a speed-up, call this function with the character you're
|
// and you want a speed-up, call this function with the character you're
|
||||||
// going to process, then use glyph-based functions instead of the
|
// going to process, then use glyph-based functions instead of the
|
||||||
// codepoint-based functions.
|
// codepoint-based functions.
|
||||||
|
// Returns 0 if the character codepoint is not defined in the font.
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -820,7 +836,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s
|
|||||||
// returns # of vertices and fills *vertices with the pointer to them
|
// returns # of vertices and fills *vertices with the pointer to them
|
||||||
// these are expressed in "unscaled" coordinates
|
// these are expressed in "unscaled" coordinates
|
||||||
//
|
//
|
||||||
// The shape is a series of countours. Each one starts with
|
// The shape is a series of contours. Each one starts with
|
||||||
// a STBTT_moveto, then consists of a series of mixed
|
// a STBTT_moveto, then consists of a series of mixed
|
||||||
// STBTT_lineto and STBTT_curveto segments. A lineto
|
// STBTT_lineto and STBTT_curveto segments. A lineto
|
||||||
// draws a line from previous endpoint to its x,y; a curveto
|
// draws a line from previous endpoint to its x,y; a curveto
|
||||||
@ -916,7 +932,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
|
|||||||
STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff);
|
STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff);
|
||||||
// These functions compute a discretized SDF field for a single character, suitable for storing
|
// These functions compute a discretized SDF field for a single character, suitable for storing
|
||||||
// in a single-channel texture, sampling with bilinear filtering, and testing against
|
// in a single-channel texture, sampling with bilinear filtering, and testing against
|
||||||
// larger than some threshhold to produce scalable fonts.
|
// larger than some threshold to produce scalable fonts.
|
||||||
// info -- the font
|
// info -- the font
|
||||||
// scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap
|
// scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap
|
||||||
// glyph/codepoint -- the character to generate the SDF for
|
// glyph/codepoint -- the character to generate the SDF for
|
||||||
@ -1825,7 +1841,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
|||||||
if (comp_verts) STBTT_free(comp_verts, info->userdata);
|
if (comp_verts) STBTT_free(comp_verts, info->userdata);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex));
|
if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); //-V595
|
||||||
STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex));
|
STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex));
|
||||||
if (vertices) STBTT_free(vertices, info->userdata);
|
if (vertices) STBTT_free(vertices, info->userdata);
|
||||||
vertices = tmp;
|
vertices = tmp;
|
||||||
@ -2196,7 +2212,7 @@ static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, st
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254))
|
if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) //-V560
|
||||||
return STBTT__CSERR("reserved operator");
|
return STBTT__CSERR("reserved operator");
|
||||||
|
|
||||||
// push immediate
|
// push immediate
|
||||||
@ -2368,7 +2384,8 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
|
|||||||
if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
|
if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
|
||||||
return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
|
return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
|
||||||
|
|
||||||
classDefTable = classDef1ValueArray + 2 * glyphCount;
|
// [DEAR IMGUI] Commented to fix static analyzer warning
|
||||||
|
//classDefTable = classDef1ValueArray + 2 * glyphCount;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
@ -2392,7 +2409,8 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
|
|||||||
return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
|
return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
classDefTable = classRangeRecords + 6 * classRangeCount;
|
// [DEAR IMGUI] Commented to fix static analyzer warning
|
||||||
|
//classDefTable = classRangeRecords + 6 * classRangeCount;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
@ -3024,6 +3042,8 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
|
|||||||
dx = -dx;
|
dx = -dx;
|
||||||
dy = -dy;
|
dy = -dy;
|
||||||
t = x0, x0 = xb, xb = t;
|
t = x0, x0 = xb, xb = t;
|
||||||
|
// [DEAR IMGUI] Fix static analyzer warning
|
||||||
|
(void)dx; // [ImGui: fix static analyzer warning]
|
||||||
}
|
}
|
||||||
|
|
||||||
x1 = (int) x_top;
|
x1 = (int) x_top;
|
||||||
@ -3161,7 +3181,13 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e,
|
|||||||
if (e->y0 != e->y1) {
|
if (e->y0 != e->y1) {
|
||||||
stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata);
|
stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata);
|
||||||
if (z != NULL) {
|
if (z != NULL) {
|
||||||
STBTT_assert(z->ey >= scan_y_top);
|
if (j == 0 && off_y != 0) {
|
||||||
|
if (z->ey < scan_y_top) {
|
||||||
|
// this can happen due to subpixel positioning and some kind of fp rounding error i think
|
||||||
|
z->ey = scan_y_top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds
|
||||||
// insert at front
|
// insert at front
|
||||||
z->next = active;
|
z->next = active;
|
||||||
active = z;
|
active = z;
|
||||||
@ -3230,7 +3256,7 @@ static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n)
|
|||||||
|
|
||||||
static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
|
static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
|
||||||
{
|
{
|
||||||
/* threshhold for transitioning to insertion sort */
|
/* threshold for transitioning to insertion sort */
|
||||||
while (n > 12) {
|
while (n > 12) {
|
||||||
stbtt__edge t;
|
stbtt__edge t;
|
||||||
int c01,c12,c,m,i,j;
|
int c01,c12,c,m,i,j;
|
||||||
@ -3365,7 +3391,7 @@ static void stbtt__add_point(stbtt__point *points, int n, float x, float y)
|
|||||||
points[n].y = y;
|
points[n].y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching
|
// tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching
|
||||||
static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n)
|
static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n)
|
||||||
{
|
{
|
||||||
// midpoint
|
// midpoint
|
||||||
@ -3790,6 +3816,7 @@ STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, in
|
|||||||
spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw;
|
spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw;
|
||||||
spc->h_oversample = 1;
|
spc->h_oversample = 1;
|
||||||
spc->v_oversample = 1;
|
spc->v_oversample = 1;
|
||||||
|
spc->skip_missing = 0;
|
||||||
|
|
||||||
stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);
|
stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);
|
||||||
|
|
||||||
@ -3815,6 +3842,11 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h
|
|||||||
spc->v_oversample = v_oversample;
|
spc->v_oversample = v_oversample;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip)
|
||||||
|
{
|
||||||
|
spc->skip_missing = skip;
|
||||||
|
}
|
||||||
|
|
||||||
#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1)
|
#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1)
|
||||||
|
|
||||||
static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width)
|
static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width)
|
||||||
@ -3968,6 +4000,9 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stb
|
|||||||
int x0,y0,x1,y1;
|
int x0,y0,x1,y1;
|
||||||
int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
|
int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
|
||||||
int glyph = stbtt_FindGlyphIndex(info, codepoint);
|
int glyph = stbtt_FindGlyphIndex(info, codepoint);
|
||||||
|
if (glyph == 0 && spc->skip_missing) {
|
||||||
|
rects[k].w = rects[k].h = 0;
|
||||||
|
} else {
|
||||||
stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
|
stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
|
||||||
scale * spc->h_oversample,
|
scale * spc->h_oversample,
|
||||||
scale * spc->v_oversample,
|
scale * spc->v_oversample,
|
||||||
@ -3975,6 +4010,7 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stb
|
|||||||
&x0,&y0,&x1,&y1);
|
&x0,&y0,&x1,&y1);
|
||||||
rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
|
rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
|
||||||
rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
|
rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
|
||||||
|
}
|
||||||
++k;
|
++k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4027,7 +4063,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const
|
|||||||
sub_y = stbtt__oversample_shift(spc->v_oversample);
|
sub_y = stbtt__oversample_shift(spc->v_oversample);
|
||||||
for (j=0; j < ranges[i].num_chars; ++j) {
|
for (j=0; j < ranges[i].num_chars; ++j) {
|
||||||
stbrp_rect *r = &rects[k];
|
stbrp_rect *r = &rects[k];
|
||||||
if (r->was_packed) {
|
if (r->was_packed && r->w != 0 && r->h != 0) {
|
||||||
stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];
|
stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];
|
||||||
int advance, lsb, x0,y0,x1,y1;
|
int advance, lsb, x0,y0,x1,y1;
|
||||||
int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
|
int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
|
||||||
@ -4141,6 +4177,19 @@ STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *
|
|||||||
return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);
|
return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap)
|
||||||
|
{
|
||||||
|
int i_ascent, i_descent, i_lineGap;
|
||||||
|
float scale;
|
||||||
|
stbtt_fontinfo info;
|
||||||
|
stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index));
|
||||||
|
scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size);
|
||||||
|
stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap);
|
||||||
|
*ascent = (float) i_ascent * scale;
|
||||||
|
*descent = (float) i_descent * scale;
|
||||||
|
*lineGap = (float) i_lineGap * scale;
|
||||||
|
}
|
||||||
|
|
||||||
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer)
|
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer)
|
||||||
{
|
{
|
||||||
float ipw = 1.0f / pw, iph = 1.0f / ph;
|
float ipw = 1.0f / pw, iph = 1.0f / ph;
|
||||||
@ -4253,7 +4302,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
|
|||||||
int winding = 0;
|
int winding = 0;
|
||||||
|
|
||||||
orig[0] = x;
|
orig[0] = x;
|
||||||
orig[1] = y;
|
//orig[1] = y; // [DEAR IMGUI] commmented double assignment
|
||||||
|
|
||||||
// make sure y never passes through a vertex of the shape
|
// make sure y never passes through a vertex of the shape
|
||||||
y_frac = (float) STBTT_fmod(y, 1.0f);
|
y_frac = (float) STBTT_fmod(y, 1.0f);
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
// imgui_stl.cpp
|
|
||||||
// Wrappers for C++ standard library (STL) types (std::string, etc.)
|
|
||||||
// This is also an example of how you may wrap your own similar types.
|
|
||||||
|
|
||||||
// Compatibility:
|
|
||||||
// - std::string support is only guaranteed to work from C++11.
|
|
||||||
// If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture)
|
|
||||||
|
|
||||||
#include "imgui.h"
|
|
||||||
#include "imgui_stl.h"
|
|
||||||
|
|
||||||
struct InputTextCallback_UserData
|
|
||||||
{
|
|
||||||
std::string* Str;
|
|
||||||
ImGuiInputTextCallback ChainCallback;
|
|
||||||
void* ChainCallbackUserData;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int InputTextCallback(ImGuiInputTextCallbackData* data)
|
|
||||||
{
|
|
||||||
InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData;
|
|
||||||
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
|
|
||||||
{
|
|
||||||
// Resize string callback
|
|
||||||
std::string* str = user_data->Str;
|
|
||||||
IM_ASSERT(data->Buf == str->c_str());
|
|
||||||
str->resize(data->BufTextLen);
|
|
||||||
data->Buf = (char*)str->c_str();
|
|
||||||
}
|
|
||||||
else if (user_data->ChainCallback)
|
|
||||||
{
|
|
||||||
// Forward to user callback, if any
|
|
||||||
data->UserData = user_data->ChainCallbackUserData;
|
|
||||||
return user_data->ChainCallback(data);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
|
|
||||||
{
|
|
||||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
|
||||||
flags |= ImGuiInputTextFlags_CallbackResize;
|
|
||||||
|
|
||||||
InputTextCallback_UserData cb_user_data;
|
|
||||||
cb_user_data.Str = str;
|
|
||||||
cb_user_data.ChainCallback = callback;
|
|
||||||
cb_user_data.ChainCallbackUserData = user_data;
|
|
||||||
return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
|
|
||||||
{
|
|
||||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
|
||||||
flags |= ImGuiInputTextFlags_CallbackResize;
|
|
||||||
|
|
||||||
InputTextCallback_UserData cb_user_data;
|
|
||||||
cb_user_data.Str = str;
|
|
||||||
cb_user_data.ChainCallback = callback;
|
|
||||||
cb_user_data.ChainCallbackUserData = user_data;
|
|
||||||
return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data);
|
|
||||||
}
|
|
332
Source/ThirdParty/ImGuiLibrary/README.md
vendored
332
Source/ThirdParty/ImGuiLibrary/README.md
vendored
@ -1,332 +0,0 @@
|
|||||||
dear imgui,
|
|
||||||
=====
|
|
||||||
[![Build Status](https://travis-ci.org/ocornut/imgui.svg?branch=master)](https://travis-ci.org/ocornut/imgui)
|
|
||||||
[![Coverity Status](https://scan.coverity.com/projects/4720/badge.svg)](https://scan.coverity.com/projects/4720)
|
|
||||||
|
|
||||||
_(This library is free but needs your support to sustain its development. There are many desirable features and maintenance ahead. If you are an individual using dear imgui, please consider donating via Patreon or PayPal. If your company is using dear imgui, please consider financial support (e.g. sponsoring a few weeks/months of development. I can invoice for technical support, custom development etc. Email: omarcornut at gmail)._
|
|
||||||
|
|
||||||
Monthly donations via Patreon:
|
|
||||||
<br>[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/imgui)
|
|
||||||
|
|
||||||
One-off donations via PayPal:
|
|
||||||
<br>[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5Q73FPZ9C526U)
|
|
||||||
|
|
||||||
Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
|
|
||||||
|
|
||||||
Dear ImGui is designed to enable fast iterations and to empower programmers to create content creation tools and visualization / debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Dear ImGui is self-contained within a few files that you can easily copy and compile into your application/engine:
|
|
||||||
- imgui.cpp
|
|
||||||
- imgui.h
|
|
||||||
- imgui_demo.cpp
|
|
||||||
- imgui_draw.cpp
|
|
||||||
- imgui_widgets.cpp
|
|
||||||
- imgui_internal.h
|
|
||||||
- imconfig.h (empty by default, user-editable)
|
|
||||||
- stb_rect_pack.h
|
|
||||||
- stb_textedit.h
|
|
||||||
- stb_truetype.h
|
|
||||||
|
|
||||||
No specific build process is required. You can add the .cpp files to your project or #include them from an existing file.
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
Your code passes mouse/keyboard/gamepad inputs and settings to Dear ImGui (see example applications for more details). After Dear ImGui is setup, you can use it from \_anywhere\_ in your program loop:
|
|
||||||
|
|
||||||
Code:
|
|
||||||
```cpp
|
|
||||||
ImGui::Text("Hello, world %d", 123);
|
|
||||||
if (ImGui::Button("Save"))
|
|
||||||
{
|
|
||||||
// do stuff
|
|
||||||
}
|
|
||||||
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
|
|
||||||
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
|
|
||||||
```
|
|
||||||
Result:
|
|
||||||
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_02.png)
|
|
||||||
<br>_(settings: Dark style (left), Light style (right) / Font: Roboto-Medium, 16px / Rounding: 5)_
|
|
||||||
|
|
||||||
Code:
|
|
||||||
```cpp
|
|
||||||
// Create a window called "My First Tool", with a menu bar.
|
|
||||||
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
|
|
||||||
if (ImGui::BeginMenuBar())
|
|
||||||
{
|
|
||||||
if (ImGui::BeginMenu("File"))
|
|
||||||
{
|
|
||||||
if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ }
|
|
||||||
if (ImGui::MenuItem("Save", "Ctrl+S")) { /* Do stuff */ }
|
|
||||||
if (ImGui::MenuItem("Close", "Ctrl+W")) { my_tool_active = false; }
|
|
||||||
ImGui::EndMenu();
|
|
||||||
}
|
|
||||||
ImGui::EndMenuBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Edit a color (stored as ~4 floats)
|
|
||||||
ImGui::ColorEdit4("Color", my_color);
|
|
||||||
|
|
||||||
// Plot some values
|
|
||||||
const float my_values[] = { 0.2f, 0.1f, 1.0f, 0.5f, 0.9f, 2.2f };
|
|
||||||
ImGui::PlotLines("Frame Times", my_values, IM_ARRAYSIZE(my_values));
|
|
||||||
|
|
||||||
// Display contents in a scrolling region
|
|
||||||
ImGui::TextColored(ImVec4(1,1,0,1), "Important Stuff");
|
|
||||||
ImGui::BeginChild("Scrolling");
|
|
||||||
for (int n = 0; n < 50; n++)
|
|
||||||
ImGui::Text("%04d: Some text", n);
|
|
||||||
ImGui::EndChild();
|
|
||||||
ImGui::End();
|
|
||||||
```
|
|
||||||
Result:
|
|
||||||
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_03_color.gif)
|
|
||||||
|
|
||||||
### How it works
|
|
||||||
|
|
||||||
Check out the References section if you want to understand the core principles behind the IMGUI paradigm. An IMGUI tries to minimize state duplication, state synchronization and state storage from the user's point of view. It is less error prone (less code and less bugs) than traditional retained-mode interfaces, and lends itself to create dynamic user interfaces.
|
|
||||||
|
|
||||||
Dear ImGui outputs vertex buffers and command lists that you can easily render in your application. The number of draw calls and state changes is typically very small. Because it doesn't know or touch graphics state directly, you can call ImGui commands anywhere in your code (e.g. in the middle of a running algorithm, or in the middle of your own rendering process). Refer to the sample applications in the examples/ folder for instructions on how to integrate dear imgui with your existing codebase.
|
|
||||||
|
|
||||||
_A common misunderstanding is to mistake immediate mode gui for immediate mode rendering, which usually implies hammering your driver/GPU with a bunch of inefficient draw calls and state changes as the gui functions are called. This is NOT what Dear ImGui does. Dear ImGui outputs vertex buffers and a small list of draw calls batches. It never touches your GPU directly. The draw call batches are decently optimal and you can render them later, in your app or even remotely._
|
|
||||||
|
|
||||||
Dear ImGui allows you create elaborate tools as well as very short-lived ones. On the extreme side of short-liveness: using the Edit&Continue (hot code reload) feature of modern compilers you can add a few widgets to tweaks variables while your application is running, and remove the code a minute later! Dear ImGui is not just for tweaking values. You can use it to trace a running algorithm by just emitting text commands. You can use it along with your own reflection data to browse your dataset live. You can use it to expose the internals of a subsystem in your engine, to create a logger, an inspection tool, a profiler, a debugger, an entire game making editor/framework, etc.
|
|
||||||
|
|
||||||
Demo Binaries
|
|
||||||
-------------
|
|
||||||
|
|
||||||
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
|
|
||||||
- [imgui-demo-binaries-20180512.zip](http://www.miracleworld.net/imgui/binaries/imgui-demo-binaries-20180512.zip) (Windows binaries, Dear ImGui 1.61 WIP built 2018/05/12, 5 executables)
|
|
||||||
|
|
||||||
The demo applications are unfortunately not yet DPI aware so expect some blurriness on a 4K screen. For DPI awareness you can load/reload your font at different scale, and scale your Style with `style.ScaleAllSizes()`.
|
|
||||||
|
|
||||||
Bindings
|
|
||||||
--------
|
|
||||||
|
|
||||||
Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading one texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that. If you are an experienced programmer and at ease with those concepts, it should take you less than an hour to integrate Dear ImGui in your custom engine, but make sure to spend time reading the FAQ, the comments and other documentation!
|
|
||||||
|
|
||||||
_NB: those third-party bindings may be more or less maintained, more or less close to the original API (as people who create language bindings sometimes haven't used the C++ API themselves.. for the good reason that they aren't C++ users). Dear ImGui was designed with C++ in mind and some of the subtleties may be lost in translation with other languages. If your language supports it, I would suggest replicating the function overloading and default parameters used in the original, else the API may be harder to use. In doubt, please check the original C++ version first!_
|
|
||||||
|
|
||||||
Languages: (third-party bindings)
|
|
||||||
- C: [cimgui](https://github.com/Extrawurst/cimgui) or [sonoro1234's cimgui](https://github.com/sonoro1234/cimgui) (more recent update), also see [#1879](https://github.com/ocornut/imgui/issues/1879)
|
|
||||||
- C#/.Net: [ImGui.NET](https://github.com/mellinoe/ImGui.NET)
|
|
||||||
- ChaiScript: [imgui-chaiscript](https://github.com/JuJuBoSc/imgui-chaiscript)
|
|
||||||
- D: [DerelictImgui](https://github.com/Extrawurst/DerelictImgui)
|
|
||||||
- Go: [go-imgui](https://github.com/Armored-Dragon/go-imgui)
|
|
||||||
- Haxe/hxcpp: [linc_imgui](https://github.com/Aidan63/linc_imgui)
|
|
||||||
- Java: [jimgui](https://github.com/ice1000/jimgui)
|
|
||||||
- JavaScript: [imgui-js](https://github.com/flyover/imgui-js)
|
|
||||||
- Lua: [imgui_lua_bindings](https://github.com/patrickriordan/imgui_lua_bindings) or [lua-ffi-bindings](https://github.com/thenumbernine/lua-ffi-bindings)
|
|
||||||
- Odin: [odin-dear_imgui](https://github.com/ThisDrunkDane/odin-dear_imgui)
|
|
||||||
- Pascal: [imgui-pas](https://github.com/dpethes/imgui-pas)
|
|
||||||
- PureBasic: [pb-cimgui](https://github.com/hippyau/pb-cimgui)
|
|
||||||
- Python [CyImGui](https://github.com/chromy/cyimgui) or [pyimgui](https://github.com/swistakm/pyimgui)
|
|
||||||
- Rust: [imgui-rs](https://github.com/Gekkio/imgui-rs)
|
|
||||||
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
|
|
||||||
|
|
||||||
Frameworks:
|
|
||||||
- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+/ES2/ES3, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
|
|
||||||
- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
|
|
||||||
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
|
|
||||||
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
|
|
||||||
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
|
|
||||||
- Unmerged PR: ORX: [#1843](https://github.com/ocornut/imgui/pull/1843)
|
|
||||||
- Cinder: [Cinder-ImGui](https://github.com/simongeilfus/Cinder-ImGui)
|
|
||||||
- Cocos2d-x: [imguix](https://github.com/c0i/imguix), [issue #551](https://github.com/ocornut/imgui/issues/551)
|
|
||||||
- Flexium: [FlexGUI](https://github.com/DXsmiley/FlexGUI)
|
|
||||||
- GML/GameMakerStudio2: [ImGuiGML](https://marketplace.yoyogames.com/assets/6221/imguigml)
|
|
||||||
- Irrlicht: [IrrIMGUI](https://github.com/ZahlGraf/IrrIMGUI)
|
|
||||||
- Ogre: [ogreimgui](https://bitbucket.org/LMCrashy/ogreimgui/src)
|
|
||||||
- OpenFrameworks: [ofxImGui](https://github.com/jvcleave/ofxImGui)
|
|
||||||
- OpenSceneGraph/OSG: [gist](https://gist.github.com/fulezi/d2442ca7626bf270226014501357042c)
|
|
||||||
- LÖVE+Lua: [love-imgui](https://github.com/slages/love-imgui)
|
|
||||||
- Magnum: [magnum-imgui](https://github.com/lecopivo/magnum-imgui), [MagnumImguiPort](https://github.com/lecopivo/MagnumImguiPort)
|
|
||||||
- NanoRT: [syoyo/imgui](https://github.com/syoyo/imgui/tree/nanort)
|
|
||||||
- Qt3d: [imgui-qt3d](https://github.com/alpqr/imgui-qt3d), QOpenGLWindow [qtimgui](https://github.com/ocornut/imgui/issues/1910)
|
|
||||||
- SFML: [imgui-sfml](https://github.com/EliasD/imgui-sfml)
|
|
||||||
- Software renderer: [imgui_software_renderer](https://github.com/emilk/imgui_software_renderer)
|
|
||||||
- Unreal Engine 4: [segross/UnrealImGui](https://github.com/segross/UnrealImGui) or [sronsse/UnrealEngine_ImGui](https://github.com/sronsse/UnrealEngine_ImGui)
|
|
||||||
|
|
||||||
For other bindings: see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings/). Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas.
|
|
||||||
|
|
||||||
Roadmap
|
|
||||||
-------
|
|
||||||
Some of the goals for 2018 are:
|
|
||||||
- Finish work on gamepad/keyboard controls. (see [#787](https://github.com/ocornut/imgui/issues/787))
|
|
||||||
- Finish work on viewports and multiple OS windows management. (see [#1542](https://github.com/ocornut/imgui/issues/1542))
|
|
||||||
- Finish work on docking, tabs. (see [#351](https://github.com/ocornut/imgui/issues/351#issuecomment-346865709))
|
|
||||||
- Make Columns better. (they are currently pretty terrible!)
|
|
||||||
- Make the examples look better, improve styles, improve font support, make the examples hi-DPI aware.
|
|
||||||
|
|
||||||
Gallery
|
|
||||||
-------
|
|
||||||
User screenshots:
|
|
||||||
<br>[Gallery Part 1](https://github.com/ocornut/imgui/issues/123) (Feb 2015 to Feb 2016)
|
|
||||||
<br>[Gallery Part 2](https://github.com/ocornut/imgui/issues/539) (Feb 2016 to Aug 2016)
|
|
||||||
<br>[Gallery Part 3](https://github.com/ocornut/imgui/issues/772) (Aug 2016 to Jan 2017)
|
|
||||||
<br>[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
|
|
||||||
<br>[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
|
|
||||||
<br>[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 to June 2018)
|
|
||||||
<br>[Gallery Part 7](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
|
|
||||||
<br>Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
|
|
||||||
|
|
||||||
Various tools
|
|
||||||
[![screenshot game](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v149/gallery_TheDragonsTrap-01-thumb.jpg)](https://cloud.githubusercontent.com/assets/8225057/20628927/33e14cac-b329-11e6-80f6-9524e93b048a.png)
|
|
||||||
|
|
||||||
[![screenshot tool](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white_preview.jpg)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white.png)
|
|
||||||
|
|
||||||
![screenshot demo](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/v160-misc-classic.png)
|
|
||||||
|
|
||||||
[![screenshot profiler](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v148/profiler-880.jpg)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v148/profiler.png)
|
|
||||||
|
|
||||||
Dear ImGui can load TTF/OTF fonts. UTF-8 is supported for text display and input. Here using Arial Unicode font to display Japanese. Initialize custom font with:
|
|
||||||
Code:
|
|
||||||
```cpp
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
|
||||||
io.Fonts->AddFontFromFileTTF("NotoSansCJKjp-Medium.otf", 20.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
|
|
||||||
```
|
|
||||||
```cpp
|
|
||||||
ImGui::Text(u8"こんにちは!テスト %d", 123);
|
|
||||||
if (ImGui::Button(u8"ロード"))
|
|
||||||
{
|
|
||||||
// do stuff
|
|
||||||
}
|
|
||||||
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
|
|
||||||
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
|
|
||||||
```
|
|
||||||
Result:
|
|
||||||
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_02_jp.png)
|
|
||||||
<br>_(settings: Dark style (left), Light style (right) / Font: NotoSansCJKjp-Medium, 20px / Rounding: 5)_
|
|
||||||
|
|
||||||
References
|
|
||||||
----------
|
|
||||||
|
|
||||||
The Immediate Mode GUI paradigm may at first appear unusual to some users. This is mainly because "Retained Mode" GUIs have been so widespread and predominant. The following links can give you a better understanding about how Immediate Mode GUIs works.
|
|
||||||
- [Johannes 'johno' Norneby's article](http://www.johno.se/book/imgui.html).
|
|
||||||
- [A presentation by Rickard Gustafsson and Johannes Algelind](http://www.cse.chalmers.se/edu/year/2011/course/TDA361/Advanced%20Computer%20Graphics/IMGUI.pdf).
|
|
||||||
- [Jari Komppa's tutorial on building an ImGui library](http://iki.fi/sol/imgui/).
|
|
||||||
- [Casey Muratori's original video that popularized the concept](https://mollyrocket.com/861).
|
|
||||||
- [Nicolas Guillemot's CppCon'16 flash-talk about Dear ImGui](https://www.youtube.com/watch?v=LSRJ1jZq90k).
|
|
||||||
- [Thierry Excoffier's Zero Memory Widget](http://perso.univ-lyon1.fr/thierry.excoffier/ZMW/).
|
|
||||||
|
|
||||||
See the [Wiki](https://github.com/ocornut/imgui/wiki) and [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for third-party bindings to different languages and frameworks.
|
|
||||||
|
|
||||||
Support Forums
|
|
||||||
--------------
|
|
||||||
|
|
||||||
If you have issues with: compiling, linking, adding fonts, running or displaying Dear ImGui, or wiring inputs: please post on the Discourse forum: https://discourse.dearimgui.org/c/getting-started.
|
|
||||||
|
|
||||||
For any other questions, bug reports, requests, feedback, you may post on https://github.com/ocornut/imgui/issues.
|
|
||||||
|
|
||||||
Frequently Asked Question (FAQ)
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
**Where is the documentation?**
|
|
||||||
|
|
||||||
- The documentation is at the top of imgui.cpp + effectively imgui.h.
|
|
||||||
- Example code is in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function. It covers most features of ImGui so you can read the code and call the function itself to see its output.
|
|
||||||
- Standalone example applications using e.g. OpenGL/DirectX are provided in the examples/ folder.
|
|
||||||
- We obviously needs better documentation! Consider contributing or becoming a [Patron](http://www.patreon.com/imgui) to promote this effort.
|
|
||||||
|
|
||||||
**Which version should I get?**
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
**Who uses Dear ImGui?**
|
|
||||||
|
|
||||||
See the [Software using dear imgui page](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) for an (incomplete) list of games/software which are publicly known to use dear imgui. Please add yours if you can!
|
|
||||||
|
|
||||||
**Why the odd dual naming, "dear imgui" vs "ImGui"?**
|
|
||||||
|
|
||||||
The library started its life and is best known as "ImGui" only due to the fact that I didn't give it a proper name when I released it. However, the term IMGUI (immediate-mode graphical user interface) was coined before and is being used in variety of other situations. It seemed confusing and unfair to hog the name. To reduce the ambiguity without affecting existing codebases, I have decided on an alternate, longer name "dear imgui" that people can use to refer to this specific library in ambiguous situations.
|
|
||||||
|
|
||||||
**How can I tell whether to dispatch mouse/keyboard to imgui or to my application?**
|
|
||||||
<br>**How can I display an image? What is ImTextureID, how does it works?**
|
|
||||||
<br>**How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.**
|
|
||||||
<br>**How can I use my own math types instead of ImVec2/ImVec4?**
|
|
||||||
<br>**How can I load a different font than the default?**
|
|
||||||
<br>**How can I easily use icons in my application?**
|
|
||||||
<br>**How can I load multiple fonts?**
|
|
||||||
<br>**How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?**
|
|
||||||
<br>**How can I use the drawing facilities without an Dear ImGui window? (using ImDrawList API)**
|
|
||||||
<br>**I integrated Dear ImGui in my engine and the text or lines are blurry..**
|
|
||||||
<br>**I integrated Dear ImGui in my engine and some elements are disappearing when I move windows around..**
|
|
||||||
<br>**How can I help?**
|
|
||||||
|
|
||||||
See the FAQ in imgui.cpp for answers.
|
|
||||||
|
|
||||||
**How do you use Dear ImGui on a platform that may not have a mouse or keyboard?**
|
|
||||||
|
|
||||||
You can control Dear ImGui with a gamepad, see the explanation in imgui.cpp about how to use the navigation feature (short version: map your gamepad inputs into the `io.NavInputs[]` array and set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad`).
|
|
||||||
|
|
||||||
You can share your computer mouse seamlessly with your console/tablet/phone using [Synergy](http://synergy-project.org). This is the preferred solution for developer productivity. In particular, their [micro-synergy-client](https://github.com/symless/micro-synergy-client) repo there is _uSynergy.c_ sources for a small embeddable that you can use on any platform to connect to your host PC using Synergy 1.x. You may also use a third party solution such as [Remote ImGui](https://github.com/JordiRos/remoteimgui).
|
|
||||||
|
|
||||||
For touch inputs, you can increase the hit box of widgets (via the _style.TouchPadding_ setting) to accommodate a little 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.
|
|
||||||
|
|
||||||
**Can you create elaborate/serious tools with Dear ImGui?**
|
|
||||||
|
|
||||||
Yes. People have written game editors, data browsers, debuggers, profilers and all sort 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.
|
|
||||||
|
|
||||||
Dear ImGui is very programmer centric and the immediate-mode GUI paradigm might requires you to readjust some habits before you can realize its full potential. Dear ImGui is about making things that are simple, efficient and powerful.
|
|
||||||
|
|
||||||
**Can you reskin the look of Dear ImGui?**
|
|
||||||
|
|
||||||
You can alter the look of the interface to some degree: changing colors, sizes, padding, rounding, 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. Below is a screenshot from [LumixEngine](https://github.com/nem0/LumixEngine) with custom colors + a docking/tabs extension (both of which you can find in the Issues section and will eventually be merged):
|
|
||||||
|
|
||||||
![LumixEngine](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v151/lumix-201710-rearranged.png)
|
|
||||||
|
|
||||||
**Why using C++ (as opposed to C)?**
|
|
||||||
|
|
||||||
Dear ImGui takes advantage of a few C++ languages features for convenience but nothing anywhere Boost-insanity/quagmire. Dear ImGui does NOT require C++11 so it can be used with most old C++ compilers. Dear ImGui doesn't use any C++ header file. Language-wise, function overloading and default parameters are used to make the API easier to use and code more terse. 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.
|
|
||||||
|
|
||||||
There is a [c-api for ImGui (cimgui)](https://github.com/Extrawurst/cimgui) by Stephan Dilly + a newer, [auto-generated cimgui](https://github.com/sonoro1234/cimgui) by sonoro1234. Both are designed for binding other languages. 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 third-party bindings to other languages.
|
|
||||||
|
|
||||||
Support dear imgui
|
|
||||||
------------------
|
|
||||||
|
|
||||||
**How can I help financing further development of Dear ImGui?**
|
|
||||||
|
|
||||||
Your contributions are keeping the library alive. If you are an individual using dear imgui, please consider donating to enable me to spend more time improving the library.
|
|
||||||
|
|
||||||
Monthly donations via Patreon:
|
|
||||||
<br>[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/imgui)
|
|
||||||
|
|
||||||
One-off donations via PayPal:
|
|
||||||
<br>[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5Q73FPZ9C526U)
|
|
||||||
|
|
||||||
Ongoing dear imgui development is financially supported on [**Patreon**](http://www.patreon.com/imgui) and by private sponsors.
|
|
||||||
If your company uses dear imgui, please consider financial support (e.g. sponsoring a few weeks/months of development. I can also invoice for private support, custom development etc. contact me for details: omarcornut at gmail). Thanks!
|
|
||||||
|
|
||||||
**Platinum-chocolate sponsors**
|
|
||||||
- Blizzard Entertainment.
|
|
||||||
|
|
||||||
**Double-chocolate sponsors**
|
|
||||||
- Media Molecule, Mobigame, Insomniac Games, Aras Pranckevičius, Lizardcube, Greggman, DotEmu, Nadeo, Supercell, Runner, Artometa, Friendly Shade.
|
|
||||||
|
|
||||||
**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.
|
|
||||||
|
|
||||||
**Caramel supporters**
|
|
||||||
- Michel Courtine, César Leblic, Dale Kim, Alex Evans, Rui Figueira, Paul Patrashcu, Jerome Lanquetot, Ctrl Alt Ninja, Paul Fleming, Neil Henning, Stephan Dilly, Neil Blakey-Milner, Aleksei, NeiloGD, Justin Paver, FiniteSol, Vincent Pancaldi, James Billot, Robin Hübner, furrtek, Eric, Simon Barratt, Game Atelier, Julian Bosch, Simon Lundmark, Vincent Hamm, Farhan Wali, Matt Reyer, Colin Riley, Victor Martins, Josh Simmons, Garrett Hoofman, Sergio Gonzales, Andrew Berridge, Roy Eltham, Game Preservation Society, Kit framework, Josh Faust, Martin Donlon, Quinton, Felix, Andrew Belt, Codecat, Cort Stratton, Claudio Canepa, Doug McNabb, Emmanuel Julien, Guillaume Chereau, Jeffrey Slutter, Jeremiah Deckard, r-lyeh, Roger Clark, Nekith, Joshua Fisher, Malte Hoffmann, Mustafa Karaalioglu, Merlyn Morgan-Graham, Per Vognsen, Fabian Giesen, Jan Staubach, Matt Hargett, John Shearer, Jesse Chounard, kingcoopa, Miloš Tošić, Jonas Bernemann, Johan Andersson, Nathan Hartman, Michael Labbe, Tomasz Golebiowski, Louis Schnellbach, Felipe Alfonso, Jimmy Andrews, Bojan Endrovski, Robin Berg Pettersen, Rachel Crawford, Edsel Malasig, Andrew Johnson, Sean Hunter, Jordan Mellow, Nefarius Software Solutions, Laura Wieme, Robert Nix, Mick Honey, Astrofra, Jonas Lehmann, Steven Kah Hien Wong, Bartosz Bielecki, Oscar Penas, A M, Liam Moynihan.
|
|
||||||
|
|
||||||
And all other supporters; THANK YOU!
|
|
||||||
(Please contact me if you would like to be added or removed from this list)
|
|
||||||
|
|
||||||
Credits
|
|
||||||
-------
|
|
||||||
|
|
||||||
Developed by [Omar Cornut](http://www.miracleworld.net) and every direct or indirect contributors to the GitHub. The early version of this library was developed with the support of [Media Molecule](http://www.mediamolecule.com) and first used internally on the game [Tearaway](http://tearaway.mediamolecule.com).
|
|
||||||
|
|
||||||
I first discovered imgui principles at [Q-Games](http://www.q-games.com) where Atman had dropped his own simple imgui implementation in the codebase, which I spent quite some time improving and thinking about. It turned out that Atman was exposed to the concept directly by working with Casey. When I moved to Media Molecule I rewrote a new library trying to overcome the flaws and limitations of the first one I've worked with. It became this library and since then I have spent an unreasonable amount of time iterating on it.
|
|
||||||
|
|
||||||
Embeds [ProggyClean.ttf](http://upperbounds.net) font by Tristan Grimmer (MIT license).
|
|
||||||
|
|
||||||
Embeds [stb_textedit.h, stb_truetype.h, stb_rectpack.h](https://github.com/nothings/stb/) by Sean Barrett (public domain).
|
|
||||||
|
|
||||||
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
Dear ImGui is licensed under the MIT License, see LICENSE for more information.
|
|
Loading…
Reference in New Issue
Block a user