Hello.
I need to change renderer object (from D3D to OGL ) in runtime. Please, demonstrate with an example.
Thank you.
P.S. Sorry for mistakes in my english.
Change renderer
Moderators: CEGUI MVP, CEGUI Team
As cegui has a runtime plugin architecture I would suspect it would be a matter of pulling one system down and creating another, as the system constructor takes a parameter which is a render pointer. Could someone verify this as I have not really looked into it myself but something I would also like to know as my engine is a runtime plugin system.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Changing renderers is not a bit deal, and is -as suggested- a matter of deleting the current System instance and building a new one. Just look at the cegui initialising code in your app and try something like this:
Which should work. However after you do this you need to rebuild the CEGUI state as it was, because bringing down the system also deletes all created widgets...
HTH.
Code: Select all
// Create
m_renderer = new CEGUI::DirectX9Renderer(my3DDevice, 3000);
new CEGUI::System(m_renderer);
// Cleanup
delete CEGUI::System::getSingletonPtr();
delete m_renderer;
// Re-create
m_renderer = new CEGUI::OpenGLRenderer(1024);
new CEGUI::System(m_renderer);
Which should work. However after you do this you need to rebuild the CEGUI state as it was, because bringing down the system also deletes all created widgets...
HTH.
Who is online
Users browsing this forum: No registered users and 6 guests