Ejemplo n.º 1
0
 void Update(float dt)
 {
     Input.Start();
     if (DemoHarness != null)
     {
         //We'll let the delegate's logic handle the variable time steps.
         DemoHarness.Update(dt);
         //At the moment, rendering just follows sequentially. Later on we might want to distinguish it a bit more with fixed time stepping or something. Maybe.
         DemoHarness.Render(Renderer);
     }
     Renderer.Render(Camera);
     Surface.Present();
     Input.End();
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var            window = new Window("pretty cool multicolored window", new Int2((int)(DisplayDevice.Default.Width * 0.75f), (int)(DisplayDevice.Default.Height * 0.75f)), WindowMode.Windowed);
            var            loop   = new GameLoop(window);
            ContentArchive content;

            using (var stream = typeof(Program).Assembly.GetManifestResourceStream("bepuphysics2_for_nelalen.Demos.contentarchive"))
            {
                content = ContentArchive.Load(stream);
            }
            var demo = new DemoHarness(loop, content);

            loop.Run(demo);
            loop.Dispose();
            window.Dispose();
        }
Ejemplo n.º 3
0
 public void Run(DemoHarness harness)
 {
     DemoHarness = harness;
     Window.Run(Update, OnResize);
 }