Parcourir la source

Updated docs.

Branimir Karadžić il y a 10 ans
Parent
commit
5b8ed8d0f1
5 fichiers modifiés avec 90 ajouts et 2 suppressions
  1. BIN
      example-02-metaballsRelease.bc.html.mem
  2. 0 0
      example-02-metaballsRelease.bc.js
  3. 88 2
      examples.html
  4. 2 0
      license.html
  5. 0 0
      searchindex.js

BIN
example-02-metaballsRelease.bc.html.mem


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
example-02-metaballsRelease.bc.js


+ 88 - 2
examples.html

@@ -299,10 +299,96 @@ running examples your current directory should be examples/runtime.</p>
 <div class="section" id="metaballs">
 <h2><a class="reference external" href="https://github.com/bkaradzic/bgfx/blob/master/examples/02-metaballs">02-metaballs</a><a class="headerlink" href="#metaballs" title="Permalink to this headline">¶</a></h2>
 <p>Rendering with transient buffers and embedding shaders.</p>
-<div class="figure">
-<img alt="example-02-metaballs" src="https://github.com/bkaradzic/bgfx/raw/master/examples/02-metaballs/screenshot.png" />
+<div class="emscripten">
+  <progress value="0" max="100" id="progress" hidden=1></progress>
 </div>
+
+<div class="spinner" id='spinner'></div>
+<div class="emscripten" id="status">Downloading...</div>
+<div class="emscripten_border">
+  <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
 </div>
+
+<script type='text/javascript'>
+  var statusElement   = document.getElementById('status');
+  var progressElement = document.getElementById('progress');
+  var spinnerElement  = document.getElementById('spinner');
+
+  var Module = {
+    preRun: [],
+    postRun: [],
+    print: (function() {
+      var element = document.getElementById('output');
+      if (element) element.value = ''; // clear browser cache
+      return function(text) {
+        if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
+        // These replacements are necessary if you render to raw HTML
+        //text = text.replace(/&/g, "&amp;");
+        //text = text.replace(/</g, "&lt;");
+        //text = text.replace(/>/g, "&gt;");
+        //text = text.replace('\n', '<br>', 'g');
+        console.log(text);
+        if (element) {
+          element.value += text + "\n";
+          element.scrollTop = element.scrollHeight; // focus on bottom
+        }
+      };
+    })(),
+    printErr: function(text) {
+      if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
+      if (0) { // XXX disabled for safety typeof dump == 'function') {
+        dump(text + '\n'); // fast, straight to the real console
+      } else {
+        console.error(text);
+      }
+    },
+    canvas: (function() {
+      var canvas = document.getElementById('canvas');
+
+      // As a default initial behavior, pop up an alert when webgl context is lost. To make your
+      // application robust, you may want to override this behavior before shipping!
+      // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+      canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
+
+      return canvas;
+    })(),
+    setStatus: function(text) {
+      if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
+      if (text === Module.setStatus.text) return;
+      var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+      var now = Date.now();
+      if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
+      if (m) {
+        text = m[1];
+        progressElement.value = parseInt(m[2])*100;
+        progressElement.max = parseInt(m[4])*100;
+        progressElement.hidden = false;
+        spinnerElement.hidden = false;
+      } else {
+        progressElement.value = null;
+        progressElement.max = null;
+        progressElement.hidden = true;
+        if (!text) spinnerElement.style.display = 'none';
+      }
+      statusElement.innerHTML = text;
+    },
+    totalDependencies: 0,
+    monitorRunDependencies: function(left) {
+      this.totalDependencies = Math.max(this.totalDependencies, left);
+      Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
+    }
+  };
+  Module.setStatus('Downloading...');
+  window.onerror = function(event) {
+    // TODO: do not warn on ok events like simulating an infinite loop or exitStatus
+    Module.setStatus('Exception thrown, see JavaScript console');
+    spinnerElement.style.display = 'none';
+    Module.setStatus = function(text) {
+      if (text) Module.printErr('[post-exception status] ' + text);
+    };
+  };
+</script>
+<script async type="text/javascript" src="example-02-metaballsRelease.bc.js"></script></div>
 <div class="section" id="raymarch">
 <h2><a class="reference external" href="https://github.com/bkaradzic/bgfx/blob/master/examples/03-raymarch">03-raymarch</a><a class="headerlink" href="#raymarch" title="Permalink to this headline">¶</a></h2>
 <p>Updating shader uniforms.</p>

+ 2 - 0
license.html

@@ -324,6 +324,8 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 <li>Tony McCrary (<a class="reference external" href="https://github.com/enleeten">&#64;enleeten</a>) - Java language API bindings.</li>
 <li>Attila Kocsis (<a class="reference external" href="https://github.com/attilaz">&#64;attilaz</a>) - Metal rendering backend, various OSX
 and iOS improvements and bug fixes.</li>
+<li>Richard Gale (<a class="reference external" href="https://github.com/RichardGale">&#64;RichardGale</a>) - Emscripten entry input
+handling.</li>
 </ul>
 </div></blockquote>
 </div>

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
searchindex.js


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff