My problem is that the widget does not render Ogre, although mRoot->renderOneFrame() is called.
The original example contains the following lines in GraphicsSystem.cpp.
Code: Select all
mSdlWindow = SDL_CreateWindow(
windowTitle.c_str(), // window title
posX, // initial x position
posY, // initial y position
width, // width, in pixels
height, // height, in pixels
SDL_WINDOW_SHOWN
| (fullscreen ? SDL_WINDOW_FULLSCREEN : 0) | SDL_WINDOW_RESIZABLE );
Code: Select all
m_pRenderer = new OgreRenderer(ui.centralwidget);
m_pRendererWidget = QWidget::createWindowContainer(
m_pRenderer,
ui.centralwidget);
m_pRendererWidget->resize(ui.centralwidget->size());
m_pRenderer->Initialize();
This renders an empty Ogre scene with a blue skybox in a separate window, as shown below.
Now I want to render the scene in the same window. Based on this tutorial, I changed those lines to the following.
Code: Select all
mSdlWindow = SDL_CreateWindowFrom((void*)widget->winId());
So is there any way I can debug this to find what is wrong with the code? Please let me know if I need to give more information. If there is another way to render Ogre 2.1 in Qt, I am also happy to hear.
I use Qt 5.7, Visual Studio 2015, Windows 8.1.
Thank you.