{"action":"opened","issue":{"url":"https://api.github.com/repos/stackgl/gl-texture2d/issues/11","labels_url":"https://api.github.com/repos/stackgl/gl-texture2d/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/stackgl/gl-texture2d/issues/11/comments","events_url":"https://api.github.com/repos/stackgl/gl-texture2d/issues/11/events","html_url":"https://github.com/stackgl/gl-texture2d/issues/11","id":127108706,"number":11,"title":"`tex.setPixels` binds to unit zero","user":{"login":"mattdesl","id":1383811,"avatar_url":"https://avatars.githubusercontent.com/u/1383811?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdesl","html_url":"https://github.com/mattdesl","followers_url":"https://api.github.com/users/mattdesl/followers","following_url":"https://api.github.com/users/mattdesl/following{/other_user}","gists_url":"https://api.github.com/users/mattdesl/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdesl/subscriptions","organizations_url":"https://api.github.com/users/mattdesl/orgs","repos_url":"https://api.github.com/users/mattdesl/repos","events_url":"https://api.github.com/users/mattdesl/events{/privacy}","received_events_url":"https://api.github.com/users/mattdesl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-17T17:03:10Z","updated_at":"2016-01-17T17:03:10Z","closed_at":null,"body":"This seems to be causing issues with `gl-audio-analyser`\r\nhttps://github.com/stackgl/gl-audio-analyser/issues/1\r\n\r\nBecause the `bind()` calls in `setPixels` is not necessarily going to be the same active unit as the user requests with `tex.bind(n)`, it seems like it is causing some issues. I didn't realize this but according to [the spec](https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml), the two seem tied somehow: \r\n\r\n> *glTexImage2D* specifies a two-dimensional or cube-map texture for the current texture unit, specified with *glActiveTexture*.\r\n"}}