Add formatPtr to Raw.dragFloat* and Raw.sliderFloat* (#165)

This commit is contained in:
Tristan de Cacqueray 2022-12-05 14:47:21 +00:00 committed by GitHub
parent d933248a2c
commit 52142bbf7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 32 deletions

View File

@ -646,7 +646,7 @@ dragFloat desc ref speed minValue maxValue = liftIO do
currentValue <- get ref currentValue <- get ref
with (realToFrac currentValue) \floatPtr -> do with (realToFrac currentValue) \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.dragFloat descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) Raw.dragFloat descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
newValue <- peek floatPtr newValue <- peek floatPtr
@ -661,7 +661,7 @@ dragFloat2 desc ref speed minValue maxValue = liftIO do
(x, y) <- get ref (x, y) <- get ref
withArray [ realToFrac x, realToFrac y ] \floatPtr -> do withArray [ realToFrac x, realToFrac y ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.dragFloat2 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) Raw.dragFloat2 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y'] <- peekArray 2 floatPtr [x', y'] <- peekArray 2 floatPtr
@ -675,7 +675,7 @@ dragFloat3 desc ref speed minValue maxValue = liftIO do
(x, y, z) <- get ref (x, y, z) <- get ref
withArray [ realToFrac x, realToFrac y, realToFrac z ] \floatPtr -> do withArray [ realToFrac x, realToFrac y, realToFrac z ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.dragFloat3 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) Raw.dragFloat3 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y', z'] <- peekArray 3 floatPtr [x', y', z'] <- peekArray 3 floatPtr
@ -690,7 +690,7 @@ dragFloat4 desc ref speed minValue maxValue = liftIO do
(x, y, z, u) <- get ref (x, y, z, u) <- get ref
withArray [ realToFrac x, realToFrac y, realToFrac z, realToFrac u ] \floatPtr -> do withArray [ realToFrac x, realToFrac y, realToFrac z, realToFrac u ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.dragFloat4 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) Raw.dragFloat4 descPtr floatPtr (CFloat speed) (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y', z', u'] <- peekArray 4 floatPtr [x', y', z', u'] <- peekArray 4 floatPtr
@ -969,7 +969,7 @@ sliderFloat desc ref minValue maxValue = liftIO do
currentValue <- get ref currentValue <- get ref
with (realToFrac currentValue) \floatPtr -> do with (realToFrac currentValue) \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.sliderFloat descPtr floatPtr (CFloat minValue) (CFloat maxValue) Raw.sliderFloat descPtr floatPtr (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
newValue <- peek floatPtr newValue <- peek floatPtr
@ -983,7 +983,7 @@ sliderFloat2 desc ref minValue maxValue = liftIO do
(x, y) <- get ref (x, y) <- get ref
withArray [ realToFrac x, realToFrac y ] \floatPtr -> do withArray [ realToFrac x, realToFrac y ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.sliderFloat2 descPtr floatPtr (CFloat minValue) (CFloat maxValue) Raw.sliderFloat2 descPtr floatPtr (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y'] <- peekArray 2 floatPtr [x', y'] <- peekArray 2 floatPtr
@ -997,7 +997,7 @@ sliderFloat3 desc ref minValue maxValue = liftIO do
(x, y, z) <- get ref (x, y, z) <- get ref
withArray [ realToFrac x, realToFrac y, realToFrac z ] \floatPtr -> do withArray [ realToFrac x, realToFrac y, realToFrac z ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.sliderFloat3 descPtr floatPtr (CFloat minValue) (CFloat maxValue) Raw.sliderFloat3 descPtr floatPtr (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y', z'] <- peekArray 3 floatPtr [x', y', z'] <- peekArray 3 floatPtr
@ -1011,7 +1011,7 @@ sliderFloat4 desc ref minValue maxValue = liftIO do
(x, y, z, u) <- get ref (x, y, z, u) <- get ref
withArray [ realToFrac x, realToFrac y, realToFrac z, realToFrac u ] \floatPtr -> do withArray [ realToFrac x, realToFrac y, realToFrac z, realToFrac u ] \floatPtr -> do
changed <- Text.withCString desc \descPtr -> changed <- Text.withCString desc \descPtr ->
Raw.sliderFloat4 descPtr floatPtr (CFloat minValue) (CFloat maxValue) Raw.sliderFloat4 descPtr floatPtr (CFloat minValue) (CFloat maxValue) nullPtr
when changed do when changed do
[x', y', z', u'] <- peekArray 4 floatPtr [x', y', z', u'] <- peekArray 4 floatPtr

View File

@ -693,27 +693,27 @@ combo labelPtr iPtr itemsPtr itemsLen = liftIO do
-- | Wraps @ImGui::DragFloat()@ -- | Wraps @ImGui::DragFloat()@
dragFloat :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> m Bool dragFloat :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> CString -> m Bool
dragFloat descPtr floatPtr speed minValue maxValue = liftIO do dragFloat descPtr floatPtr speed minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { DragFloat( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { DragFloat( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::DragFloat2()@ -- | Wraps @ImGui::DragFloat2()@
dragFloat2 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> m Bool dragFloat2 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> CString -> m Bool
dragFloat2 descPtr floatPtr speed minValue maxValue = liftIO do dragFloat2 descPtr floatPtr speed minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { DragFloat2( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { DragFloat2( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::DragFloat3()@ -- | Wraps @ImGui::DragFloat3()@
dragFloat3 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> m Bool dragFloat3 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> CString -> m Bool
dragFloat3 descPtr floatPtr speed minValue maxValue = liftIO do dragFloat3 descPtr floatPtr speed minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { DragFloat3( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { DragFloat3( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::DragFloat4()@ -- | Wraps @ImGui::DragFloat4()@
dragFloat4 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> m Bool dragFloat4 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CFloat -> CString -> m Bool
dragFloat4 descPtr floatPtr speed minValue maxValue = liftIO do dragFloat4 descPtr floatPtr speed minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { DragFloat4( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { DragFloat4( $(char* descPtr), $(float* floatPtr), $(float speed), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::DragFloatRange2()@ -- | Wraps @ImGui::DragFloatRange2()@
@ -853,27 +853,27 @@ dragScalarN labelPtr dataType dataPtr components vSpeed minPtr maxPtr formatPtr
maxPtr_ = castPtr maxPtr maxPtr_ = castPtr maxPtr
-- | Wraps @ImGui::SliderFloat()@ -- | Wraps @ImGui::SliderFloat()@
sliderFloat :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> m Bool sliderFloat :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> m Bool
sliderFloat descPtr floatPtr minValue maxValue = liftIO do sliderFloat descPtr floatPtr minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { SliderFloat( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { SliderFloat( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::SliderFloat2()@ -- | Wraps @ImGui::SliderFloat2()@
sliderFloat2 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> m Bool sliderFloat2 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> m Bool
sliderFloat2 descPtr floatPtr minValue maxValue = liftIO do sliderFloat2 descPtr floatPtr minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { SliderFloat2( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { SliderFloat2( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::SliderFloat3()@ -- | Wraps @ImGui::SliderFloat3()@
sliderFloat3 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> m Bool sliderFloat3 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> m Bool
sliderFloat3 descPtr floatPtr minValue maxValue = liftIO do sliderFloat3 descPtr floatPtr minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { SliderFloat3( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { SliderFloat3( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::SliderFloat4()@ -- | Wraps @ImGui::SliderFloat4()@
sliderFloat4 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> m Bool sliderFloat4 :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> m Bool
sliderFloat4 descPtr floatPtr minValue maxValue = liftIO do sliderFloat4 descPtr floatPtr minValue maxValue formatPtr = liftIO do
(0 /=) <$> [C.exp| bool { SliderFloat4( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue)) } |] (0 /=) <$> [C.exp| bool { SliderFloat4( $(char* descPtr), $(float* floatPtr), $(float minValue), $(float maxValue), $(char* formatPtr)) } |]
-- | Wraps @ImGui::SliderAngle()@ -- | Wraps @ImGui::SliderAngle()@
sliderAngle :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> ImGuiSliderFlags -> m Bool sliderAngle :: (MonadIO m) => CString -> Ptr CFloat -> CFloat -> CFloat -> CString -> ImGuiSliderFlags -> m Bool