Files
il/resources/public/js/cljs-runtime/module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$utils$applyStyleParams.js
2026-07-01 22:38:29 -06:00

31 lines
2.1 KiB
JavaScript

shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$utils$applyStyleParams = function(global, require, module, exports) {
var pixiToGlMaps = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$utils$pixiToGlMaps");
"use strict";
exports.applyStyleParams = function(style, gl, mipmaps, anisotropicExt, glFunctionName, firstParam, forceClamp, firstCreation) {
if (!firstCreation || "repeat" !== style.addressModeU || "repeat" !== style.addressModeV || "repeat" !== style.addressModeW) {
const wrapModeT = pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeV], wrapModeR = pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeW];
gl[glFunctionName](firstParam, gl.TEXTURE_WRAP_S, pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeU]);
gl[glFunctionName](firstParam, gl.TEXTURE_WRAP_T, wrapModeT);
if (gl.TEXTURE_WRAP_R) {
gl[glFunctionName](firstParam, gl.TEXTURE_WRAP_R, wrapModeR);
}
}
if (!firstCreation || "linear" !== style.magFilter) {
gl[glFunctionName](firstParam, gl.TEXTURE_MAG_FILTER, pixiToGlMaps.scaleModeToGlFilter[style.magFilter]);
}
if (mipmaps) {
if (!firstCreation || "linear" !== style.mipmapFilter) {
gl[glFunctionName](firstParam, gl.TEXTURE_MIN_FILTER, pixiToGlMaps.mipmapScaleModeToGlFilter[style.minFilter][style.mipmapFilter]);
}
} else {
gl[glFunctionName](firstParam, gl.TEXTURE_MIN_FILTER, pixiToGlMaps.scaleModeToGlFilter[style.minFilter]);
}
anisotropicExt && 1 < style.maxAnisotropy && (mipmaps = Math.min(style.maxAnisotropy, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), gl[glFunctionName](firstParam, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, mipmaps));
if (style.compare) {
gl[glFunctionName](firstParam, gl.TEXTURE_COMPARE_FUNC, pixiToGlMaps.compareModeToGlCompare[style.compare]);
}
};
};
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$utils$applyStyleParams.js.map