samplerSetter method
dynamic
samplerSetter(
- OpenGLContextES gl,
- dynamic type,
- int unit,
- dynamic location, [
- dynamic test,
Implementation
samplerSetter(OpenGLContextES gl, type, int unit, location, [test]) {
var bindPoint = getBindPointForSamplerType(gl, type);
return (dynamic textureOrPair) {
int texture = textureOrPair;
// if (textureOrPair is WebGLTexture) {
// texture = textureOrPair;
// } else {
// // maybe I don't need this part for now.
// texture = textureOrPair.texture;
// gl.bindSampler(unit, textureOrPair.sampler); // ! fix this
// }
gl.uniform1i(location, unit);
gl.activeTexture(gl.TEXTURE0 + unit);
gl.bindTexture(bindPoint, texture);
};
}