public IntPtr GetOrCreateImGuiBinding(ImageView textureView) { if (!_setsByView.TryGetValue(textureView, out ResourceSetInfo rsi)) { DescriptorSet resourceSet = new DescriptorSet(resourceLayoutTex, textureView); rsi = new ResourceSetInfo(GetNextImGuiBindingID(), resourceSet); _setsByView.Add(textureView, rsi); _viewsById.Add(rsi.ImGuiBinding, rsi); _ownedResources.Add(resourceSet); } return(rsi.ImGuiBinding); }
/// <summary> /// Gets or creates a handle for a texture to be drawn with ImGui. /// Pass the returned handle to Image() or ImageButton(). /// </summary> public IntPtr GetOrCreateImGuiBinding(ResourceFactory factory, TextureView textureView) { if (!_setsByView.TryGetValue(textureView, out ResourceSetInfo rsi)) { ResourceSet resourceSet = factory.CreateResourceSet(new ResourceSetDescription(_textureLayout, textureView)); rsi = new ResourceSetInfo(GetNextImGuiBindingId(), resourceSet); _setsByView.Add(textureView, rsi); _viewsById.Add(rsi.ImGuiBinding, rsi); _ownedResources.Add(resourceSet); } return(rsi.ImGuiBinding); }
/// <summary> /// Gets or creates a handle for a texture to be drawn with ImGui. /// Pass the returned handle to Image() or ImageButton(). /// </summary> public IntPtr GetOrCreateImGuiBinding(ResourceFactory factory, TextureView textureView) { #if DEBUG using Profiler fullProfiler = new Profiler(GetType()); #endif if (!setsByView.TryGetValue(textureView, out ResourceSetInfo rsi)) { ResourceSet resourceSet = factory.CreateResourceSet(new ResourceSetDescription(textureLayout, textureView)); rsi = new ResourceSetInfo(GetNextImGuiBindingID(), resourceSet); setsByView.Add(textureView, rsi); viewsById.Add(rsi.ImGuiBinding, rsi); ownedResources.Add(resourceSet); } return(rsi.ImGuiBinding); }