google / node-gles

Apache License 2.0
323 stars 31 forks source link

gl context creation options #53

Closed AlexVestin closed 5 years ago

AlexVestin commented 5 years ago

Initialize the context in node by doing

const gl = nodeGles.createWebGLRenderingContext({
  width: 256,
  height: 256,
  majorVersion: 3,
  minorVersion: 0,
  webGLCompability: true
});

It's a bit of a hastle sending the arguments through several functions, but I couldn't think of any better way to do it.

This would be a breaking change as it drops the binding attribute since the createWebGLRenderingContext function now takes an interface (and doesn't return the binding). This could however be easily dodged by just adding a `binding variable, but that seems like bad practise.


This change is Reviewable