wonder.js
Version:
31 lines (27 loc) • 1.41 kB
JavaScript
;
var Curry = require("bs-platform/lib/js/curry.js");
var TextureIndexService$Wonderjs = require("../../../primitive/material/TextureIndexService.js");
var BindTextureRenderService$Wonderjs = require("../texture/BindTextureRenderService.js");
var UpdateAllTextureRenderService$Wonderjs = require("../texture/allTexture/UpdateAllTextureRenderService.js");
var OperateAllTextureRenderService$Wonderjs = require("../texture/allTexture/OperateAllTextureRenderService.js");
function bindAndUpdate(param, param$1, setMapUnitFunc, state) {
var textureType = param$1[1];
var texture = param$1[0];
var gl = param[0];
var match = TextureIndexService$Wonderjs.isTextureNotDefaultValue(texture);
if (match) {
var match$1 = OperateAllTextureRenderService$Wonderjs.getActivableTextureUnit(state);
var mapUnit = match$1[0];
return UpdateAllTextureRenderService$Wonderjs.handleUpdate(gl, /* tuple */[
texture,
textureType
], BindTextureRenderService$Wonderjs.bind(gl, mapUnit, /* tuple */[
texture,
textureType
], OperateAllTextureRenderService$Wonderjs.setActivedTextureUnitIndex(match$1[1], Curry._3(setMapUnitFunc, param[1], mapUnit, state))));
} else {
return state;
}
}
exports.bindAndUpdate = bindAndUpdate;
/* BindTextureRenderService-Wonderjs Not a pure module */