-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
enhancementNew feature or requestNew feature or request
Description
That question mainly about pointers management in Swift than SwiftImGui as is.
I'm trying to add thumbnail in asset browser, but get bad access because pointer to texture isn't valid at the moment when ImGuiImage have to be rendered.
I hold textures for thumbnails in dictionary and render it like this:
var textures: [String: MTLTexture]
....
let ptr = withUnsafePointer(to: &textures[name]) { ptr in
return UnsafeMutableRawPointer(mutating: ptr)
}
ImGuiImage(
ptr,
ImVec2(24, 24),
ImVec2(0, 0),
ImVec2(1, 1),
ImVec4(1, 1, 1, 1),
ImVec4(1, 1, 1, 1)
)It would be nice to use ids instead of pointers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request