_Layout.cshtml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 = "TheCar", demoFile = "TheCar.incremental.babylon" })">TheCar</a>
  45. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Train", demoFile = "Train.babylon" })">Train</a>
  46. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "Viper", demoFile = "Viper.babylon" })">Viper</a>
  47. | <a href="@Url.Action("Index", "BabylonJSDemo", new { demoFolderName = "WCafe", demoFile = "WCafe.babylon" })">WCafe</a>
  48. </div>
  49. </div>
  50. @if (ViewBag.DoNotUseBabylonJS == null)
  51. {
  52. <canvas id="ourOwnBabylonJSCanvas"></canvas>
  53. }
  54. @RenderBody()
  55. </div>
  56. </body>
  57. </html>