Exemple #1
0
        /// <summary>
        /// Draw
        /// NOTE : PlotQuilt uses `Task.Factory` parallel routine and fills Texture framebuffer on completion.
        /// </summary>
        /// <param name="gameTime"></param>
        protected override void Draw(GameTime gameTime)
        {
            FPS++;

            if (TValues != null && TValues[0] != null)
            {
                for (int i = 0; i < TValues.Length; i++)
                {
                    DebugWindow.Add("Tval" + TValues[i].qid.ToString(), TValues[i].running);
                }
            }
            DebugWindow.Update();

            if (Update_Catmul())
            {
            }

            GraphicsDevice.SetRenderTarget(null);

            GraphicsDevice.Clear(Color.Transparent);

            spriteBatch.Begin();

            switch (programState)
            {
            case ProgramState.menu:
                QuiltOutline();
                DrawQuilt();
                DisplaySampleData();
                switch (quiltType)
                {
                case QuiltType.Square:
                    MenuText(Quilt, gameTime);
                    break;

                case QuiltType.Hexagon:
                    MenuText(Hexgn, gameTime);
                    break;

                case QuiltType.Icon:
                    MenuText(Icon1, gameTime);
                    break;

                case QuiltType.Icon3:
                    MenuText(Icon3, gameTime);
                    break;

                default:
                    break;
                }
                Draw_Colour_Band(5);
                break;

            case ProgramState.iterate:
                QuiltOutline();
                DrawQuilt();

                IterateText();
                if (isPaused)
                {
                    Draw_Colour_Band(_screenHit - 32);
                    DisplaySampleData();
                    Paused();
                }
                break;

            case ProgramState.sampling:
                Draw_Colour_Band(_screenHit - 32);
                DoSampling(_screenHit - 36);
                DrawQuilt();
                SamplingText();
                break;

            default:
                break;
            }

            Catmul_Spline.Draw(ref spriteBatch);

            Vector2 pos = new Vector2(800, 20);

            foreach (var line in DebugText)
            {
                spriteBatch.DrawString(font, line, pos, Color.White);
                pos.Y += 20;
            }

            DebugWindow.Draw();

            spriteBatch.End();

            base.Draw(gameTime);
        }