Ogre3d RestoreConfig 导致应用程序在 Ubuntu 上挂起

发布于 2024-08-19 15:35:41 字数 785 浏览 11 评论 0原文

使用 Ogre3D、CEGUI、OIS 为 Ubuntu 构建应用程序,现在所有内容都按预期编译和运行。运行基本应用程序后,我决定现在构建一个自定义配置文件,我可以存储图形设置(即分辨率、全屏等)以及我在应用程序中需要的其他可配置设置。

作为起点,我从每次启动时调用 mRoot->showConfigDialog() 更改为:

if(!mRoot->restoreConfig())
    mRoot->showConfigDialog();

这是为了从存在的“ogre.cfg”文件中恢复配置,所以它做到了,但要加载天空盒纹理第一个场景创建后就坐在那里什么也不做。

因为这不是我想要的,所以我尝试手动设置,例如:

RenderSystem *rs = mRoot->getRenderSystemByName("OpenGL Rendering Subsystem");
mRoot->setRenderSystem(rs);
rs->setConfigOption("Full Screen","No");
rs->setConfigOption("Video Mode","1024 x 768");

这些与我之前在 showConfigDialog() 函数中使用的“ogre.cfg”中的设置相匹配。然而,我在手动配置中遇到了同样的问题,在加载天空盒纹理时它就停止了。

我无法弄清楚为什么这些更改对应用程序的运行方式有任何影响,并且由于 OIS 获取输入并将鼠标锁定到屏幕,我在尝试使用 gdb 调试它时遇到了麻烦。

Building an app for Ubuntu using Ogre3D, CEGUI, OIS which is now all compiling and running as expected. Having got the basic app running I decided to now build a custom config file which I can store both graphics settings (ie. resolution, fullscreen, etc) as well as other configurable settings I will need in the app down the track.

As a starting point I changed from calling mRoot->showConfigDialog() at each startup to :

if(!mRoot->restoreConfig())
    mRoot->showConfigDialog();

this was meant to restore the config from the 'ogre.cfg' file which exists and so it did, but got to loading a skybox texture on the first scene create and just sat there doing nothing.

Since that wasn't what I wanted anyway I tried setting things up manually like :

RenderSystem *rs = mRoot->getRenderSystemByName("OpenGL Rendering Subsystem");
mRoot->setRenderSystem(rs);
rs->setConfigOption("Full Screen","No");
rs->setConfigOption("Video Mode","1024 x 768");

Those matched the settings from 'ogre.cfg' that I was using prior from the showConfigDialog() function. I got the same issue with this manual configuration however, while loading the skybox textures it just stops.

I can't work out why these changes have any bearing at all on how the app runs and since OIS grabs the input and locks the mouse to the screen I am having trouble trying to debug it with gdb.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独闯女儿国 2024-08-26 15:35:41

关于鼠标锁定,您可以在另一个显示器上运行 gdb。它可以是同一台计算机上的显示器(包括诸如 Xephyr 等创建虚拟显示嵌套在当前显示中,或者只是不同显示上的第二个会话 - 如果您有一个工作的 .xinitrc 一次运行两个或三个 X 会话很简单),或者它可以位于网络上的另一台计算机上(即通过 ssh -X)。

Regarding the mouse locking, you can run gdb on another display. It can either be a display on the same computer (including options like Xephyr that create virtual displays nested in the current display, or just a second session on a different display - if you have a working .xinitrc running two or three X sessions at a time is simple), or it can be on another machine on your network (ie. via ssh -X).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文