Skip to content

Commit

Permalink
Missing assert + comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Aug 11, 2014
1 parent ab8561e commit 150ad95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ struct ImGuiWindow

static ImGuiWindow* GetCurrentWindow()
{
IM_ASSERT(GImGui.CurrentWindow != NULL); // ImGui::NewFrame() hasn't been called yet?
GImGui.CurrentWindow->Accessed = true;
return GImGui.CurrentWindow;
}
Expand Down
6 changes: 4 additions & 2 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -406,7 +409,6 @@ struct ImGuiIO
float KeysDownTime[512];

ImGuiIO();
void AddInputCharacter(char c); // Helper to add a new character into InputCharacters[]
};

//-----------------------------------------------------------------------------
Expand Down

0 comments on commit 150ad95

Please sign in to comment.