pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
37 lines (35 loc) • 821 B
JavaScript
;
const glUploadBufferImageResource = {
id: "buffer",
upload(source, glTexture, gl) {
if (glTexture.width === source.width || glTexture.height === source.height) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
source.width,
source.height,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
source.width,
source.height,
0,
glTexture.format,
glTexture.type,
source.resource
);
}
glTexture.width = source.width;
glTexture.height = source.height;
}
};
export { glUploadBufferImageResource };
//# sourceMappingURL=glUploadBufferImageResource.mjs.map