mirror of
https://github.com/ocornut/imgui.git
synced 2025-01-31 03:53:44 +01:00
Comments. Fixed warnings.
This commit is contained in:
parent
d1ea03b872
commit
793773209b
@ -11129,6 +11129,8 @@ static void ImGui::ErrorCheckEndFrameSanityChecks()
|
|||||||
// while still correctly asserting on mid-frame key press events.
|
// while still correctly asserting on mid-frame key press events.
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
const ImGuiKeyChord key_mods = GetMergedModsFromKeys();
|
const ImGuiKeyChord key_mods = GetMergedModsFromKeys();
|
||||||
|
IM_UNUSED(g);
|
||||||
|
IM_UNUSED(key_mods);
|
||||||
IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
|
IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
|
||||||
IM_UNUSED(key_mods);
|
IM_UNUSED(key_mods);
|
||||||
|
|
||||||
|
@ -599,8 +599,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors.");
|
ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors.");
|
||||||
ImGui::Text("Also see Style->Rendering for rendering options.");
|
ImGui::Text("Also see Style->Rendering for rendering options.");
|
||||||
|
|
||||||
// Read https://github.com/ocornut/imgui/wiki/Error-Handling
|
// Also read: https://github.com/ocornut/imgui/wiki/Error-Handling
|
||||||
ImGui::SeparatorText("Error Handling");
|
ImGui::SeparatorText("Error Handling");
|
||||||
|
|
||||||
ImGui::Checkbox("io.ConfigErrorRecovery", &io.ConfigErrorRecovery);
|
ImGui::Checkbox("io.ConfigErrorRecovery", &io.ConfigErrorRecovery);
|
||||||
ImGui::SameLine(); HelpMarker(
|
ImGui::SameLine(); HelpMarker(
|
||||||
"Options to configure how we handle recoverable errors.\n"
|
"Options to configure how we handle recoverable errors.\n"
|
||||||
@ -615,6 +616,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
if (!io.ConfigErrorRecoveryEnableAssert && !io.ConfigErrorRecoveryEnableDebugLog && !io.ConfigErrorRecoveryEnableTooltip)
|
if (!io.ConfigErrorRecoveryEnableAssert && !io.ConfigErrorRecoveryEnableDebugLog && !io.ConfigErrorRecoveryEnableTooltip)
|
||||||
io.ConfigErrorRecoveryEnableAssert = io.ConfigErrorRecoveryEnableDebugLog = io.ConfigErrorRecoveryEnableTooltip = true;
|
io.ConfigErrorRecoveryEnableAssert = io.ConfigErrorRecoveryEnableDebugLog = io.ConfigErrorRecoveryEnableTooltip = true;
|
||||||
|
|
||||||
|
// Also read: https://github.com/ocornut/imgui/wiki/Debug-Tools
|
||||||
ImGui::SeparatorText("Debug");
|
ImGui::SeparatorText("Debug");
|
||||||
ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
|
ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
|
||||||
ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
|
ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
|
||||||
@ -653,6 +655,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset);
|
ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset);
|
||||||
ImGui::CheckboxFlags("io.BackendFlags: RendererHasViewports", &io.BackendFlags, ImGuiBackendFlags_RendererHasViewports);
|
ImGui::CheckboxFlags("io.BackendFlags: RendererHasViewports", &io.BackendFlags, ImGuiBackendFlags_RendererHasViewports);
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
}
|
}
|
||||||
|
@ -2077,15 +2077,14 @@ struct ImGuiLocEntry
|
|||||||
// Macros used by Recoverable Error handling
|
// Macros used by Recoverable Error handling
|
||||||
// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
|
// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
|
||||||
// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
|
// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
|
||||||
// - The intent is that you may rewire this macro to dispatch dynamically:
|
// - See 'Demo->Configuration->Error Handling' and ImGuiIO definitions for details on error handling.
|
||||||
// - On programmers machines, when debugger is attached, on direct imgui API usage error: always assert!
|
// - Read https://github.com/ocornut/imgui/wiki/Error-Handling for details on error handling.
|
||||||
// - On exception recovery and script language recovery: you may decide to error log.
|
|
||||||
#ifndef IM_ASSERT_USER_ERROR
|
#ifndef IM_ASSERT_USER_ERROR
|
||||||
#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
|
#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The error callback is currently not public, as it is expected that only advanced users will rely on it.
|
||||||
typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback
|
typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Metrics, Debug Tools
|
// [SECTION] Metrics, Debug Tools
|
||||||
|
Loading…
x
Reference in New Issue
Block a user