OpenGL错误下溢变成溢出?
我正在开发一个仅使用 OpenGL 的项目(具体来说,它应该成为一款游戏),现在经过几周的开发,我偶然发现了使用 GL.GetError() 捕获 OpenGL 错误的可能性。代码>. 因为我不喜欢它只说明出了问题,但没有说明问题出在哪里,所以我想修复发生的错误。
所以这就是发生的事情: 启动应用程序时,有几个帧(三或四个)带有 StackUnderflow
,它会切换到 StackOverflow
并保持这种状态。
我检查了 Matrix-Push
-Pop
一致性,没有发现任何未封闭的矩阵。有趣的是,据我所知,照明不起作用(各个物体的所有面都具有完全相同的亮度)。
还有其他可能的原因吗?
(如果您想查看源代码,可以在:http://galwarcom .svn.sourceforge.net/viewvc/galwarcom/trunk/galwarcom/)
I am working on a project which uses OpenGL only (it's supposed to become a game one time to be specific), now after some weeks of development I stumbled across the possibility to catch OpenGL errors with GL.GetError()
.
Since I dislike that it only says what went wrong but not where, I want to get the error that occurs fixed though.
So here is what happens:
When launching the app there are few frames (three or four) with StackUnderflow
, it switches to StackOverflow
and stays that way.
I checked my Matrix-Push
-Pop
consistency and didn't find any unclosed matrices. It might be interesting to know that, from what I see, lighting doesn't work (all faces of the various object have the very same brightness).
Is there any other possbile cause?
(If you want to see source, there is plenty at: http://galwarcom.svn.sourceforge.net/viewvc/galwarcom/trunk/galwarcom/ )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在弹出之前设置矩阵模式,因为每种模式都有一个单独的堆栈。如果你做这样的事情,它会下溢:
你正在drawHUD()中做类似的事情,可能是其他地方。
You need to set the matrix mode before popping since each mode has a separate stack. If you do something like this, it will underflow:
You are doing something like this in drawHUD(), probably other places.