From 150ad95bd6dcc65589fd548f883d8d3121f58d32 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 12 Aug 2014 00:36:13 +0100 Subject: [PATCH] Missing assert + comments --- imgui.cpp | 1 + imgui.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 0b00b8495..1f73d5691 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -694,6 +694,7 @@ public: static ImGuiWindow* GetCurrentWindow() { + IM_ASSERT(GImGui.CurrentWindow != NULL); // ImGui::NewFrame() hasn't been called yet? GImGui.CurrentWindow->Accessed = true; return GImGui.CurrentWindow; } diff --git a/imgui.h b/imgui.h index 88cc02c70..42b1f9cc7 100644 --- a/imgui.h +++ b/imgui.h @@ -391,10 +391,13 @@ struct ImGuiIO bool KeysDown[512]; // Keyboard keys that are pressed (in whatever order user naturally has access to keyboard data) char InputCharacters[16]; // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper. - // Output - Retrieve after calling NewFrame(), you can use them to discard inputs for the rest of your application + // Output - Retrieve after calling NewFrame(), you can use them to discard inputs or hide them from the rest of your application bool WantCaptureMouse; // ImGui is using your mouse input (= window is being hovered or widget is active). bool WantCaptureKeyboard; // imGui is using your keyboard input (= widget is active). + // Function + void AddInputCharacter(char c); // Helper to add a new character into InputCharacters[] + // [Internal] ImGui will maintain those fields for you ImVec2 MousePosPrev; ImVec2 MouseDelta; @@ -406,7 +409,6 @@ struct ImGuiIO float KeysDownTime[512]; ImGuiIO(); - void AddInputCharacter(char c); // Helper to add a new character into InputCharacters[] }; //-----------------------------------------------------------------------------