Fix initGroundSystem: WebGL constants must use groundGl, not gl
Last commit fixed gl calls inside the .then() but missed the calls in the body of initGroundSystem itself. Replaced every gl.X reference with groundGl.X in the new code.
This commit is contained in:
1 parent
19139b01c7
commit
447ff824af
1 file changed
+7
-7
Vendored
+7
-7
@@ -368,13 +368,13 @@ function initGroundSystem(glCtx) {
|
|||||||
groundCtx.fillStyle = '#7c9aa1';
|
groundCtx.fillStyle = '#7c9aa1';
|
||||||
groundCtx.fillRect(0, 0, groundCanvas.width, groundCanvas.height);
|
groundCtx.fillRect(0, 0, groundCanvas.width, groundCanvas.height);
|
||||||
groundTexture = groundGl.createTexture();
|
groundTexture = groundGl.createTexture();
|
||||||
groundGl.bindTexture(gl.TEXTURE_2D, groundTexture);
|
groundGl.bindTexture(groundGl.TEXTURE_2D, groundTexture);
|
||||||
groundGl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
groundGl.pixelStorei(groundGl.UNPACK_FLIP_Y_WEBGL, true);
|
||||||
groundGl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, groundCanvas);
|
groundGl.texImage2D(groundGl.TEXTURE_2D, 0, groundGl.RGBA, groundGl.RGBA, groundGl.UNSIGNED_BYTE, groundCanvas);
|
||||||
groundGl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_WRAP_S, groundGl.CLAMP_TO_EDGE);
|
||||||
groundGl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_WRAP_T, groundGl.CLAMP_TO_EDGE);
|
||||||
groundGl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_MIN_FILTER, groundGl.LINEAR);
|
||||||
groundGl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_MAG_FILTER, groundGl.LINEAR);
|
||||||
// Kick off initial fetch
|
// Kick off initial fetch
|
||||||
rebuildGroundMosaic(GROUND_BASE_X, GROUND_BASE_Y);
|
rebuildGroundMosaic(GROUND_BASE_X, GROUND_BASE_Y);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user