From 4ca9a3d38fe33a1927405b863123d76c700b6318 Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Sun, 24 Jan 2021 17:39:35 +0000 Subject: [PATCH] Wrap ImGui::IsItemHovered() --- src/DearImGui.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/DearImGui.hs b/src/DearImGui.hs index e6c4cf6..2a9bdea 100644 --- a/src/DearImGui.hs +++ b/src/DearImGui.hs @@ -87,6 +87,9 @@ module DearImGui , openPopup , closeCurrentPopup + -- * Item/Widgets Utilities + , isItemHovered + -- * Types , ImGuiDir , pattern ImGuiDirLeft @@ -533,6 +536,14 @@ closeCurrentPopup = liftIO do [C.exp| void { CloseCurrentPopup() } |] +-- | Is the last item hovered? (and usable, aka not blocked by a popup, etc.). +-- +-- Wraps @ImGui::IsItemHovered()@ +isItemHovered :: MonadIO m => m Bool +isItemHovered = liftIO do + (1 ==) <$> [C.exp| bool { IsItemHovered() } |] + + -- | A cardinal direction. newtype ImGuiDir = ImGuiDir CInt