Added storage for up to 5 mouse buttons for convenience (even though ImGui itself only uses 1)

This commit is contained in:
ocornut 2014-08-15 16:22:03 +01:00
parent 6267905a17
commit fa0aa5ace6
2 changed files with 6 additions and 8 deletions

View File

@ -110,7 +110,6 @@
ISSUES AND TODO-LIST ISSUES AND TODO-LIST
- misc: allow user to call NewFrame() multiple times without a render. - misc: allow user to call NewFrame() multiple times without a render.
- misc: add extra mouse buttons for user storage (and clarify that ImGui doesn't use them)
- misc: merge ImVec4 / ImGuiAabb, they are essentially duplicate containers - misc: merge ImVec4 / ImGuiAabb, they are essentially duplicate containers
- window: autofit is losing its purpose when user relies on any dynamic layout (window width multiplier, column). maybe just discard autofit? - window: autofit is losing its purpose when user relies on any dynamic layout (window width multiplier, column). maybe just discard autofit?
- window: support horizontal scroll - window: support horizontal scroll
@ -151,7 +150,6 @@
- shortcuts: add a shortcut api, e.g. parse "&Save" and/or "Save (CTRL+S)", pass in to widgets or provide simple ways to use (button=activate, input=focus) - shortcuts: add a shortcut api, e.g. parse "&Save" and/or "Save (CTRL+S)", pass in to widgets or provide simple ways to use (button=activate, input=focus)
- keyboard: full keyboard navigation and focus - keyboard: full keyboard navigation and focus
- misc: not thread-safe - misc: not thread-safe
- tooltip: add a BeginTooltip()/EndTooltip() helper.
- optimisation/render: use indexed rendering - optimisation/render: use indexed rendering
- optimisation/render: move clip-rect to vertex data? would allow merging all commands - optimisation/render: move clip-rect to vertex data? would allow merging all commands
- optimisation/render: merge command-list of all windows into one command-list? - optimisation/render: merge command-list of all windows into one command-list?

12
imgui.h
View File

@ -402,7 +402,7 @@ struct ImGuiIO
// Input - Fill before calling NewFrame() // Input - Fill before calling NewFrame()
ImVec2 MousePos; // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) ImVec2 MousePos; // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
bool MouseDown[2]; // Mouse buttons bool MouseDown[5]; // Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
int MouseWheel; // Mouse wheel: -1,0,+1 int MouseWheel; // Mouse wheel: -1,0,+1
bool KeyCtrl; // Keyboard modifier pressed: Control bool KeyCtrl; // Keyboard modifier pressed: Control
bool KeyShift; // Keyboard modifier pressed: Shift bool KeyShift; // Keyboard modifier pressed: Shift
@ -419,11 +419,11 @@ struct ImGuiIO
// [Internal] ImGui will maintain those fields for you // [Internal] ImGui will maintain those fields for you
ImVec2 MousePosPrev; ImVec2 MousePosPrev;
ImVec2 MouseDelta; ImVec2 MouseDelta;
bool MouseClicked[2]; bool MouseClicked[5];
ImVec2 MouseClickedPos[2]; ImVec2 MouseClickedPos[5];
float MouseClickedTime[2]; float MouseClickedTime[5];
bool MouseDoubleClicked[2]; bool MouseDoubleClicked[5];
float MouseDownTime[2]; float MouseDownTime[5];
float KeysDownTime[512]; float KeysDownTime[512];
ImGuiIO(); ImGuiIO();