Ruby、OpenGL 和多个窗口?
在 ruby-opengl 中是否有一种合理的方法来创建和销毁多个 OpenGL 窗口?
我的代码使用 GLUT 运行得很好,它是 ruby-opengl 包附带的,但它似乎遇到了(众所周知的?) GLUT 问题,不允许您在不对库进行重大黑客攻击的情况下捕获窗口关闭事件。
一些谷歌搜索似乎表明 FreeGLUT 库已扩展 GLUT 以包含窗口关闭回调,但这不是通过 ruby 绑定导出的。初步看GLFW和SDL绑定似乎都没有办法在窗口之间切换。
那么有没有一种首选的方法呢?也许我需要研究像 GTK 这样更重量级的库才能获得这种控制?
Is there a sane way to create and destroy multiple OpenGL windows in ruby-opengl?
I have code that is working wonderfully using GLUT, that comes with the ruby-opengl package, but it seems to suffer from the (well known?) problem of GLUT not allowing you to trap the window close events without major hacking of the library.
Some googling seems to indicate that the FreeGLUT library has extended GLUT to include a window-close callback, but that isn't exported through the ruby bindings. Preliminary reading of both GLFW and SDL bindings both seem to have no way to switch between windows.
So is there a preferred way of doing this? Perhaps I need to look into a much more heavyweight library like GTK to get this kind of control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论