smgr->drawAll() problem

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
sebi707
Posts: 18
Joined: Tue Feb 20, 2007 4:19 pm

smgr->drawAll() problem

Post by sebi707 »

hi i want to use irrlicht in a mfc project and i already got it working but now i want to use a SDI instead of a MDI. i created a new SDI project and added all my code but there goes something wrong in my render thead! heres my render thread:

Code: Select all

//starting engine
	irr::SIrrlichtCreationParameters param;
	param.DriverType = video::EDT_DIRECT3D9;
	param.WindowId = reinterpret_cast<s32>( Win1 );
	irr::IrrlichtDevice* device = irr::createDeviceEx( param);

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();

	scene::ICameraSceneNode* cam =smgr->addCameraSceneNode();
	cam->setTarget(core::vector3df(0,0,0));

	smgr->addSkyBoxSceneNode(
	driver->getTexture("../../media/irrlicht2_up.jpg"),
	driver->getTexture("../../media/irrlicht2_dn.jpg"),
	driver->getTexture("../../media/irrlicht2_lf.jpg"),
	driver->getTexture("../../media/irrlicht2_rt.jpg"),
	driver->getTexture("../../media/irrlicht2_ft.jpg"),
	driver->getTexture("../../media/irrlicht2_bk.jpg"));

	while(device->run() && continue_render)
	{
		driver->beginScene(true, true, 0);
		smgr->drawAll();
		driver->endScene();
	}

	device->drop();

	return 0;

but if i compile the code above and run the programm i get this error (hopefully correct translated):

Unhandled exception at: c100688ea in GMF-Edit.exe: 0xC0000005: access violation while writing on position 0x00000000
sebi707
Posts: 18
Joined: Tue Feb 20, 2007 4:19 pm

Post by sebi707 »

ok i get it :oops:
the first MDI version worked with irrlich 1.3 and the SDI with 1.3.1 and now in 1.3.1 the param.WindowId is a void* and not s32
Post Reply