More cleanup

This commit is contained in:
Rezmason
2020-01-22 13:02:08 -08:00
parent cadd769b63
commit 05933a5dda
6 changed files with 113 additions and 130 deletions

View File

@@ -99,7 +99,7 @@ const makeFullScreenQuad = (regl, uniforms = {}, context = {}) =>
count: 3
});
const makePalette = (regl, data) =>
const make1DTexture = (regl, data) =>
regl.texture({
data,
width: data.length / 3,
@@ -109,6 +109,24 @@ const makePalette = (regl, data) =>
min: "linear"
});
const makePass = (output, render, resize) => {
if (render == null) {
render = () => {};
}
if (resize === undefined) {
// "default" resize function is on the FBO
resize = (w, h) => output.resize(w, h);
}
if (resize == null) {
resize = () => {};
}
return {
output,
render,
resize
};
};
export {
makePassTexture,
makePassFBO,
@@ -118,5 +136,6 @@ export {
loadImage,
loadImages,
makeFullScreenQuad,
makePalette
make1DTexture,
makePass
};