Skip to content

Commit

Permalink
Merge pull request #262 from gpujs/261-webgl2
Browse files Browse the repository at this point in the history
261 - webgl2
  • Loading branch information
robertleeplummerjr authored Mar 9, 2018
2 parents d1ce3da + af7060d commit b99960c
Show file tree
Hide file tree
Showing 77 changed files with 7,524 additions and 1,672 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Note: To animate the rendering, use `requestAnimationFrame` instead of `setTimeo
Currently, if you need alpha do something like enabling `premultipliedAlpha` with your own gl context:
```js
const canvas = DOM.canvas(500, 500);
const gl = canvas.getContext('webgl', { premultipliedAlpha: false });
const gl = canvas.getContext('webgl2', { premultipliedAlpha: false });

const gpu = new GPU({
canvas,
Expand Down
22 changes: 20 additions & 2 deletions bin/gpu-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* GPU Accelerated JavaScript
*
* @version 1.0.6
* @date Tue Mar 06 2018 19:26:37 GMT-0500 (EST)
* @version 1.2.0
* @date Thu Mar 08 2018 17:26:16 GMT-0500 (EST)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -171,6 +171,24 @@ var UtilsCore = function () {

return webGl;
}


}, {
key: 'initWebGl2',
value: function initWebGl2(canvasObj) {

if (typeof _isCanvasSupported !== 'undefined' || canvasObj === null) {
if (!_isCanvasSupported) {
return null;
}
}

if (!UtilsCore.isCanvas(canvasObj)) {
throw new Error('Invalid canvas object - ' + canvasObj);
}

return canvasObj.getContext('webgl2', UtilsCore.initWebGlDefaultOptions());
}
}]);

return UtilsCore;
Expand Down
6 changes: 3 additions & 3 deletions bin/gpu-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b99960c

Please sign in to comment.