コード例 #1
0
        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));
        }
コード例 #2
0
        /// <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));
        }
コード例 #3
0
 public TextureViewInfo(IntPtr imGuiBinding, TextureView textureView)
 {
     ImGuiBinding = imGuiBinding;
     View         = textureView;
 }