public MappedImageView(DiagnosticViewContext context, MappedImage mappedImageAsset) : base(context) { _texture = MappedImageUtility.CreateTexture(context.Game.GraphicsLoadContext, mappedImageAsset); var textureViewDescription = new TextureViewDescription(_texture, 0, 1, 0, 1); _textureView = AddDisposable(Context.Game.GraphicsDevice.ResourceFactory.CreateTextureView(ref textureViewDescription)); }
/// <summary> /// Gets or creates a handle for a texture to be drawn with ImGui. /// Pass the returned handle to Image() or ImageButton(). /// </summary> public static IntPtr GetOrCreateImGuiBinding(GraphicsDevice gd, Texture texture) { TextureView texView = gd.ResourceFactory.CreateTextureView(texture); return(GetOrCreateImGuiBinding(gd, texView)); }
public TextureViewInfo(IntPtr imGuiBinding, TextureView textureView) { ImGuiBinding = imGuiBinding; View = textureView; }