_Layout.cshtml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @using BuildOurOwnBabylonJSServer.Extensions;
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8" />
  6. <title>@ViewBag.Title</title>
  7. <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
  8. <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
  9. <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
  10. @if (ViewBag.DoNotUseBabylonJS == null)
  11. {
  12. @Html.Raw(this.BabylonJSScript("cannon.js"))
  13. @Html.Raw(this.BabylonJSScript(@"Tools\BuildOurOwnBabylonJS\BuildOurOwnBabylonJS\ourOwnBabylon.js"))
  14. <script type="text/javascript">
  15. $(document).ready(function () {
  16. if (!BABYLON.Engine.isSupported()) {
  17. alert("Your browser does not support WebGL so you can't use BabylonJS on it");
  18. return;
  19. }
  20. var OURBABYLON = {};
  21. OURBABYLON.canvas = $("#ourOwnBabylonJSCanvas")[0];
  22. OURBABYLON.engine = new BABYLON.Engine(OURBABYLON.canvas, true);
  23. window.addEventListener("resize", function () {
  24. OURBABYLON.engine.resize();
  25. });
  26. window.OURBABYLON = OURBABYLON;
  27. });
  28. </script>
  29. }
  30. </head>
  31. <body>
  32. <div id="main">
  33. <div id="title">
  34. <h1>@ViewBag.Title</h1>
  35. <div id="menu">
  36. <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Blender", demoFile = "blender.babylon" })">Blender</a>
  37. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Dude", demoFile = "Dude.babylon" })">Dude</a>
  38. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Espilit", demoFile = "Espilit.incremental.babylon" })">Espilit</a>
  39. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Flat2009", demoFile = "Flat2009.babylon" })">Flat2009</a>
  40. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Heart", demoFile = "Heart.babylon" })">Heart</a>
  41. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Rabbit", demoFile = "Rabbit.babylon" })">Rabbit</a>
  42. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Robot", demoFile = "Robot.babylon" })">Robot</a>
  43. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "SpaceDek", demoFile = "SpaceDek.babylon" })">SpaceDek</a>
  44. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Spaceship", demoFile = "Spaceship.babylon" })">Spaceship</a>
  45. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "TheCar", demoFile = "TheCar.incremental.babylon" })">TheCar</a>
  46. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Train", demoFile = "Train.babylon" })">Train</a>
  47. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Viper", demoFile = "Viper.babylon" })">Viper</a>
  48. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "WCafe", demoFile = "WCafe.babylon" })">WCafe</a>
  49. </div>
  50. </div>
  51. @if (ViewBag.DoNotUseBabylonJS == null)
  52. {
  53. <canvas id="ourOwnBabylonJSCanvas"></canvas>
  54. }
  55. @RenderBody()
  56. </div>
  57. </body>
  58. </html>