mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-22 16:57:00 +00:00
Add plotLines (#158)
This commit is contained in:
parent
9dac0f9fbe
commit
051a17a1c5
@ -237,6 +237,7 @@ module DearImGui
|
|||||||
, listBox
|
, listBox
|
||||||
|
|
||||||
-- ** Data Plotting
|
-- ** Data Plotting
|
||||||
|
, plotLines
|
||||||
, plotHistogram
|
, plotHistogram
|
||||||
|
|
||||||
-- ** Menus
|
-- ** Menus
|
||||||
@ -1590,6 +1591,12 @@ listBox label selectedIndex items = liftIO $ Managed.with m return
|
|||||||
|
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
|
-- | Wraps @ImGui::PlotLines()@.
|
||||||
|
plotLines :: MonadIO m => Text -> [CFloat] -> m ()
|
||||||
|
plotLines label values = liftIO $
|
||||||
|
withArrayLen values \len valuesPtr ->
|
||||||
|
Text.withCString label \labelPtr ->
|
||||||
|
Raw.plotLines labelPtr valuesPtr (fromIntegral len)
|
||||||
|
|
||||||
-- | Wraps @ImGui::PlotHistogram()@.
|
-- | Wraps @ImGui::PlotHistogram()@.
|
||||||
plotHistogram :: MonadIO m => Text -> [CFloat] -> m ()
|
plotHistogram :: MonadIO m => Text -> [CFloat] -> m ()
|
||||||
|
@ -193,6 +193,7 @@ module DearImGui.Raw
|
|||||||
, listBox
|
, listBox
|
||||||
|
|
||||||
-- * Data Plotting
|
-- * Data Plotting
|
||||||
|
, plotLines
|
||||||
, plotHistogram
|
, plotHistogram
|
||||||
|
|
||||||
-- ** Menus
|
-- ** Menus
|
||||||
@ -1250,6 +1251,10 @@ listBox :: (MonadIO m) => CString -> Ptr CInt -> Ptr CString -> CInt -> m Bool
|
|||||||
listBox labelPtr iPtr itemsPtr itemsLen = liftIO do
|
listBox labelPtr iPtr itemsPtr itemsLen = liftIO do
|
||||||
(0 /=) <$> [C.exp| bool { ListBox($(char* labelPtr), $(int* iPtr), $(char** itemsPtr), $(int itemsLen)) }|]
|
(0 /=) <$> [C.exp| bool { ListBox($(char* labelPtr), $(int* iPtr), $(char** itemsPtr), $(int itemsLen)) }|]
|
||||||
|
|
||||||
|
-- | Wraps @ImGui::PlotLines()@.
|
||||||
|
plotLines :: (MonadIO m) => CString -> Ptr CFloat -> CInt -> m ()
|
||||||
|
plotLines labelPtr valuesPtr valuesLen = liftIO do
|
||||||
|
[C.exp| void { PlotLines($(char* labelPtr), $(float* valuesPtr), $(int valuesLen)) } |]
|
||||||
|
|
||||||
-- | Wraps @ImGui::PlotHistogram()@.
|
-- | Wraps @ImGui::PlotHistogram()@.
|
||||||
plotHistogram :: (MonadIO m) => CString -> Ptr CFloat -> CInt -> m ()
|
plotHistogram :: (MonadIO m) => CString -> Ptr CFloat -> CInt -> m ()
|
||||||
|
Loading…
Reference in New Issue
Block a user