Skip to content

Commit dc2227b

Browse files
authored
Update imgui dependency to 1.91.3 (Released 2024-10-04) (#215)
1 parent c555b8d commit dc2227b

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

examples/sdl/Image.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import qualified SDL as SDL
2323

2424
-- For the texture creation
2525
import Foreign
26+
import Foreign.C.String
2627
import qualified Data.Vector.Storable as VS
2728

2829
data Texture = Texture
@@ -152,7 +153,8 @@ mainLoop window textures flag = unlessQuit do
152153
Foreign.with (ImVec2 1 1) \uv1Ptr ->
153154
Foreign.with (ImVec4 1 1 1 1) \tintColPtr ->
154155
Foreign.with (ImVec4 1 1 1 1) \bgColPtr ->
155-
Raw.imageButton openGLtextureID sizePtr uv0Ptr uv1Ptr (-1) bgColPtr tintColPtr
156+
withCString "##btn" \idPtr ->
157+
Raw.imageButton idPtr openGLtextureID sizePtr uv0Ptr uv1Ptr bgColPtr tintColPtr
156158
else
157159
pure False
158160

examples/vulkan/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import qualified DearImGui.Vulkan as ImGui.Vulkan
8181
import qualified DearImGui.SDL as ImGui.SDL
8282
import qualified DearImGui.SDL.Vulkan as ImGui.SDL.Vulkan
8383
import Util (vmaVulkanFunctions)
84-
import Foreign (Ptr, castPtr, copyBytes, with, withForeignPtr, wordPtrToPtr)
84+
import Foreign (Ptr, castPtr, copyBytes, with, withForeignPtr, wordPtrToPtr, nullPtr)
8585
import qualified DearImGui.Raw as ImGui.Raw
8686
import UnliftIO (MonadUnliftIO)
8787
import qualified Vulkan.CStruct.Extends as Vulkan
@@ -111,11 +111,11 @@ gui texture = do
111111
with (ImGui.Raw.ImVec4 1 1 1 1) \tintColPtr ->
112112
with (ImGui.Raw.ImVec4 1 1 1 1) \bgColPtr ->
113113
ImGui.Raw.imageButton
114+
nullPtr
114115
(snd texture)
115116
sizePtr
116117
uv0Ptr
117118
uv1Ptr
118-
(-1)
119119
bgColPtr
120120
tintColPtr
121121

generator/DearImGui/Generator/Parser.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ headers = do
143143
)
144144
( try $ many comment >> keyword "struct" >> identifier)
145145

146-
_ <- skipManyTill anySingle ( namedSection "Helpers: Memory allocations macros, ImVector<>" )
146+
_ <- skipManyTill anySingle ( namedSection "Helpers: Debug log, memory allocations macros, ImVector<>" )
147147

148148
_ <- skipManyTill anySingle ( namedSection "ImGuiStyle" )
149149

@@ -153,6 +153,8 @@ headers = do
153153

154154
_ <- skipManyTill anySingle ( namedSection "Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)" )
155155

156+
_ <- skipManyTill anySingle ( namedSection "Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiSelectionRequestType, ImGuiSelectionRequest, ImGuiMultiSelectIO, ImGuiSelectionBasicStorage)" )
157+
156158
_ <- skipManyTill anySingle ( namedSection "Drawing API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData)" )
157159
skipManyTill anySingle ( try . lookAhead $ many comment *> keyword "enum" )
158160
drawingEnums <- many ( enumeration enumNamesAndTypes )

imgui

Submodule imgui updated 67 files

src/DearImGui/Raw.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,23 +823,22 @@ image userTextureIDPtr sizePtr uv0Ptr uv1Ptr tintColPtr borderColPtr = liftIO do
823823
-- Negative @frame_padding@ uses default frame padding settings. Set to 0 for no padding.
824824
--
825825
-- Wraps @ImGui::ImageButton()@.
826-
imageButton :: (MonadIO m) => Ptr () -> Ptr ImVec2 -> Ptr ImVec2 -> Ptr ImVec2 -> CInt -> Ptr ImVec4 -> Ptr ImVec4 -> m Bool
827-
imageButton userTextureIDPtr sizePtr uv0Ptr uv1Ptr framePadding bgColPtr tintColPtr = liftIO do
826+
imageButton :: (MonadIO m) => CString -> Ptr () -> Ptr ImVec2 -> Ptr ImVec2 -> Ptr ImVec2 -> Ptr ImVec4 -> Ptr ImVec4 -> m Bool
827+
imageButton labelPtr userTextureIDPtr sizePtr uv0Ptr uv1Ptr bgColPtr tintColPtr = liftIO do
828828
(0 /=) <$> [C.exp|
829829
bool {
830830
ImageButton(
831+
$(char* labelPtr),
831832
$(void* userTextureIDPtr),
832833
*$(ImVec2* sizePtr),
833834
*$(ImVec2* uv0Ptr),
834835
*$(ImVec2* uv1Ptr),
835-
$(int framePadding),
836836
*$(ImVec4* bgColPtr),
837837
*$(ImVec4* tintColPtr)
838838
)
839839
}
840840
|]
841841

842-
843842
-- | Wraps @ImGui::Checkbox()@.
844843
checkbox :: (MonadIO m) => CString -> Ptr CBool -> m Bool
845844
checkbox labelPtr boolPtr = liftIO do

0 commit comments

Comments
 (0)