Crashes in Ogre 1.8.0

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Crashes in Ogre 1.8.0

Post by bstone »

Yep, that's the price D3D9 incurs for extra performance options. I don't think we can reload the lost resources on full auto because not all of them come from the file resources (e.g. render target textures, manual textures, etc.). The application will have to hook into the render system and listen for the "resource lost" events. I think this might be doable with D3D9 RS already just that the hooking interface is not defined by the base render system class.
User avatar
Mattan Furst
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 260
Joined: Tue Jan 01, 2008 11:28 am
Location: Israel
x 32

Re: Crashes in Ogre 1.8.0

Post by Mattan Furst »

... The application will have to hook into the render system and listen for the "resource lost" events. ...
I might be wrong but I think there is already a mechanism for that. If you create, for instance, a texture manually
(TextureManager::createManual(...)) one of the parameter is a pointer to an Ogre::ManualResourceLoader class. I think that using this class the D3D9 render system re-loads the texture in a device loss event.
it's turtles all the way down
User avatar
0xC0DEFACE
OGRE Expert User
OGRE Expert User
Posts: 84
Joined: Thu May 21, 2009 4:55 am
x 7

Re: Crashes in Ogre 1.8.0

Post by 0xC0DEFACE »

Mattan Furst wrote:I might be wrong but I think there is already a mechanism for that. If you create, for instance, a texture manually
(TextureManager::createManual(...)) one of the parameter is a pointer to an Ogre::ManualResourceLoader class. I think that using this class the D3D9 render system re-loads the texture in a device loss event.
This is precisely correct. I am using this method to reload some cube maps and render textures. And you are also correct in that it is called when the device is reset. However it doesnt get called when you change monitors as that is not a device reset, which is part the reason why my scene in the first post looked dull; environment and ambient maps had not been regenerated.

Also sorry I haven't been more active in following this up. After I got a workaround working I had to move onto some other things at work. I still intend on coming back to revisit this soon though.
User avatar
icaro56
Greenskin
Posts: 105
Joined: Sun Feb 15, 2009 2:03 am
Location: Belo Horizonte, MG, BRA
x 1

Re: Crashes in Ogre 1.8.0

Post by icaro56 »

Ícaro Motta