Upgraded to 2.2.3, nothing displaying

tp

22-11-2009 19:18:52

I upgraded to MyGUI v2.2.3 from an earlier version I'm not completely sure of, I think it was from some time last summer.

The major updates I had to do in my code involved input injection, but I don't think that was a problem. In addition to that, I copied the files for the default skin into my project's resource paths

Since the update, I haven't been able to get anything to display. The log is not showing any errors


----------------------------------------------------------------------------------------------------------------------------------
loging report for : 11/22/2009 21:23:15
----------------------------------------------------------------------------------------------------------------------------------

21:23:15 | Platform | Info | * Initialise: OgreRenderManager | .\src\MyGUI_OgreRenderManager.cpp | 42
21:23:15 | Platform | Info | OgreRenderManager successfully initialized | .\src\MyGUI_OgreRenderManager.cpp | 70
21:23:15 | Platform | Info | * Initialise: OgreDataManager | .\src\MyGUI_OgreDataManager.cpp | 61
21:23:15 | Platform | Info | OgreDataManager successfully initialized | .\src\MyGUI_OgreDataManager.cpp | 65
21:23:15 | Core | Info | * Initialise: Gui | .\src\MyGUI_Gui.cpp | 83
21:23:15 | Core | Info | * MyGUI version 3.0.0 | .\src\MyGUI_Gui.cpp | 87
21:23:15 | Core | Info | * Initialise: ResourceManager | .\src\MyGUI_ResourceManager.cpp | 43
21:23:15 | Core | Info | ResourceManager successfully initialized | .\src\MyGUI_ResourceManager.cpp | 51
21:23:15 | Core | Info | * Initialise: LayerManager | .\src\MyGUI_LayerManager.cpp | 45
21:23:15 | Core | Info | LayerManager successfully initialized | .\src\MyGUI_LayerManager.cpp | 53
21:23:15 | Core | Info | * Initialise: WidgetManager | .\src\MyGUI_WidgetManager.cpp | 66
21:23:15 | Core | Info | WidgetManager successfully initialized | .\src\MyGUI_WidgetManager.cpp | 105
21:23:15 | Core | Info | * Initialise: InputManager | .\src\MyGUI_InputManager.cpp | 42
21:23:15 | Core | Info | InputManager successfully initialized | .\src\MyGUI_InputManager.cpp | 58
21:23:15 | Core | Info | * Initialise: SubWidgetManager | .\src\MyGUI_SubWidgetManager.cpp | 44
21:23:15 | Core | Info | SubWidgetManager successfully initialized | .\src\MyGUI_SubWidgetManager.cpp | 64
21:23:15 | Core | Info | * Initialise: SkinManager | .\src\MyGUI_SkinManager.cpp | 46
21:23:15 | Core | Info | SkinManager successfully initialized | .\src\MyGUI_SkinManager.cpp | 54
21:23:15 | Core | Info | * Initialise: FontManager | .\src\MyGUI_FontManager.cpp | 44
21:23:15 | Core | Info | FontManager successfully initialized | .\src\MyGUI_FontManager.cpp | 53
21:23:15 | Core | Info | * Initialise: ControllerManager | .\src\MyGUI_ControllerManager.cpp | 42
21:23:15 | Core | Info | ControllerManager successfully initialized | .\src\MyGUI_ControllerManager.cpp | 52
21:23:15 | Core | Info | * Initialise: PointerManager | .\src\MyGUI_PointerManager.cpp | 51
21:23:15 | Core | Info | PointerManager successfully initialized | .\src\MyGUI_PointerManager.cpp | 69
21:23:15 | Core | Info | * Initialise: ClipboardManager | .\src\MyGUI_ClipboardManager.cpp | 82
21:23:15 | Core | Info | ClipboardManager successfully initialized | .\src\MyGUI_ClipboardManager.cpp | 96
21:23:15 | Core | Info | * Initialise: LayoutManager | .\src\MyGUI_LayoutManager.cpp | 43
21:23:15 | Core | Info | LayoutManager successfully initialized | .\src\MyGUI_LayoutManager.cpp | 49
21:23:15 | Core | Info | * Initialise: DynLibManager | .\src\MyGUI_DynLibManager.cpp | 35
21:23:15 | Core | Info | DynLibManager successfully initialized | .\src\MyGUI_DynLibManager.cpp | 37
21:23:15 | Core | Info | * Initialise: PluginManager | .\src\MyGUI_PluginManager.cpp | 37
21:23:15 | Core | Info | PluginManager successfully initialized | .\src\MyGUI_PluginManager.cpp | 41
21:23:15 | Core | Info | * Initialise: DelegateManager | .\src\MyGUI_DelegateManager.cpp | 34
21:23:15 | Core | Info | DelegateManager successfully initialized | .\src\MyGUI_DelegateManager.cpp | 38
21:23:15 | Core | Info | * Initialise: LanguageManager | .\src\MyGUI_LanguageManager.cpp | 40
21:23:15 | Core | Info | LanguageManager successfully initialized | .\src\MyGUI_LanguageManager.cpp | 44
21:23:15 | Core | Info | * Initialise: FactoryManager | .\src\MyGUI_FactoryManager.cpp | 34
21:23:15 | Core | Info | FactoryManager successfully initialized | .\src\MyGUI_FactoryManager.cpp | 37
21:23:15 | Core | Info | Load ini file 'core_theme.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Load ini file 'core_language.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Load ini file 'core_font.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | ResourceTrueTypeFont 'font_DejaVuSans.17' using texture size 512 x 256 | .\src\MyGUI_ResourceTrueTypeFont.cpp | 179
21:23:15 | Core | Info | ResourceTrueTypeFont 'font_DejaVuSans.17' using real height 17 pixels | .\src\MyGUI_ResourceTrueTypeFont.cpp | 180
21:23:15 | Core | Info | ResourceTrueTypeFont 'font_DejaVuSans.14' using texture size 256 x 256 | .\src\MyGUI_ResourceTrueTypeFont.cpp | 179
21:23:15 | Core | Info | ResourceTrueTypeFont 'font_DejaVuSans.14' using real height 14 pixels | .\src\MyGUI_ResourceTrueTypeFont.cpp | 180
21:23:15 | Core | Info | Load ini file 'core_resource.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Load ini file 'core_skin.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Register value : 'HCenter' = 0 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 181
21:23:15 | Core | Info | Register value : 'VCenter' = 0 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 182
21:23:15 | Core | Info | Register value : 'Center' = 0 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 183
21:23:15 | Core | Info | Register value : 'Left' = 2 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 184
21:23:15 | Core | Info | Register value : 'Right' = 4 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 185
21:23:15 | Core | Info | Register value : 'HStretch' = 6 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 186
21:23:15 | Core | Info | Register value : 'Top' = 8 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 187
21:23:15 | Core | Info | Register value : 'Bottom' = 16 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 188
21:23:15 | Core | Info | Register value : 'VStretch' = 24 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 189
21:23:15 | Core | Info | Register value : 'Stretch' = 30 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 190
21:23:15 | Core | Info | Register value : 'Default' = 10 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 191
21:23:15 | Core | Info | Register value : 'HRelative' = 32 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 192
21:23:15 | Core | Info | Register value : 'VRelative' = 64 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 193
21:23:15 | Core | Info | Register value : 'Relative' = 96 | d:\development\atom\dependencies\mygui\myguiengine\include\MyGUI_Align.h | 194
21:23:15 | Core | Info | Load ini file 'core_pointer.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Load ini file 'core_layer.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Load ini file 'core_settings.xml' | .\src\MyGUI_ResourceManager.cpp | 152
21:23:15 | Core | Info | Gui successfully initialized | .\src\MyGUI_Gui.cpp | 132


I'm trying to track this down, but any suggestions would be welcome, from someone who knows what happened to the rendering code in the change to 2.2.3.

tp

22-11-2009 21:28:25

The problem was that I am using more than one viewport, and I had to add a call to:


m_pPlatform->getRenderManagerPtr()->setActiveViewport(1);


I would like to pose a question to the MyGUI developers about a potential problem and a potential solution: The reason I have multiple viewports is that my scripting system allows the creation of additional cameras into the scene, all of which have their own viewport. In a setup like this, it is possible to create a viewport for a secondary camera (e.g. the rear view mirror in a racing game) before the MyGUI viewport index is given. If the player then decides to disable a camera, the index will be invalidated, and MyGUI will cease to function properly. Is it not dangerous to refer to something by its location in an array, especially if it may break the operation of the GUI system?

One potential solution to this would be to either store the viewport MyGUI renders to as either an Ogre::Viewport pointer, or the z-index of the viewport, which won't change when viewports are deleted and created and is unique to a particular viewport.

I did not check if changing this would cause problems with accessing the ogre view structures from inside MyGUI. It seems that Ogre::RenderWindow does not provide shared pointers to viewports, so it might well be so.

my.name

22-11-2009 23:14:51

show code

tp

23-11-2009 07:13:31

This is imaginary, I don't have it in my project, but should illustrate the problem:


Ogre::Viewport* vpScene = m_pRenderingSystem->GetWindow()->addViewport(m_pSceneCamera, 0);
Ogre::Viewport* vpRearView = m_pRenderingSystem->GetWindow()->addViewport(m_pRearViewCamera, 1);
Ogre::Viewport* vpGui = m_pRenderingSystem->GetWindow()->addViewport(m_pGuiCamera, 100);

m_pPlatform = new MyGUI::OgrePlatform();
m_pPlatform->initialise(m_pRenderingSystem->GetWindow(), m_pSceneMgr);
m_pPlatform->getRenderManagerPtr()->setActiveViewport(2);
m_pGUI = new MyGUI::Gui();
m_pGUI->initialise();

...

// Remove the secondary viewport
m_pRenderingSystem->GetWindow()->removeViewport(1);


When vpRearView is removed, the mActiveViewport value stays at 2, but the GUI probably does not render anymore. Note that even Ogre uses the z-index here.

Thank you for looking into it.

Altren

23-11-2009 08:27:41

Just call m_pPlatform->getRenderManagerPtr()->setActiveViewport(1); // or whatever index you need after deleting. Idea with saving pointer is worse because there's no way to know if this pointer is still valid, so if you delete current viewport that MyGUI use it will cause crash.

tp

23-11-2009 08:51:46

In my case, the GUI viewport is always at index 1 and dynamic viewports follow that, so it is not a problem for me.

I made a new entry in the wiki FAQ to let people know about this.