This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import canvasSize from "canvas-size"; | |
const getMaxTextureSize = () => { | |
const canvas = document.createElement("canvas"); | |
const gl = canvas.getContext("experimental-webgl"); | |
if (!gl) return 2048; | |
return gl.getParameter(gl.MAX_TEXTURE_SIZE) || 2048; | |
}; | |
const maxTextureSize = getMaxTextureSize(); |
OlderNewer