senchalabs / philogl

A WebGL Framework for Data Visualization, Creative Coding and Game Development
http://senchalabs.github.com/philogl/
MIT License
805 stars 154 forks source link

PhiloGL should not be globally bound to a single canvas #36

Open D1plo1d opened 11 years ago

D1plo1d commented 11 years ago

It seems that PhiloGL is limited to a single instance rendering context in the moment due to it's use of the global gl object. This was not my intuition and should probably not be the case

I think we might be able to refactor the gl object to be per-instance and solve this issue but I'm still learning the PhiloGL code base. Can someone confirm if this is the case?

Use Case: my application. I need to render 2 WebGL contexts simultaneously.

See https://github.com/senchalabs/philogl/blob/master/src/core.js#L56

D1plo1d commented 11 years ago

Fixed. See Pull Request: https://github.com/senchalabs/philogl/pull/37