23 lines
386 B
Markdown
23 lines
386 B
Markdown
|
|
# OpenGLTexture::Bind
|
|||
|
|
|
|||
|
|
```cpp
|
|||
|
|
void Bind(int slot = 0) const
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
将纹理绑定到纹理单元。
|
|||
|
|
|
|||
|
|
**参数:**
|
|||
|
|
- `slot` - 纹理单元槽位(默认为 0)
|
|||
|
|
|
|||
|
|
**示例:**
|
|||
|
|
|
|||
|
|
```cpp
|
|||
|
|
texture.Bind(0); // 绑定到纹理单元 0
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 相关文档
|
|||
|
|
|
|||
|
|
- [OpenGLTexture](texture.md) - 返回类总览
|
|||
|
|
- [Unbind](unbind.md) - 解绑纹理
|
|||
|
|
- [BindImage](bind-image.md) - 绑定图像单元
|