将 pbuffer 与 GLUT 一起使用?
我一直在网上搜索一个代码示例,该示例展示了如何将 pbuffer 与 GLUT 一起使用,但我找不到任何东西......
我对 pbuffer 和渲染窗口之间的上下文切换感到困惑。 我想我将不得不使用 glutSetWindow 在两个渲染表面之间切换,但我不太确定细节。
有人可以解释一下如何使用 GLUT 的 pbuffer 吗?
I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything...
I am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two rendering surface but I am not too sure about the details.
Can someone explain me how to use a pbuffer with GLUT?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简而言之,没有好的方法可以做到这一点。
更长的答案是 pbuffers 不是跨平台的,因此您必须使用特定于平台的 API 来访问它们。 如何在渲染表面之间切换取决于您的平台; 在 Windows 上,您可以使用 wglMakeCurrent() 等。
元答案是,如果可能的话,您应该避免使用 pbuffer - FBO s 提供类似的功能,但没有此类问题,并且性能也更好。
The short answer is that there's no good way of doing it.
The longer answer is that pbuffers are not cross-platform, so you necessarily have to use platform-specific APIs to access them. How you switch between rendering surfaces depends on your platform; on Windows you'd use wglMakeCurrent() and the like.
The meta-answer is that you should avoid pbuffers if at all possible - FBOs provide similar functionality but without this kind of problem, and with better performance too.
Mike F 的回答让我得到了ATI 关于 pbuffers 的很好的解释。 谢谢!
我没有找到任何提及切换上下文的 GLUT 函数,只有 wgl* 函数。 我一定是误解了 glutSetWindow 的目的。
Mike F's answer lead me to a good explanation from ATI about the pbuffers. Thanks!
I did not find any mention of GLUT functions to switch context, only wgl* functions. I must have misunderstood the purpose of glutSetWindow.