UNPKG

wonder.js

Version:
27 lines (21 loc) 1.04 kB
'use strict'; var ArrayService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ArrayService.js"); var OperateGlTextureMapService$Wonderjs = require("./OperateGlTextureMapService.js"); function initTexture(gl, texture, glTextureMap) { var match = OperateGlTextureMapService$Wonderjs.getTexture(texture, glTextureMap); if (match !== undefined) { return glTextureMap; } else { return OperateGlTextureMapService$Wonderjs.setTexture(texture, gl.createTexture(), glTextureMap); } } function initTexturesWithIndexArray(gl, textureIndexArray, glTextureMap) { return ArrayService$WonderCommonlib.reduceOneParam((function (glTextureMap, textureIndex) { return initTexture(gl, textureIndex, glTextureMap); }), glTextureMap, textureIndexArray); } var initTextures = initTexturesWithIndexArray; exports.initTexture = initTexture; exports.initTexturesWithIndexArray = initTexturesWithIndexArray; exports.initTextures = initTextures; /* OperateGlTextureMapService-Wonderjs Not a pure module */