twgl.js/docs/module-twgl_textures.html
Gregg Tavares 2f8b587c2f build
2025-04-27 10:21:19 +09:00

4654 lines
96 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>twgl/textures - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<link rel="stylesheet" href="styles/prettify-tomorrow.css">
<link rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl.html">twgl</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.addExtensionsToContext">addExtensionsToContext</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.bindFramebufferInfo">bindFramebufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.bindTransformFeedbackInfo">bindTransformFeedbackInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.bindUniformBlock">bindUniformBlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createBufferInfoFromArrays">createBufferInfoFromArrays</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createFramebufferInfo">createFramebufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createProgramInfo">createProgramInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createTexture">createTexture</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createTextures">createTextures</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createTransformFeedback">createTransformFeedback</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createTransformFeedbackInfo">createTransformFeedbackInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.createUniformBlockInfo">createUniformBlockInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.drawBufferInfo">drawBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.drawObjectList">drawObjectList</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.getContext">getContext</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.glEnumToString">glEnumToString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.isWebGL1">isWebGL1</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.isWebGL2">isWebGL2</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.resizeCanvasToDisplaySize">resizeCanvasToDisplaySize</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.resizeFramebufferInfo">resizeFramebufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.resizeTexture">resizeTexture</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setAttribInfoBufferFromArray">setAttribInfoBufferFromArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setBlockUniforms">setBlockUniforms</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setBuffersAndAttributes">setBuffersAndAttributes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setDefaults">setDefaults</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setTextureFromArray">setTextureFromArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setUniformBlock">setUniformBlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#.setUniforms">setUniforms</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl.html#~createContext">createContext</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_attributes.html">twgl/attributes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.createAttribsFromArrays">createAttribsFromArrays</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.createBufferFromArray">createBufferFromArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.createBufferFromTypedArray">createBufferFromTypedArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.createBufferInfoFromArrays">createBufferInfoFromArrays</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.createBuffersFromArrays">createBuffersFromArrays</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.setAttribInfoBufferFromArray">setAttribInfoBufferFromArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_attributes.html#.setAttributePrefix">setAttributePrefix</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_draw.html">twgl/draw</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_draw.html#.drawBufferInfo">drawBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_draw.html#.drawObjectList">drawObjectList</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_framebuffers.html">twgl/framebuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_framebuffers.html#.bindFramebufferInfo">bindFramebufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_framebuffers.html#.createFramebufferInfo">createFramebufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_framebuffers.html#.resizeFramebufferInfo">resizeFramebufferInfo</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_m4.html">twgl/m4</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.axisRotate">axisRotate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.axisRotation">axisRotation</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.copy">copy</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.create">create</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.frustum">frustum</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.getAxis">getAxis</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.getTranslation">getTranslation</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.identity">identity</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.inverse">inverse</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.lookAt">lookAt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.multiply">multiply</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.negate">negate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.ortho">ortho</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.perspective">perspective</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotateX">rotateX</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotateY">rotateY</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotateZ">rotateZ</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotationX">rotationX</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotationY">rotationY</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.rotationZ">rotationZ</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.scale">scale</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.scaling">scaling</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.setAxis">setAxis</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.setDefaultType">setDefaultType</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.setTranslation">setTranslation</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.transformDirection">transformDirection</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.transformNormal">transformNormal</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.transformPoint">transformPoint</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.translate">translate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.translation">translation</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_m4.html#.transpose">transpose</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_primitives.html">twgl/primitives</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.concatVertices">concatVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.create3DFBufferInfo">create3DFBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.create3DFBuffers">create3DFBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.create3DFVertices">create3DFVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createAugmentedTypedArray">createAugmentedTypedArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCrescentBufferInfo">createCrescentBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCrescentBuffers">createCrescentBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCrescentVertices">createCrescentVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCresentBufferInfo">createCresentBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCresentBuffers">createCresentBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCresentBuffers">createCresentBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCubeBufferInfo">createCubeBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCubeBuffers">createCubeBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCubeVertices">createCubeVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCylinderBufferInfo">createCylinderBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCylinderBuffers">createCylinderBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createCylinderVertices">createCylinderVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createDiscBufferInfo">createDiscBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createDiscBuffers">createDiscBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createDiscVertices">createDiscVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createPlaneBufferInfo">createPlaneBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createPlaneBuffers">createPlaneBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createPlaneVertices">createPlaneVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createSphereBufferInfo">createSphereBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createSphereBuffers">createSphereBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createSphereVertices">createSphereVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTorusBufferInfo">createTorusBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTorusBuffers">createTorusBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTorusVertices">createTorusVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTruncatedConeBufferInfo">createTruncatedConeBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTruncatedConeBuffers">createTruncatedConeBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createTruncatedConeVertices">createTruncatedConeVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createXYQuadBufferInfo">createXYQuadBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createXYQuadBuffers">createXYQuadBuffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.createXYQuadVertices">createXYQuadVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.deindexVertices">deindexVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.duplicateVertices">duplicateVertices</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.flattenNormals">flattenNormals</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.makeRandomVertexColors">makeRandomVertexColors</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.reorientDirections">reorientDirections</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.reorientNormals">reorientNormals</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.reorientPositions">reorientPositions</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_primitives.html#.reorientVertices">reorientVertices</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_programs.html">twgl/programs</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.bindUniformBlock">bindUniformBlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createAttributeSetters">createAttributeSetters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgram">createProgram</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramAsync">createProgramAsync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramFromScripts">createProgramFromScripts</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramFromSources">createProgramFromSources</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramInfo">createProgramInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramInfoAsync">createProgramInfoAsync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createProgramInfoFromProgram">createProgramInfoFromProgram</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createUniformBlockInfo">createUniformBlockInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createUniformBlockInfoFromProgram">createUniformBlockInfoFromProgram</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createUniformBlockSpecFromProgram">createUniformBlockSpecFromProgram</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.createUniformSetters">createUniformSetters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.setBlockUniforms">setBlockUniforms</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.setBuffersAndAttributes">setBuffersAndAttributes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.setUniformBlock">setUniformBlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.setUniforms">setUniforms</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#.setUniformsAndBindTextures">setUniformsAndBindTextures</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#~createProgramInfos">createProgramInfos</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#~createProgramInfosAsync">createProgramInfosAsync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#~createPrograms">createPrograms</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_programs.html#~createProgramsAsync">createProgramsAsync</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_textures.html">twgl/textures</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.canFilter">canFilter</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.canGenerateMipmap">canGenerateMipmap</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.createTexture">createTexture</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.createTextures">createTextures</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.getBytesPerElementForInternalFormat">getBytesPerElementForInternalFormat</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.getFormatAndTypeForInternalFormat">getFormatAndTypeForInternalFormat</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.getNumComponentsForFormat">getNumComponentsForFormat</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.loadTextureFromUrl">loadTextureFromUrl</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.resizeTexture">resizeTexture</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setDefaultTextureColor">setDefaultTextureColor</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setEmptyTexture">setEmptyTexture</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setSamplerParameters">setSamplerParameters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setTextureFilteringForSize">setTextureFilteringForSize</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setTextureFromArray">setTextureFromArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setTextureFromElement">setTextureFromElement</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#.setTextureParameters">setTextureParameters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#~copyOptionsAndApplyPackState">copyOptionsAndApplyPackState</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#~createTextureAsync">createTextureAsync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#~createTexturesAsync">createTexturesAsync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_textures.html#~getPackStateOption">getPackStateOption</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_typedArray.html">twgl/typedArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_typedArray.html#.getGLTypeForTypedArray">getGLTypeForTypedArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_typedArray.html#.getGLTypeForTypedArrayType">getGLTypeForTypedArrayType</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_typedArray.html#.getTypedArrayTypeForGLType">getTypedArrayTypeForGLType</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_v3.html">twgl/v3</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.add">add</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.copy">copy</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.create">create</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.cross">cross</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.distance">distance</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.distanceSq">distanceSq</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.divide">divide</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.divScalar">divScalar</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.dot">dot</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.length">length</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.lengthSq">lengthSq</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.lerp">lerp</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.lerpV">lerpV</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.max">max</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.min">min</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.mulScalar">mulScalar</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.multiply">multiply</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.negate">negate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.normalize">normalize</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.setDefaultType">setDefaultType</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_v3.html#.subtract">subtract</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-twgl_vertexArrays.html">twgl/vertexArrays</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_vertexArrays.html#.createVAOAndSetAttributes">createVAOAndSetAttributes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_vertexArrays.html#.createVAOFromBufferInfo">createVAOFromBufferInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-twgl_vertexArrays.html#.createVertexArrayInfo">createVertexArrayInfo</a></span></li>
</nav>
<div id="main">
<h1 class="page-title">twgl/textures</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Low level texture related functions</p>
<p>You should generally not need to use these functions. They are provided<br>
for those cases where you're doing something out of the ordinary<br>
and you need lower level access.</p>
<p>For backward compatibility they are available at both <code>twgl.textures</code> and <code>twgl</code><br>
itself</p>
<p>See <a href="module-twgl.html"><code>module:twgl</code></a> for core functions</p></div>
<div class="section-method">
<dl class="details">
</dl>
</div>
</div>
<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id=".canFilter"><span class="type-signature">(static) </span>canFilter<span class="signature">(internalFormat)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
<p>Gets whether or not we can generate mips for the given format</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>internalFormat</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The internalFormat parameter from texImage2D etc..</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p>true if we can generate mips</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".canGenerateMipmap"><span class="type-signature">(static) </span>canGenerateMipmap<span class="signature">(gl, width, height, internalFormat)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
<p>Gets whether or not we can generate mips for the given<br>
internal format.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The width parameter from texImage2D etc..</p>
</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The height parameter from texImage2D etc..</p>
</td>
</tr>
<tr>
<td class="name"><code>internalFormat</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The internalFormat parameter from texImage2D etc..</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p>true if we can generate mips</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".createTexture"><span class="type-signature">(static) </span>createTexture<span class="signature">(gl, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {WebGLTexture}</span></h4>
<div class="description">
<p>Creates a texture based on the options passed in.</p>
<p>See <a href="module-twgl.html#.TextureOptions"><code>module:twgl.TextureOptions</code></a></p>
<p>Note: may reset UNPACK_ALIGNMENT, UNPACK_ROW_LENGTH, UNPACK_IMAGE_HEIGHT, UNPACK_SKIP_IMAGES<br>
UNPACK_SKIP_PIXELS, and UNPACK_SKIP_ROWS</p>
<p>UNPACK_FLIP_Y_WEBGL, UNPACK_PREMULTIPLY_ALPHA_WEBGL, UNPACK_COLORSPACE_CONVERSION_WEBGL<br>
are left as is though you can pass in options for flipY, premultiplyAlpha, and colorspaceConversion<br>
to override them.</p>
<p>As for the behavior of these settings</p>
<pre class="prettyprint source lang-js"><code>gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
t1 = twgl.createTexture({src: someImage }); // flipped
t2 = twgl.createTexture({src: someImage, flipY: true }); // flipped
t3 = twgl.createTexture({src: someImage, flipY: false }); // not flipped
t4 = twgl.createTexture({src: someImage }); // flipped
</code></pre>
<ul>
<li>t1 is flipped because UNPACK_FLIP_Y_WEBGL is true</li>
<li>t2 is flipped because it was requested</li>
<li>t3 is not flipped because it was requested</li>
<li>t4 is flipped because UNPACK_FLIP_Y_WEBGL has been restored to true</li>
</ul>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureReadyCallback">module:twgl.TextureReadyCallback</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A callback called when an image has been downloaded and uploaded to the texture.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>WebGLTexture</code></span>
</dd>
</dl>
<div class="param-desc">
<p>the created texture.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".createTextures"><span class="type-signature">(static) </span>createTextures<span class="signature">(gl, options, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object.&lt;string, WebGLTexture>}</span></h4>
<div class="description">
<p>Creates a bunch of textures based on the passed in options.</p>
<p>Example:</p>
<pre><code>const textures = twgl.createTextures(gl, {
// a power of 2 image
hftIcon: { src: &quot;images/hft-icon-16.png&quot;, mag: gl.NEAREST },
// a non-power of 2 image
clover: { src: &quot;images/clover.jpg&quot; },
// From a canvas
fromCanvas: { src: ctx.canvas },
// A cubemap from 6 images
yokohama: {
target: gl.TEXTURE_CUBE_MAP,
src: [
'images/yokohama/posx.jpg',
'images/yokohama/negx.jpg',
'images/yokohama/posy.jpg',
'images/yokohama/negy.jpg',
'images/yokohama/posz.jpg',
'images/yokohama/negz.jpg',
],
},
// A cubemap from 1 image (can be 1x6, 2x3, 3x2, 6x1)
goldengate: {
target: gl.TEXTURE_CUBE_MAP,
src: 'images/goldengate.jpg',
},
// A 2x2 pixel texture from a JavaScript array
checker: {
mag: gl.NEAREST,
min: gl.LINEAR,
src: [
255,255,255,255,
192,192,192,255,
192,192,192,255,
255,255,255,255,
],
},
// a 1x2 pixel texture from a typed array.
stripe: {
mag: gl.NEAREST,
min: gl.LINEAR,
format: gl.LUMINANCE,
src: new Uint8Array([
255,
128,
255,
128,
255,
128,
255,
128,
]),
width: 1,
},
});
</code></pre>
<p>Now</p>
<ul>
<li><code>textures.hftIcon</code> will be a 2d texture</li>
<li><code>textures.clover</code> will be a 2d texture</li>
<li><code>textures.fromCanvas</code> will be a 2d texture</li>
<li><code>textures.yohohama</code> will be a cubemap texture</li>
<li><code>textures.goldengate</code> will be a cubemap texture</li>
<li><code>textures.checker</code> will be a 2d texture</li>
<li><code>textures.stripe</code> will be a 2d texture</li>
</ul>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code>Object.&lt;string, <a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a>></code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>A object of TextureOptions one per texture.</p>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TexturesReadyCallback">module:twgl.TexturesReadyCallback</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A callback called when all textures have been downloaded.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Object.&lt;string, WebGLTexture></code></span>
</dd>
</dl>
<div class="param-desc">
<p>the created textures by name</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".getBytesPerElementForInternalFormat"><span class="type-signature">(static) </span>getBytesPerElementForInternalFormat<span class="signature">(internalFormat, type)</span><span class="type-signature"> &rarr; {number}</span></h4>
<div class="description">
<p>Gets the number of bytes per element for a given internalFormat / type</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>internalFormat</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The internalFormat parameter from texImage2D etc..</p>
</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The type parameter for texImage2D etc..</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>number</code></span>
</dd>
</dl>
<div class="param-desc">
<p>the number of bytes per element for the given internalFormat, type combo</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".getFormatAndTypeForInternalFormat"><span class="type-signature">(static) </span>getFormatAndTypeForInternalFormat<span class="signature">(internalFormat)</span><span class="type-signature"> &rarr; {<a href="module-twgl_textures.html#.TextureFormatInfo">module:twgl/textures.TextureFormatInfo</a>}</span></h4>
<div class="description">
<p>Gets the format and type for a given internalFormat</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>internalFormat</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>The internal format</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code><a href="module-twgl_textures.html#.TextureFormatInfo">module:twgl/textures.TextureFormatInfo</a></code></span>
</dd>
</dl>
<div class="param-desc">
<p>the corresponding format and type,</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".getNumComponentsForFormat"><span class="type-signature">(static) </span>getNumComponentsForFormat<span class="signature">(format)</span><span class="type-signature"> &rarr; {number}</span></h4>
<div class="description">
<p>Gets the number of components for a given image format.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
<p>the format.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>number</code></span>
</dd>
</dl>
<div class="param-desc">
<p>the number of components for the format.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".loadTextureFromUrl"><span class="type-signature">(static) </span>loadTextureFromUrl<span class="signature">(gl, tex, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {HTMLImageElement}</span></h4>
<div class="description">
<p>Loads a texture from an image from a Url as specified in <code>options.src</code><br>
If <code>options.color !== false</code> will set the texture to a 1x1 pixel color so that the texture is<br>
immediately useable. It will be updated with the contents of the image once the image has finished<br>
downloading. Filtering options will be set as appropriate for image unless <code>options.auto === false</code>.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureReadyCallback">module:twgl.TextureReadyCallback</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A function to be called when the image has finished loading. err will<br>
be non null if there was an error.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>HTMLImageElement</code></span>
</dd>
</dl>
<div class="param-desc">
<p>the image being downloaded.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".resizeTexture"><span class="type-signature">(static) </span>resizeTexture<span class="signature">(gl, tex, options, width<span class="signature-attributes">opt</span>, height<span class="signature-attributes">opt</span>, depth<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Resizes a texture based on the options passed in.</p>
<p>Note: This is not a generic resize anything function.<br>
It's mostly used by <a href="module-twgl.html#.resizeFramebufferInfo"><code>module:twgl.resizeFramebufferInfo</code></a><br>
It will use <code>options.src</code> if it exists to try to determine a <code>type</code><br>
otherwise it will assume <code>gl.UNSIGNED_BYTE</code>. No data is provided<br>
for the texture. Texture parameters will be set accordingly</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the texture to resize</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>the new width. If not passed in will use <code>options.width</code></p>
</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>the new height. If not passed in will use <code>options.height</code></p>
</td>
</tr>
<tr>
<td class="name"><code>depth</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>the new depth. If not passed in will use <code>options.depth</code></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setDefaultTextureColor"><span class="type-signature">(static) </span>setDefaultTextureColor<span class="signature">(color)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets the default texture color.</p>
<p>The default texture color is used when loading textures from<br>
urls. Because the URL will be loaded async we'd like to be<br>
able to use the texture immediately. By putting a 1x1 pixel<br>
color in the texture we can start using the texture before<br>
the URL has loaded.</p>
</div>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>see <a href="module-twgl.html#.setDefaults"><code>module:twgl.setDefaults</code></a></li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><code>Array.&lt;number></code></span>
</td>
<td class="description last">
<p>Array of 4 values in the range 0 to 1</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setEmptyTexture"><span class="type-signature">(static) </span>setEmptyTexture<span class="signature">(gl, tex, options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets a texture with no contents of a certain size. In other words calls <code>gl.texImage2D</code> with <code>null</code>.<br>
You must set <code>options.width</code> and <code>options.height</code>.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setSamplerParameters"><span class="type-signature">(static) </span>setSamplerParameters<span class="signature">(gl, sampler, options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets the sampler parameters of a sampler.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>sampler</code></td>
<td class="type">
<span class="param-type"><code>WebGLSampler</code></span>
</td>
<td class="description last">
<p>the WebGLSampler to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setTextureFilteringForSize"><span class="type-signature">(static) </span>setTextureFilteringForSize<span class="signature">(gl, tex, options<span class="signature-attributes">opt</span>, width<span class="signature-attributes">opt</span>, height<span class="signature-attributes">opt</span>, internalFormat<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets filtering or generates mips for texture based on width or height<br>
If width or height is not passed in uses <code>options.width</code> and//or <code>options.height</code></p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.<br>
This is often the same options you passed in when you created the texture.</p>
</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>width of texture</p>
</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>height of texture</p>
</td>
</tr>
<tr>
<td class="name"><code>internalFormat</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>The internalFormat parameter from texImage2D etc..</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setTextureFromArray"><span class="type-signature">(static) </span>setTextureFromArray<span class="signature">(gl, tex, src, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets a texture from an array or typed array. If the width or height is not provided will attempt to<br>
guess the size. See <a href="module-twgl.html#.TextureOptions"><code>module:twgl.TextureOptions</code></a>.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>src</code></td>
<td class="type">
<span class="param-type"><code>Array.&lt;number></code></span>
|
<span class="param-type"><code>ArrayBufferView</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>An array or typed arry with texture data.</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.<br>
This is often the same options you passed in when you created the texture.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setTextureFromElement"><span class="type-signature">(static) </span>setTextureFromElement<span class="signature">(gl, tex, element, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Set a texture from the contents of an element. Will also set<br>
texture filtering or generate mips based on the dimensions of the element<br>
unless <code>options.auto === false</code>. If <code>target === gl.TEXTURE_CUBE_MAP</code> will<br>
attempt to slice image into 1x6, 2x3, 3x2, or 6x1 images, one for each face.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>element</code></td>
<td class="type">
<span class="param-type"><code>HTMLElement</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>a canvas, img, or video element.</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.<br>
This is often the same options you passed in when you created the texture.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id=".setTextureParameters"><span class="type-signature">(static) </span>setTextureParameters<span class="signature">(gl, tex, options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets the texture parameters of a texture.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>tex</code></td>
<td class="type">
<span class="param-type"><code>WebGLTexture</code></span>
</td>
<td class="description last">
<p>the WebGLTexture to set parameters for</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.<br>
This is often the same options you passed in when you created the texture.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="~copyOptionsAndApplyPackState"><span class="type-signature">(inner) </span>copyOptionsAndApplyPackState<span class="signature">(gl, options)</span><span class="type-signature"> &rarr; {<a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a>}</span></h4>
<div class="description">
<p>Copy the options object and apply pack state</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="~createTextureAsync"><span class="type-signature">(inner) </span>createTextureAsync<span class="signature">(gl, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;CreateTextureInfo>}</span></h4>
<div class="description">
<p>Creates a texture based on the options passed in.</p>
<p>see <a href="module-twgl_textures.html#.createTexture"><code>module:twgl/textures.createTexture</code></a>.<br>
The only difference is this function returns a promise<br>
where as the other returns a texture and takes a callback.</p>
<p>Note: this is here for completeness. It is probably better to use<br>
the non-async version as it returns a usable texture immediately<br>
where as this one you have to wait for it to load.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A TextureOptions object with whatever parameters you want set.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise.&lt;CreateTextureInfo></code></span>
</dd>
</dl>
<div class="param-desc">
<p>The created texture and source.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id="~createTexturesAsync"><span class="type-signature">(inner) </span>createTexturesAsync<span class="signature">(gl, options)</span><span class="type-signature"> &rarr; {Promise.&lt;CreateTexturesInfo>}</span></h4>
<div class="description">
<p>Creates textures based on the options passed in.</p>
<p>see <a href="module-twgl_textures.html#.createTextures"><code>module:twgl/textures.createTextures</code></a>.<br>
The only difference is this function returns a promise<br>
where as the other returns a texture and takes a callback.</p>
<p>Note: this is here for completeness. It is probably better to use<br>
the non-async version as it returns usable textures immediately<br>
where as this one you have to wait for them to load.</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code>Object.&lt;string, <a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a>></code></span>
</td>
<td class="description last">
<p>A object of TextureOptions one per texture.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise.&lt;CreateTexturesInfo></code></span>
</dd>
</dl>
<div class="param-desc">
<p>The created textures and sources.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id="~getPackStateOption"><span class="type-signature">(inner) </span>getPackStateOption<span class="signature">(gl, options, property, pname)</span><span class="type-signature"> &rarr; {<a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a>}</span></h4>
<div class="description">
<p>returns the property if set or the corresponding state if undefined</p>
</div>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gl</code></td>
<td class="type">
<span class="param-type"><code>WebGLRenderingContext</code></span>
</td>
<td class="description last">
<p>the WebGLRenderingContext</p>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>property</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>the name of the property to copy</p>
</td>
</tr>
<tr>
<td class="name"><code>pname</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code><a href="module-twgl.html#.TextureOptions">module:twgl.TextureOptions</a></code></span>
</dd>
</dl>
</div>
</div>
<h3 class="subsection-title">Type Definitions</h3>
<div class="section-members">
<h4 class="name" id=".TextureFormatInfo">TextureFormatInfo</h4>
<div class="description">
<p>Info related to a specific texture internalFormat as returned<br>
from <a href="module-twgl_textures.html#.getFormatAndTypeForInternalFormat"><code>module:twgl/textures.getFormatAndTypeForInternalFormat</code></a>.</p>
</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last"><p>Format to pass to texImage2D and related functions</p></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last"><p>Type to pass to texImage2D and related functions</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code>Object</code></span>
</li>
</ul>
</div>
</article>
</section>
</div>
<br class="clear">
<script src="scripts/prep.js"></script>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>