Skip to content

Commit

Permalink
Pass optional options when creating WebGL context
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalpias committed Sep 16, 2015
1 parent 868b4dc commit 1ff1b1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/graphics/graphics_device.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pc.extend(pc, function () {
* canvas element per page and create a new graphics device against each.
* @constructor Creates a new graphics device.
* @param {Object} canvas The canvas to which the graphics device is tied.
* @param {Object} [options] Options passed when creating the WebGL context. More info here https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
* @property {Number} width Width of the back buffer in pixels (read-only).
* @property {Number} height Height of the back buffer in pixels (read-only).
* @property {Number} maxAnisotropy The maximum supported texture anisotropy setting (read-only).
Expand All @@ -94,7 +95,7 @@ pc.extend(pc, function () {
* @param {Number} width The new width of the canvas in pixels
* @param {Number} height The new height of the canvas in pixels
*/
var GraphicsDevice = function (canvas) {
var GraphicsDevice = function (canvas, options) {
this.gl = undefined;
this.canvas = canvas;
this.shader = null;
Expand All @@ -120,7 +121,7 @@ pc.extend(pc, function () {

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

if (!this.gl) {
Expand Down

0 comments on commit 1ff1b1f

Please sign in to comment.