Skip to content

Commit

Permalink
Merge pull request #708 from guycalledfrank/fixstencil
Browse files Browse the repository at this point in the history
Fix crash when not supplying options to device
  • Loading branch information
guycalledfrank authored Aug 2, 2016
2 parents d145aac + 254deae commit 146ae36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/graphics/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pc.extend(pc, function () {
var _createContext = function (canvas, options) {
var names = ["webgl", "experimental-webgl"];
var context = null;
options = options || {};
options.stencil = true;
for (var i = 0; i < names.length; i++) {
try {
context = canvas.getContext(names[i], options);
Expand Down Expand Up @@ -219,7 +221,6 @@ pc.extend(pc, function () {

// Retrieve the WebGL context
if (canvas) {
options.stencil = true;
this.gl = _createContext(canvas, options);
}

Expand Down

0 comments on commit 146ae36

Please sign in to comment.