mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2025-07-06 04:58:48 +02:00
Wrap ImGui::SliderFloat() (#9)
Co-authored-by: Ollie Charles <ollie@ocharles.org.uk>
This commit is contained in:
committed by
GitHub
parent
3185bf5e90
commit
2fbe257c24
11
Main.hs
11
Main.hs
@ -28,12 +28,13 @@ main = do
|
||||
|
||||
checked <- newIORef False
|
||||
color <- newIORef $ ImVec3 1 0 0
|
||||
loop w checked color
|
||||
slider <- newIORef 0.42
|
||||
loop w checked color slider
|
||||
|
||||
openGL2Shutdown
|
||||
|
||||
loop :: Window -> IORef Bool -> IORef ImVec3 -> IO ()
|
||||
loop w checked color = do
|
||||
loop :: Window -> IORef Bool -> IORef ImVec3 -> IORef Float -> IO ()
|
||||
loop w checked color slider = do
|
||||
quit <- pollEvents
|
||||
|
||||
openGL2NewFrame
|
||||
@ -73,6 +74,8 @@ loop w checked color = do
|
||||
|
||||
separator
|
||||
|
||||
sliderFloat "Slider" slider 0.0 1.0
|
||||
|
||||
progressBar 0.314 (Just "Pi")
|
||||
|
||||
beginCombo "Label" "Preview" >>= whenTrue do
|
||||
@ -104,7 +107,7 @@ loop w checked color = do
|
||||
|
||||
glSwapWindow w
|
||||
|
||||
if quit then return () else loop w checked color
|
||||
if quit then return () else loop w checked color slider
|
||||
|
||||
where
|
||||
|
||||
|
Reference in New Issue
Block a user