575 B
575 B
OpenGLTexture::Bind()
void Bind(int slot = 0) const;
作用
把当前纹理绑定到指定 texture unit。
参数
slot: 目标 texture unit 索引。
当前实现行为
函数会:
- 根据
m_type解析 OpenGL target - 调用
glActiveTexture(GL_TEXTURE0 + slot) - 调用
glBindTexture(target, m_texture)
需要注意
- 它会修改当前 active texture unit。
- 不会恢复调用前的 active unit。
- 不会检查
slot是否超出硬件支持范围。