glPushName + glPopName 堆栈上溢和下溢
谁能解释一下如何使用 glPushName 和 glPopName。我喜欢使用它们而不是 glLoadName,但我总是会遇到 GL_STACK_OVERFLOW 和 GL_STACK_UNDERFLOW 错误。 (先低于,后溢出)。
示例代码也会对我有帮助。
注意#1: 我的 Rendering/selection_rednering 代码由多个 glBegin(...)/glEnd() 块组成(如果这是任何问题)加上各种旋转和变换。
注意#2: 我知道 GL 选择/拾取已被弃用,但我必须在不久前使用 OpenGL2.1 开发的应用程序中实现它。
Can anybody explain me how to use glPushName and glPopName. I like to use them instead of glLoadName, but I laways get GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW errors. (First, under then overflow).
Example code would help me too.
Note #1:
My Rendering/selection_rednering code consists of multiple glBegin(...)/glEnd() blocks, if this is any problem plus various Rotations and Transformations.
Note #2:
I know that GL selection / picking is deprecated, but I have to implement it within a Application which was developed a with OpenGL2.1 a while ago.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,我只是愚蠢,因为堆栈溢出是由于执行过多的 glPushMatrix 引起的,因为该堆栈的容量非常低(在我的特殊硬件情况下为 3)。绘图模式工作得很好,但我有一个额外的矩阵用于拾取模式。
如何使用 glPopName /glPushName(name)
In this case I was just dumb, because that stackoverflow was caused by doing to much glPushMatrix, as that stack has a very low capacity (3 in my special hardware case). Drawing mode worked just fine, but I have an additional Matrix used for picking mode.
How to use glPopName /glPushName(name)