Problem when not rendering direct to back buffer

al2950

20-05-2014 10:43:35

Hi

I have a slight issue with MyGui in that it takes a render window as a init parameter, and extracts the viewport from it. However I just implemented support for the oculus rift and therefore I never render direct to the render window back buffer. However MyGui expects there to be a viewport on the render window, if not it crashes. Would it not be better to pass MyGui the viewport you want to render to instead of passing it the render window? Or even better a list of viewports you want it to render to?

To get round this issue for now I have created a dummy camera & viewport on the render window, which is very hacky and I dont like!!

Cheers

Gus

Altren

20-05-2014 12:40:44

You are free to modify MyGUI.OgrePlatform to suit yourself.

RenderWindow is needed to resize Gui on windowResized event. Otherwise it is safe to replace mWindow and mActiveViewport variables with Ogre::Viewport* .

al2950

20-05-2014 12:45:21

Would you be happy if I made a change as you suggested a create a pull request so it can be merged in with your master repo?

Altren

20-05-2014 14:09:00

Yes, I'll apply your changes to master repo, but this changes should be compatible with current logic.
Since current OgreRenderManager accept null in place of render window during initialization you can leave OgreRenderManager::initialise as it is and add new function to set viewport (this function also should be used internally, when viewport is set through renderwindow and viewport index).

al2950

20-05-2014 14:30:00

Ok will do