diff options
Diffstat (limited to 'src/webGLClient.js')
-rw-r--r-- | src/webGLClient.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js index 193d5dfa..81310814 100644 --- a/src/webGLClient.js +++ b/src/webGLClient.js @@ -1,10 +1,16 @@ // WebGLWorker client code function WebGLClient() { +} + +WebGLClient.prefetch = function() { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('webgl-experimental') || canvas.getContext('webgl'); + if (!ctx) return; var data = {}; ['MAX_VERTEX_ATTRIBS'].forEach(function(name) { - data[name] = Module.ctx.getParameter(Module.ctx[name]); + data[ctx[name]] = ctx.getParameter(ctx[name]); }); worker.postMessage({ target: 'gl', op: 'setPrefetchedParameters', data: data }); -} +}; |