Changes between Version 2 and Version 3 of research/nacl/test


Ignore:
Timestamp:
Nov 29, 2011, 1:34:53 AM (9 years ago)
Author:
sam
Comment:

add NaCl div for real

Legend:

Unmodified
Added
Removed
Modified
  • research/nacl/test

    v2 v3  
    11= NaCl tests =
    22
    3 == Configuration ==
     3Provided your browser supports [http://code.google.com/p/nativeclient/ NativeClient], the tests on this page run natively, at full speed, in your browser window.
    44
    5 Go to [[html(<a href="chrome://flags">chrome://flags</a>)]] and activate Native Client for applications that do not come from the app store.
     5== Fractal viewer ==
    66
     7This is a clone of [http://wmi.math.u-szeged.hu/xaos/doku.php XaoS], implemented in C++, OpenGL and GLSL.
     8
     9{{{
     10#!html
     11  <script type="text/javascript">
     12    // Provide the lol namespace
     13    lol = {};
     14
     15    lol.Application = function()
     16    {
     17      this.module_ = null;
     18      this.boundModuleDidLoad_ = null;
     19    }
     20
     21    lol.Application.DomIds_ =
     22    {
     23      MODULE: 'lol',  // The <embed> element representing the NaCl module
     24      VIEW: 'lol_view'  // The <div> containing the NaCl element.
     25    }
     26
     27    lol.Application.prototype.moduleDidLoad = function()
     28    {
     29      this.module_ = document.getElementById(lol.Application.DomIds_.MODULE);
     30      this.boundModuleDidLoad_ = null;
     31    }
     32
     33    lol.Application.prototype.run = function(opt_contentDivName)
     34    {
     35      contentDivName = opt_contentDivName || lol.Application.DomIds_.VIEW;
     36      var contentDiv = document.getElementById(contentDivName);
     37      this.boundModuleDidLoad_ = this.moduleDidLoad.bind(this);
     38      contentDiv.addEventListener('load', this.boundModuleDidLoad_, true);
     39      contentDiv.innerHTML = '<embed id="' + lol.Application.DomIds_.MODULE + '" '
     40                           + 'src=/raw-attachment/wiki/research/nacl/test/lol.nmf '
     41                           + 'type="application/x-nacl" '
     42                           + 'width="640" height="480" />'
     43    }
     44  </script>
     45  <div id="lol_view"></div>
     46  <script type="text/javascript">
     47    lol.application = new lol.Application();
     48    lol.application.run('lol_view');
     49  </script>
     50}}}
     51
     52== Troubleshooting ==
     53
     54 * Make sure you visit this page using the [http://www.google.com/chrome Chrome] web browser.
     55 * Make sure you enabled “**Native Client** for  applications that do not come from the app store” in the browser flags. Type [[html(<a href="chrome://flags">chrome://flags</a>)]] in your address bar to do so.