This commit is a preparation toward adding ImGui apis with explicit context
and making ImGui applications being able to use multiple context at the same time
whatever their concurrency model.
About ImGuiIO:
- ImGuiIO depends on ImGuiContext because some of its method want to event to `g.InputEventQueue`.
- To make ImGuiIO aware of the context to use, context which creates the ImGuiIO is given as argument of ImGuiIO constructor.
- The assert `IM_ASSERT(&g.IO == this && "Can only add events to current context.")` has been removed since it does not make sense anymore
NOTE: ImGuiIO could be completely independent of ImGuiContext if the InputEventQueue was moved from ImGuiContext to ImGuiIO, but since
ImGuiIO is a public class it would expose InputEvent type. Solving this problem is out of the current scope, but it is interesting to notice.
features/potocpav-newer-lines-2
Marc Delormeago%!(EXTRA string=3 years)committed byocornut
IM_ASSERT(&g.IO==this&&"Can only add events to current context.");
IM_ASSERT(ImGui::IsNamedKeyOrModKey(key));// Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API.
IM_ASSERT(ImGui::IsNamedKeyOrModKey(key));// Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API.
IM_ASSERT(!ImGui::IsAliasKey(key));// Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events.
IM_ASSERT(!ImGui::IsAliasKey(key));// Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events.
IM_ASSERT(key!=ImGuiMod_Shortcut);// We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself)
IM_ASSERT(key!=ImGuiMod_Shortcut);// We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself)