[fixed]Crash in CD3D9RenderTarget::generateSurfaces()
Posted: Wed Dec 09, 2015 3:02 pm
The following will crash in d3d9 (works in OpenGL) in current trunk:
I'm not yet too familiar with this part of the engine. Rendertarget textures all become invalid in OnResize (which will reset the d3d device). So maybe has to do with the depthTexture which is automatically created in this case and is now no longer valid? But just guessing so far ...
Code: Select all
#include <irrlicht.h>
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
using namespace irr;
int main(int argc, char** argv)
{
core::dimension2d<u32> dim(800,600);
IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D9, dim);
//IrrlichtDevice *device = createDevice(video::EDT_OPENGL, dim);
video::IVideoDriver* driver = device->getVideoDriver();
irr::video::ITexture * rt = driver->addRenderTargetTexture(dim, "rt", irr::video::ECF_A8R8G8B8);
driver->setRenderTarget(rt, irr::video::ECBF_COLOR|irr::video::ECBF_DEPTH, irr::video::SColor(0,0,0,0));
driver->setRenderTarget((irr::video::ITexture *)nullptr, irr::video::ECBF_COLOR|irr::video::ECBF_DEPTH);
driver->removeTexture(rt);
driver->OnResize(dim);
device->closeDevice();
device->drop();
return 0;
}