Try restoring a lost device for 4 instead of 3 seconds. Better error messages for failed CreateTexture calls.

(time of restoring device is try&error really, with 3 seconds it seemed to work sometimes, but still failed in some cases, so just increasing it slightly to see if helps).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5649 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2018-10-19 13:39:20 +00:00
parent 8518f3bd2c
commit 243c124d85
2 changed files with 15 additions and 2 deletions

View File

@ -3063,7 +3063,7 @@ void CD3D9Driver::OnResize(const core::dimension2d<u32>& size)
if ( !reset() )
{
if ( !retrieveDevice(30, 100) ) // retrying for 3 seconds, I hope that's long enough?
if ( !retrieveDevice(20, 200) ) // retrying for 3 seconds, I hope that's long enough?
{
os::Printer::log("Failed to retrieve device in OnResize.", ELL_ERROR);
}

View File

@ -104,7 +104,20 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
}
else
{
os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING);
switch (hr )
{
case D3DERR_INVALIDCALL:
os::Printer::log("Could not create DIRECT3D9 Texture. D3DERR_INVALIDCALL", ELL_WARNING);
break;
case D3DERR_OUTOFVIDEOMEMORY:
os::Printer::log("Could not create DIRECT3D9 Texture. D3DERR_OUTOFVIDEOMEMORY", ELL_WARNING);
break;
case E_OUTOFMEMORY:
os::Printer::log("Could not create DIRECT3D9 Texture. E_OUTOFMEMORY", ELL_WARNING);
break;
default:
os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING);
}
}
if (releaseImageData)