OpenGL中是否存在属性的glLoadIdentity
glLoadIdentity可以方便的回到原始矩阵。 OpenGL 的属性是否存在类似的东西,例如与 glPushAttrib(GL_ALL_ATTRIB_BITS)
和 glPopAttrib
系列一起使用的 loadIdentityAttribs(GL_ALL_ATTRIB_BITS)
?
glLoadIdentity is convenient to come back to the original matrix. Does something similar exist for the attributes of OpenGL, like loadIdentityAttribs(GL_ALL_ATTRIB_BITS)
which would go with the family of glPushAttrib(GL_ALL_ATTRIB_BITS)
and glPopAttrib
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并非如此 - 最接近的等效方法是立即推送默认状态,确保该默认状态在堆栈上可用。在这种情况下,您随时可以恢复到默认设置。诚然,默认值位于堆栈底部,但它确实在那里。
这些属性确实有记录的默认值,但确实没有一种方便的方法来表示“每个人都重置为开始。”
我的建议是选择您真正关心的应用程序属性,并编写将这些属性设置回默认值的方法。
Not really - the closest equivalent is to immediately push the default state, making sure that that default is available on the stack. In that case, you can always pop back to the default. Admittedly, the default is then at the bottom of the stack but it is there.
The attributes do have documented defaults but there really isn't a convenient way to say "everybody reset to start."
My suggestion is to select the attributes that you really care about for your application and to write the method that sets those back to your defaults.