Hello all.
I have attached CEGUI to a game that creates a new D3D device every time you switch between windowed/full screen mode and also if window size changes. Does that mean I will need to fully reinitialize CEGUI every single time ? Load layouts, imagesets, fonts, schemes and so on ? Or is there a short cut I can take ?
Greg.
new D3D device -> CEGUI
Moderators: CEGUI MVP, CEGUI Team
Re: new D3D device -> CEGUI
Hi,
When I receive "DeviceRestored", for CEGUI I just do (I am running Ogre3D + CEGUI)
/mmixLinus;
When I receive "DeviceRestored", for CEGUI I just do
Code: Select all
CEGUI::System::getSingleton().signalRedraw();
/mmixLinus;
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)
Re: new D3D device -> CEGUI
But I'm talking about a situation where a completely new dev is being created every time. How will the renderer and system be notified about this new D3Ddev ?
-
- Just popping in
- Posts: 13
- Joined: Sun Nov 21, 2010 20:58
- Location: Germany - Hamburg
- Contact:
Re: new D3D device -> CEGUI
for resizing or switching fullscreen you rather should reset the device instead
I guess the renderer takes notice automaticly, using OGRE myself too, but there are two public support functions for a device reset:
http://www.cegui.org.uk/docs/current/cl ... derer.html
In case you really want to create a new device, I guess you'll have to look into the bootstrapSystem function and see what it does to manually recreate your Direct3D9Renderer.
Eventuallly the static create and destroy functions will do.
HTH
I guess the renderer takes notice automaticly, using OGRE myself too, but there are two public support functions for a device reset:
http://www.cegui.org.uk/docs/current/cl ... derer.html
In case you really want to create a new device, I guess you'll have to look into the bootstrapSystem function and see what it does to manually recreate your Direct3D9Renderer.
Eventuallly the static create and destroy functions will do.
HTH
Re: new D3D device -> CEGUI
Problem is you cannot send the new device to the system object you need to create a new system which in turn recreates all the managers hence I'll need to reload everything, right ?
Re: new D3D device -> CEGUI
Hm, why on earth does the game create a new device when the window is resized (or at all)?! That "must" be sub-optimal! (ok, I admit that is looking at the problem from the wrong end).
Sorry, I don't have an answer to your problem then
/mmixLinus
Sorry, I don't have an answer to your problem then
/mmixLinus
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)
-
- Just popping in
- Posts: 13
- Joined: Sun Nov 21, 2010 20:58
- Location: Germany - Hamburg
- Contact:
Re: new D3D device -> CEGUI
agreed, you really shouldn't need to create a new device for this
beside, taking a glance at the system header you could try to derive from system class to access the protected renderer attribute
(ofc you'd have to implement your own bootstrap then)
but that might well cause trouble with cegui and previously loaded resources
beside, taking a glance at the system header you could try to derive from system class to access the protected renderer attribute
(ofc you'd have to implement your own bootstrap then)
but that might well cause trouble with cegui and previously loaded resources
Re: new D3D device -> CEGUI
Accessing the d_renderer is no good anyway as it's a reference not a pointer so I don't think it can be reinitialized.
Wonder how this lib would go about rendering the GUI in a multi-monitor environment.... guess that's simply not supported, right? Unless you put all of it on one monitor.
Wonder how this lib would go about rendering the GUI in a multi-monitor environment.... guess that's simply not supported, right? Unless you put all of it on one monitor.
-
- Just popping in
- Posts: 13
- Joined: Sun Nov 21, 2010 20:58
- Location: Germany - Hamburg
- Contact:
Re: new D3D device -> CEGUI
gregee123 wrote:Accessing the d_renderer is no good anyway as it's a reference not a pointer so I don't think it can be reinitialized.
internally the renderer is stored by a simple pointer, the reference in constuctor is simply to prevent passing NULL I guess:
Renderer* d_renderer; //!< Holds the pointer to the Renderer object given to us in the constructor
gregee123 wrote:Wonder how this lib would go about rendering the GUI in a multi-monitor environment.... guess that's simply not supported, right? Unless you put all of it on one monitor.
Can't tell you on that, sry.
Re: new D3D device -> CEGUI
Thanks for the answers!
It turns out that with all these objects so tightly coupled with each other I need to destroy the "system object" and initialize it from scratch with all the singletons/managers.
It turns out that with all these objects so tightly coupled with each other I need to destroy the "system object" and initialize it from scratch with all the singletons/managers.
Who is online
Users browsing this forum: No registered users and 10 guests