mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-04 05:43:19 +08:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_win32.cpp # imgui.cpp # imgui_demo.cpp # imgui_internal.h
This commit is contained in:
+26
-4
@@ -956,8 +956,9 @@ static void DemoWindowWidgetsBasic()
|
||||
ImGui::SeparatorText("Inputs");
|
||||
|
||||
{
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file.
|
||||
// If you want to use InputText() with std::string or any custom dynamic string type:
|
||||
// - For std::string: use the wrapper in misc/cpp/imgui_stdlib.h/.cpp
|
||||
// - Otherwise, see the 'Dear ImGui Demo->Widgets->Text Input->Resize Callback' for using ImGuiInputTextFlags_CallbackResize.
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/InputText");
|
||||
static char str0[128] = "Hello, world!";
|
||||
ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
|
||||
@@ -3780,8 +3781,10 @@ static void DemoWindowWidgetsTextInput()
|
||||
IMGUI_DEMO_MARKER("Widgets/Text Input/Multi-line Text Input");
|
||||
if (ImGui::TreeNode("Multi-line Text Input"))
|
||||
{
|
||||
// Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize
|
||||
// and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings.
|
||||
// WE ARE USING A FIXED-SIZE BUFFER FOR SIMPLICITY HERE.
|
||||
// If you want to use InputText() with std::string or any custom dynamic string type:
|
||||
// - For std::string: use the wrapper in misc/cpp/imgui_stdlib.h/.cpp
|
||||
// - Otherwise, see the 'Dear ImGui Demo->Widgets->Text Input->Resize Callback' for using ImGuiInputTextFlags_CallbackResize.
|
||||
static char text[1024 * 16] =
|
||||
"/*\n"
|
||||
" The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
|
||||
@@ -8272,6 +8275,25 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
#ifdef IMGUI_HAS_DOCK
|
||||
ImGui::Text("define: IMGUI_HAS_DOCK");
|
||||
#endif
|
||||
#ifdef NDEBUG
|
||||
ImGui::Text("define: NDEBUG");
|
||||
#endif
|
||||
|
||||
// Heuristic to detect no-op IM_ASSERT() macros
|
||||
// - This is designed so people opening bug reports would convey and notice that they have disabled asserts for Dear ImGui code.
|
||||
// - 16 is > strlen("((void)(_EXPR))") which we suggested in our imconfig.h template as a possible way to disable.
|
||||
int assert_runs_expression = 0;
|
||||
IM_ASSERT(++assert_runs_expression);
|
||||
int assert_expand_len = (int)strlen(IM_STRINGIFY(IM_ASSERT(true)));
|
||||
bool assert_maybe_disabled = (!assert_runs_expression || assert_expand_len <= 16);
|
||||
ImGui::Text("IM_ASSERT: runs expression: %s. expand size: %s%s",
|
||||
assert_runs_expression ? "OK" : "KO", (assert_expand_len > 16) ? "OK" : "KO", assert_maybe_disabled ? " (MAYBE DISABLED?!)" : "");
|
||||
if (assert_maybe_disabled)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
HelpMarker("IM_ASSERT() calls assert() by default. Compiling with NDEBUG will usually strip out assert() to nothing, which is NOT recommended because we use asserts to notify of programmer mistakes!");
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
|
||||
ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL");
|
||||
|
||||
Reference in New Issue
Block a user