Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

195 linhas
9.2 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>loading...</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <meta name="title" content="raylib - sample">
  7. <meta name="description" content="raylib is a simple and easy-to-use library to learn videogames programming. This a small example of what you can do.">
  8. <meta name="keywords" content="raylib, videogames, programming, C, C++, library, learn, study, simple, easy, free, open source, raysan">
  9. <meta name="viewport" content="width=device-width">
  10. <!-- Facebook metatags for sharing -->
  11. <meta property="og:title" content="raylib - sample"/>
  12. <meta property="og:image" content="http://www.raylib.com/img/fb_raylib_logo.png"/>
  13. <meta property="og:url" content="http://www.raylib.com" />
  14. <meta property="og:site_name" content="raylib"/>
  15. <meta property="og:description" content="This a small sample game showing what can be done with raylib"/>
  16. <!-- Add jQuery library -->
  17. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
  18. <!-- hightlight.js - Syntax highlighting for the Web -->
  19. <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css">
  20. <!-- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/obsidian.min.css"> -->
  21. <script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script>
  22. <style type="text/css">
  23. @font-face {
  24. font-family: 'grixel_acme_7_wide_xtnd';
  25. src: url('../common/font/acme_7_wide_xtnd.eot');
  26. src: url('../common/font/acme_7_wide_xtnd.eot?#iefix') format('embedded-opentype'),
  27. url('../common/font/acme_7_wide_xtnd.woff') format('woff'),
  28. url('../common/font/acme_7_wide_xtnd.ttf') format('truetype');
  29. font-weight: normal;
  30. font-style: normal;
  31. font-size-adjust:0.49;
  32. }
  33. #sampledata { width: 802px; height: 452px; text-align: center; }
  34. #sampledata img { margin: 0 auto; border: 1px solid; border-color: black; }
  35. #sampledata canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; }
  36. pre { width: 802px!important;}
  37. pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; }
  38. .viewcodebtn{ margin-top: 10px; width:795px; height:30px; float:right; position:relative; cursor:pointer; font-weight:bold; font-size:10px;
  39. line-height:30px; text-align: center; border-width:5px; background-color:#e1e1e1; color:#5c5a5a;
  40. border:4px solid #898888; font-family: grixel_acme_7_wide_xtnd, Courier New, Verdana, Arial; left:-10px;}
  41. #viewcode .viewcodebtn:hover{background-color:#bedce8; color:#417794; border:4px solid #5d9cbd; left:-10px;}
  42. .fancybox-wrap fancybox-desktop fancybox-type-iframe fancybox-opened { width: 860px!important; }
  43. .fancybox-inner { width: 850px!important; height:520px!important; }
  44. .fancybox-iframe { width: 830px!important; }
  45. </style>
  46. <script type="text/javascript">
  47. $(document).ready(function() {
  48. var mainUrl = $(location).attr('href');
  49. var name = mainUrl.slice(mainUrl.indexOf('=') + 1);
  50. document.title = "raylib - " + name.replace('_', ' ');
  51. var codeUrl = 'https://github.com/raysan5/raylib/blob/develop/games/' + name.substring(7) + '.c';
  52. var imageUrl = 'img/' + name + '.png';
  53. // #sampledata filling code: canvas sample and image
  54. $('#sampledata').append(
  55. '<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()">' +
  56. '<img src="' + imageUrl + '" alt=" ">' +
  57. '</canvas>');
  58. $('#viewcode').attr('href', codeUrl);
  59. Module.canvas = document.getElementById('canvas');
  60. Module.canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
  61. var jsUrl = 'samples/' + name.substring(7) + '.js';
  62. // Run emscripten example
  63. $.getScript(jsUrl, function() {});
  64. });
  65. </script>
  66. </head>
  67. <body>
  68. <div class="emscripten">
  69. <progress value="0" max="100" id="progress" hidden=1></progress>
  70. </div>
  71. <!-- Canvas example or image, filled on loading -->
  72. <div id="sampledata"></div>
  73. <a id="viewcode" href=" " target="_blank"><div class="viewcodebtn">View code on Github</div></a>
  74. <!--<textarea id="output" rows="8"></textarea>-->
  75. <!--<pre><code class="cpp"></code></pre>-->
  76. <script type='text/javascript'>
  77. //var statusElement = document.getElementById('status');
  78. //var progressElement = document.getElementById('progress');
  79. //var spinnerElement = document.getElementById('spinner');
  80. var Module = {
  81. preRun: [],
  82. postRun: [],
  83. print: (function() {
  84. var element = document.getElementById('output');
  85. if (element) element.value = ''; // clear browser cache
  86. return function(text) {
  87. text = Array.prototype.slice.call(arguments).join(' ');
  88. // These replacements are necessary if you render to raw HTML
  89. //text = text.replace(/&/g, "&amp;");
  90. //text = text.replace(/</g, "&lt;");
  91. //text = text.replace(/>/g, "&gt;");
  92. //text = text.replace('\n', '<br>', 'g');
  93. console.log(text);
  94. if (element) {
  95. element.value += text + "\n";
  96. element.scrollTop = element.scrollHeight; // focus on bottom
  97. }
  98. };
  99. })(),
  100. printErr: function(text) {
  101. text = Array.prototype.slice.call(arguments).join(' ');
  102. if (0) { // XXX disabled for safety typeof dump == 'function') {
  103. dump(text + '\n'); // fast, straight to the real console
  104. } else {
  105. console.error(text);
  106. }
  107. },
  108. canvas: (function() {
  109. // NOTE: canvas element eventListener is added after appending!
  110. //var canvas = document.getElementById('canvas');
  111. // As a default initial behavior, pop up an alert when webgl context is lost. To make your
  112. // application robust, you may want to override this behavior before shipping!
  113. // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
  114. //canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
  115. //return canvas;
  116. })(),
  117. setStatus: function(text) {
  118. if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
  119. if (text === Module.setStatus.text) return;
  120. var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
  121. var now = Date.now();
  122. if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
  123. if (m) {
  124. text = m[1];
  125. //progressElement.value = parseInt(m[2])*100;
  126. //progressElement.max = parseInt(m[4])*100;
  127. //progressElement.hidden = false;
  128. //spinnerElement.hidden = false;
  129. } else {
  130. //progressElement.value = null;
  131. //progressElement.max = null;
  132. //progressElement.hidden = true;
  133. //if (!text) spinnerElement.style.display = 'none';
  134. }
  135. //statusElement.innerHTML = text;
  136. },
  137. totalDependencies: 0,
  138. monitorRunDependencies: function(left) {
  139. this.totalDependencies = Math.max(this.totalDependencies, left);
  140. Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
  141. }
  142. };
  143. Module.setStatus('Downloading...');
  144. window.onerror = function(event) {
  145. // TODO: do not warn on ok events like simulating an infinite loop or exitStatus
  146. Module.setStatus('Exception thrown, see JavaScript console');
  147. //spinnerElement.style.display = 'none';
  148. Module.setStatus = function(text) {
  149. if (text) Module.printErr('[post-exception status] ' + text);
  150. };
  151. };
  152. </script>
  153. <!-- Google Analytics tracking code -->
  154. <script>
  155. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  156. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  157. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  158. })(window,document,'script','http://www.google-analytics.com/analytics.js','ga');
  159. ga('create', 'UA-45733555-1', 'raylib.com');
  160. ga('require', 'linkid', 'linkid.js');
  161. ga('send', 'pageview');
  162. </script>
  163. </body>
  164. </html>