bindTexture method
- UniformSlot slot,
- Texture texture, {
- SamplerOptions? sampler,
Implementation
void bindTexture(UniformSlot slot, Texture texture,
{SamplerOptions? sampler}) {
if (sampler == null) {
sampler = SamplerOptions();
}
bool success = _bindTexture(
slot.shader,
slot.uniformName,
texture,
sampler.minFilter.index,
sampler.magFilter.index,
sampler.mipFilter.index,
sampler.widthAddressMode.index,
sampler.heightAddressMode.index);
if (!success) {
throw Exception("Failed to bind texture");
}
}