コード例 #1
0
ファイル: SampleGame.cs プロジェクト: tlgkccampbell/ImGui.NET
        protected override void LoadContent()
        {
            // Texture loading example

            // First, load the texture as a Texture2D (can also be done using the XNA/FNA content pipeline)
            _xnaTexture = Texture2D.FromStream(GraphicsDevice, GenerateImage(300, 150));

            // Then, bind it to an ImGui-friendly pointer, that we can use during regular ImGui.** calls (see below)
            _imGuiTexture = _imGuiRenderer.BindTexture(_xnaTexture);

            base.LoadContent();
        }
コード例 #2
0
ファイル: SampleGame.cs プロジェクト: bobdavies2000/OpenCVB
        protected override void LoadContent()
        {
            // Texture loading example
            // First, load the texture as a Texture2D (can also be done using the XNA/FNA content pipeline)
            _xnaTexture = CreateTexture(GraphicsDevice, width, height, pixel =>
            {
                var red = (pixel % 100) / 2;
                return(new Color(red, 1, 1));
            });
            // Then, bind it to an ImGui-friendly pointer, that we can use during regular ImGui.** calls (see below)
            _imGuiTexture = _imGuiRenderer.BindTexture(_xnaTexture);

            base.LoadContent();
        }