OGRE 引擎可以渲染到任何窗口中吗?
我正在制作一个小型插件类图形引擎接口,它在内部使用 OGRE。这个想法是,在 Windows 或 Linux 中创建程序的人将能够使用我的插件来完成他们需要做的任何图形渲染。
事实上,已经有一个使用 GDI 和 GDI 的 Windows 应用程序。 D3D调用进行绘图,我需要对其进行修改,以便它可以使用OGRE进行绘图。
让我困惑的是,该应用程序是用 VC++ 编写的,因此具有 Windows 风格的菜单和绘图客户区。但是由于OGRE创建了自己的渲染窗口,我是否可以将应用程序窗口的客户区域的句柄发送给OGRE,并且OGRE会在窗口的客户区域中进行所有绘制?
我是 Windows 编程新手,并且时间有限,所以不得不在这里提问。
I'm making a small plugin-kind-of graphics engine interface which uses OGRE internally. The idea is that a person creating a program in Windows or Linux, would be able to use my plugin for doing any graphics rendering they need to do.
In-fact there's already a Windows app using GDI & D3D calls to do drawing, which I need to modify so that it can use OGRE to do the drawing.
What puzzles me is that the app is programmed in VC++ and hence has Windows-style menus and client area for drawing. But since OGRE creates its own window for rendering, will it be possible for me to send a handle of the client area of the app's window to OGRE and will OGRE do all the drawing in the client area of the window?
I'm new to Windows programming and under a bit of a time constraint, so had to ask here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这可以帮助:
QX11Info 是 Qt 类,用于获取句柄。
句柄作为名称:“parentWindowHandle”插入到 Ogre::NameValuePairList 值:你的句柄和 10 个作为参数发送给 OgreRoot::createRenderWindow()。我用 Qt 尝试了这段代码,它成功了。如果它不起作用,请尝试使用 externalWindowHandle 作为参数名称。
来源:http://www.ogre3d.org/tikiwiki/QtOgre
maybe this can help:
QX11Info is Qt class, used to get handle.
Handle is inserted to Ogre::NameValuePairList as name:"parentWindowHandle" value: your handle and ten sent as argument to OgreRoot::createRenderWindow(). I tried this code with Qt and it worked. If it wont work try to use externalWindowHandle as parameter name.
source: http://www.ogre3d.org/tikiwiki/QtOgre