| 7 | This 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. |