/// <summary>
        /// Call this to start the demo
        /// (Entry Point)
        /// </summary>
        public static void Run()
        {
            //do this becuase .Net has been erroring with file permissions
            //just leave this line it.
            string dir = Settings.DataDir;


            //create a new window to display stuff
            Window window = new Window(new System.Drawing.Size(1000, 750));
            window.Title = "Physics2D.Net Demo";


            //Create a new Scene 
            Scene scene = new Scene();

            //Get the scene's physics engine
            PhysicsEngine physicsEngine = scene.Engine;
            //initialize the engine 
            physicsEngine.BroadPhase = new Physics2DDotNet.Detectors.SweepAndPruneDetector();
            //physicsEngine.BroadPhase = new Physics2DDotNet.Detectors.SpatialHashDetector();
            Physics2DDotNet.Solvers.SequentialImpulsesSolver solver= new Physics2DDotNet.Solvers.SequentialImpulsesSolver();
            //solver.Iterations = 3;
            solver.Freezing = true;
            physicsEngine.Solver = solver;
            //physicsEngine.Solver = new Physics2DDotNet.Solvers.Box2DSolver();



            Viewport viewport = new Viewport(
                new Rectangle(0, 0, window.Size.Width, window.Size.Height), //where
                Matrix2x3.Identity, //how
                scene, //who
                new Lifespan()); // how long 
            window.AddViewport(viewport);

            // you can change the veiwport via this 
            viewport.ToScreen = Matrix2x3.FromTransformation(.09f, new Vector2D(40, 0));

            //make it so the veiwport will be resized whn the window is
            window.Resized += delegate(object sender, SizeEventArgs e)
            {
                viewport.Width = e.Width;
                viewport.Height = e.Height;
            };
            System.Windows.Forms.Application.EnableVisualStyles();
            //create the GUI
            DemoSelector selector = new DemoSelector();
            //initialize the GUI
            selector.Initialize(window, viewport, scene);
            //Create the window
            window.Intialize();
            window.DrawingInterval = .02f;
            //Add some intro text
            AddIntroText(window, viewport, scene);

            SetupStatus(window, scene);


            //Show the GUI
            selector.Show();
            //start the physicstimer for Layer.PhysicsEngine
            scene.Timer.IsRunning = true;
            //Begin the rendering loop. 
            window.Run();
            return;
        }
        /// <summary>
        /// creates a overlay scene to display status text.
        /// </summary>
        /// <param name="window"></param>
        /// <param name="scene"></param>
        private static void SetupStatus(Window window, Scene scene)
        {

            Scene scene2 = new Scene();
            PhysicsEngine physicsEngine2 = scene2.Engine;
            physicsEngine2.BroadPhase = new Physics2DDotNet.Detectors.SelectiveSweepDetector();
            //physicsEngine.BroadPhase = new Physics2DDotNet.Detectors.SpatialHashDetector();
            Physics2DDotNet.Solvers.SequentialImpulsesSolver solver = new Physics2DDotNet.Solvers.SequentialImpulsesSolver();
            solver.Iterations = 1;
            
            physicsEngine2.Solver = solver;

            Viewport viewport2 = new Viewport(
                    new Rectangle(0, 0, window.Size.Width, window.Size.Height), //where
                    Matrix2x3.Identity, //how
                    scene2, //who
                    new Lifespan()); // how long
            window.AddViewport(viewport2);


            window.Resized += delegate(object sender, SizeEventArgs e)
            {
                viewport2.Width = e.Width;
                viewport2.Height = e.Height;
            };

            numbers = new IShape[10];
            numbers2 = new SurfacePolygons[10];
            for (int index = 0; index < numbers.Length; ++index)
            {
                numbers2[index] = Cache<SurfacePolygons>.GetItem(numberString[index] + "|FreeSans.ttf:20", Color.Black);
                numbers[index] = ShapeFactory.CreateSprite(numbers2[index], 0, 8, 2);
                SpriteDrawable s = numbers[index].Tag as SpriteDrawable;
                s.Color = new ScalarColor4(.1f, .1f, 1, 1);
            }

            DoBodyCount(window, viewport2, scene, scene2, new Vector2D(100, 2));
            DoJointCount(window, viewport2, scene, scene2, new Vector2D(100, 30));
            DoLogicsCount(window, viewport2, scene, scene2, new Vector2D(270, 2));
            DoFPS(window, viewport2, scene, scene2, new Vector2D(2, 2));
            DoUPS(window, viewport2, scene, scene2, new Vector2D(2, 30));
        }