我开始在 openGl 中使用纹理,我注意到一些奇怪的行为。请参阅以下伪代码示例:
int main()...
bindTexture1();
bindTexture2();
bindTexture3();
// None of these textures are actually used!
while(true) {
begin();
// draw stuff
end();
}
我正在加载和绑定 3 个纹理,但现在我只是在绘制图元。但是那些原语是不可见的。它们在以下情况下可见:
int main()...
bindTexture1(); // <- So the first bind() remains the only one
//bindTexture2();
//bindTexture3();
// None of these textures are actually used!
while(true) {
begin();
// draw again just primitve stuff but now it's visible
end();
}
或者
int main()...
bindTexture1();
bindTexture2();
bindTexture3();
// None of these textures are actually used!
while(true) {
begin();
bindTexture1(); // Binding texture 1 again
// draw again just primitve stuff but now it's visible
end();
}
所以我想我的问题与这个 glBindTexture 函数有关吗?