Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 OpenGL 中获取矩阵堆栈(GL_MODELVIEW、GL_PROJECTION、GL_TEXTURE)的当前大小?
我想要这个,以便我可以进行一些错误检查,以确保在代码的某些部分我可以检查矩阵堆栈是否保持在原始状态。
尝试:
GLint depth; glGetIntegerv (GL_MODELVIEW_STACK_DEPTH, &depth);
其他堆栈的枚举是:
GL_MODELVIEW_STACK_DEPTH GL_PROJECTION_STACK_DEPTH GL_TEXTURE_STACK_DEPTH
如果您使用多重纹理,则需要查询多个纹理矩阵堆栈。为此,请通过 设置当前纹理单元glActiveTexture();。
glActiveTexture();