forked from bepu/bepuphysics2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple demo using the new demos engine
- Loading branch information
1 parent
233753f
commit 149c3fe
Showing
6 changed files
with
614 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using BepuUtilities; | ||
using DemoContentLoader; | ||
using DemoEngine; | ||
using DemoUtilities; | ||
using OpenTK; | ||
|
||
namespace SharpNeatWalker | ||
{ | ||
internal static class Program | ||
{ | ||
private static void Main() | ||
{ | ||
if (!false) // Run in the background | ||
using (var simulation = new WalkerDemo()) | ||
{ | ||
var start = System.DateTime.UtcNow; | ||
simulation.RunPhysics(canContinue: () => (System.DateTime.UtcNow - start).TotalSeconds < -5); // Run for a few secs | ||
} | ||
|
||
ContentArchive content; | ||
using (var stream = typeof(Demos.DemoHarness).Assembly.GetManifestResourceStream("Demos.Demos.contentarchive")) | ||
{ | ||
content = ContentArchive.Load(stream); | ||
} | ||
|
||
using (var window = new DemoEngine.Window("SharpNeat Walker", new Int2((int)(DisplayDevice.Default.Width * 0.75f), (int)(DisplayDevice.Default.Height * 0.75f)), WindowMode.Windowed)) | ||
using (var loop = new GameLoop(window)) | ||
{ | ||
var harness = new DemoHarness(loop, content, customDemoSet: new DemoSet().AddOption<WalkerDemo>()); | ||
loop.Run(harness); | ||
} | ||
|
||
/*var loop = new GameLoop(window); | ||
var demo = new DemoHarness(loop, content, customDemoSet: new DemoSet().AddOption<Walker>()); | ||
loop.Run(demo); | ||
loop.Dispose();*/ | ||
} | ||
} | ||
} |
Oops, something went wrong.