exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
997 stars 117 forks source link

p5.js texture -> Magic Leap #555

Open chrisnovello opened 6 years ago

chrisnovello commented 6 years ago

Bumping into a weird issue trying to use p5.js on Magic Leap and could use a 2nd set of eyes 👀 (This is all toward having p5 draw canvas texturess for use in a-frame/three.js, which I have working in Chrome)

Currently on v0.0.488

Boiled it down to a trivial example that shows the error:

opening https://p5-exokit.glitch.me/ on ML produces this show stopper in the console:


10-17 20:18:23.246  4145     4 I exokit  : ---------------------exokit start 1
10-17 20:18:25.894  4145     6 I exokit  : __bionic_open_tzdata_path: ANDROID_DATA not set!
10-17 20:18:25.894  4145     6 I exokit  : __bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
10-17 20:18:25.894  4145     6 I exokit  : __bionic_open_tzdata_path: ANDROID_DATA not set!
10-17 20:18:25.894  4145     6 I exokit  : __bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
10-17 20:18:27.272  4145     6 I exokit  : TypeError: Cannot read property 'push' of null
10-17 20:18:27.272  4145     6 I exokit  :     at _addListener (events.js:234:16)
10-17 20:18:27.272  4145     6 I exokit  :     at addListener (events.js:259:10)
10-17 20:18:27.272  4145     6 I exokit  :     at addEventListener (/package/src/Event.js:21:14)
10-17 20:18:27.272  4145     6 I exokit  :     at new p5 (https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js:49007:14)
10-17 20:18:27.272  4145     6 I exokit  :     at _globalInit (https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js:48414:7)
10-17 20:18:27.272  4145     6 I exokit  :     at emit (events.js:187:15)
10-17 20:18:27.272  4145     6 I exokit  :     at EventEmitter.emit (domain.js:442:20)
10-17 20:18:27.272  4145     6 I exokit  :     at _emit (/package/src/Event.js:60:40)
10-17 20:18:27.272  4145     6 I exokit  :     at window._emit (/package/src/core.js:1439:28)
10-17 20:18:27.272  4145     6 I exokit  :     at _emit (/package/src/Event.js:38:14)

Created a super simple sketch just to show the issue https://glitch.com/edit/#!/p5-exokit?path=index.html

Maybe p5 is using something Exokit doesn't support? Will dig around more..

avaer commented 6 years ago

The throwing p5.js code:

// Bind events to window (not using container div bc key events don't work)

  for (var e in this._events) {
    var f = this['_on' + e];
    if (f) {
      var m = f.bind(this);
>>>>>>> window.addEventListener(e, m, { passive: false });
      this._events[e] = m;
    }
  }