Exchange device in D3D renderer on device re-creation

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

uvhannes
Just popping in
Just popping in
Posts: 10
Joined: Wed Aug 16, 2017 09:01

Exchange device in D3D renderer on device re-creation

Postby uvhannes » Mon Sep 25, 2017 22:58

Hi,

we are working with older games that re-create their D3DX devices when you go to fullscreen for example. Currently we destroy the complete CEGUI ecosystem prior to throwing the device away and then we basically start over...

Is there are was in CEGUI where i basically can just exchange the device in the renderer (dx9) and just stop rendering while device recreation?

We do have CEF fully integrated and i do not want to make an effort to re-create all the browser windows as well.

cheers and thanks,

please let me know if i am not making sense here :)

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Exchange device in D3D renderer on device re-creation

Postby Ident » Mon Sep 25, 2017 23:13

I can't think of a way you could do this. If you destroy the device you pretty much pull the rug underneath CEGUI's feet away, because the resources are created on that device. If you switch devices, you would have to put a new rug underneath CEGUI before it tries to do anything, and it will have to have all resources in place like CEGUI did before (or alternative u will have to set it all for CEGUI). This is fairly easy to do yourself for textures as we (afaik) have functionality to retrieve the memory for CEGUI textures so you could just add a new texture and feed it the same data agin. I am not sure what exactly would be needed on D3D9 for all the rest. And I am not sure how much time it would take to add all the calls for "copying over" the data.

So yea, what I would do as well is to just nuke CEGUI and reload it. To speed this up dramatically, you could evade a lot (maybe all) of the resource reloading by caching as much data as you can, such as the aforementioned texture data, also the glyph atlas, etc., or just not do that if the speed is already somewhat sufficient (how often does a player go Fullscreen and windowed anyways).

Sorry if this answer was not satisfacory. I guess CEGUi was not perfectly set up for such a specific use-case ;) (besides, as you said this is just legacy situation anyways)
CrazyEddie: "I don't like GUIs"

uvhannes
Just popping in
Just popping in
Posts: 10
Joined: Wed Aug 16, 2017 09:01

Re: Exchange device in D3D renderer on device re-creation

Postby uvhannes » Tue Sep 26, 2017 06:37

cool, thought so :)

Thanks for the answer anyways, appreciate it


Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest