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;
}