Wrap ImGui::IsItemHovered()

This commit is contained in:
Ollie Charles 2021-01-24 17:39:35 +00:00
parent 93b729dae3
commit 4ca9a3d38f

View File

@ -87,6 +87,9 @@ module DearImGui
, openPopup , openPopup
, closeCurrentPopup , closeCurrentPopup
-- * Item/Widgets Utilities
, isItemHovered
-- * Types -- * Types
, ImGuiDir , ImGuiDir
, pattern ImGuiDirLeft , pattern ImGuiDirLeft
@ -533,6 +536,14 @@ closeCurrentPopup = liftIO do
[C.exp| void { CloseCurrentPopup() } |] [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. -- | A cardinal direction.
newtype ImGuiDir = ImGuiDir CInt newtype ImGuiDir = ImGuiDir CInt