bindTexture method

void bindTexture(
  1. UniformSlot slot,
  2. Texture texture, {
  3. 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");
  }
}