-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGL context as dynamic var #19
Comments
I volunteer to do the refactoring if you like the idea. |
Thanks, @skrat - I will have to think about this a bit more how this might impact scenarios using multiple GL contexts (apart from having to wrap all calls in |
Multiple contexts is a no-brainer, even though in most cases you deal with just one, you can nest |
Currently I have to manage the reference to GL context in every namespace that uses
thi.ng.geom.webgl
. It would clean the user code a lot if we could remove all the occurrences ofgl
symbol that are not context creation. Having written a small WebGL library in CLJS myself, I used a dynamic var in the core module, to allow users bind it to their WebGL context somewhere in the app initialization. Then all other namespaces that need GL context, can simply use the symbol required. Eg.The text was updated successfully, but these errors were encountered: