mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-12-22 20:56:36 +00:00
Add plotLines (#158)
This commit is contained in:
parent
9dac0f9fbe
commit
051a17a1c5
@ -237,6 +237,7 @@ module DearImGui
|
||||
, listBox
|
||||
|
||||
-- ** Data Plotting
|
||||
, plotLines
|
||||
, plotHistogram
|
||||
|
||||
-- ** Menus
|
||||
@ -1590,6 +1591,12 @@ listBox label selectedIndex items = liftIO $ Managed.with m return
|
||||
|
||||
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()@.
|
||||
plotHistogram :: MonadIO m => Text -> [CFloat] -> m ()
|
||||
|
@ -193,6 +193,7 @@ module DearImGui.Raw
|
||||
, listBox
|
||||
|
||||
-- * Data Plotting
|
||||
, plotLines
|
||||
, plotHistogram
|
||||
|
||||
-- ** Menus
|
||||
@ -1250,6 +1251,10 @@ listBox :: (MonadIO m) => CString -> Ptr CInt -> Ptr CString -> CInt -> m Bool
|
||||
listBox labelPtr iPtr itemsPtr itemsLen = liftIO do
|
||||
(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()@.
|
||||
plotHistogram :: (MonadIO m) => CString -> Ptr CFloat -> CInt -> m ()
|
||||
|
Loading…
Reference in New Issue
Block a user