Skip to content

Commit 9ae00f4

Browse files
committed
Make sure default attributes are loaded before initializing WebGL context
1 parent bea4d02 commit 9ae00f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webgl/p5.RendererGL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class RendererGL extends Renderer {
122122

123123
// Create new canvas
124124
this.canvas = this.elt = elt || document.createElement('canvas');
125+
this._setAttributeDefaults(pInst);
125126
this._initContext();
126127
// This redundant property is useful in reminding you that you are
127128
// interacting with WebGLRenderingContext, still worth considering future removal
@@ -176,7 +177,6 @@ class RendererGL extends Renderer {
176177
document.getElementsByTagName('main')[0].appendChild(this.elt);
177178
}
178179

179-
this._setAttributeDefaults(pInst);
180180
this.isP3D = true; //lets us know we're in 3d mode
181181

182182
// When constructing a new Geometry, this will represent the builder

0 commit comments

Comments
 (0)