Page 1 of 1

How to create device in c++ picture box ??

Posted: Mon Dec 11, 2006 11:08 am
by yoes_san
I want to create irrlicht device in a picture box named 'pic_3d'.
But when I try to create, it returns errors:
Error 9 error C2664: 'irr::createDevice' : cannot convert parameter 7 from 'System::IntPtr' to 'irr::IEventReceiver *' d:\irr_demo\clr\min.h 119
Error 18 error C2664: 'irr::createDevice' : cannot convert parameter 7 from 'System::IntPtr' to 'irr::IEventReceiver *' d:\irr_demo\clr\min.h 119
Here's my on_load function, form name is 'min':

Code: Select all

private: System::Void min_Load(System::Object^  sender, System::EventArgs^  e) {
				
				IrrlichtDevice *device = createDevice( video::EDT_SOFTWARE2, dimension2d<s32>(this->pic_3d->Width, this->pic_3d->Height), 16, false, false, false, this->pic_3d->Handle);

			 }
	};
Am I input wrong parameters into the arguments?
Any suggestions?

Posted: Mon Dec 11, 2006 11:16 am
by JP
The final parameter of createDevice should be a pointer to an EventReceiver, not to what ever you're trying to pass in :lol:

Probably you want to look at the Win32 Window tutorial, might be more what you're after.

Posted: Mon Dec 11, 2006 1:39 pm
by Acki
Or have a look at this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17705
I posted there the code to run Irrlicht inside Window's Notepad... ;)
You'll see how it works to create Irrlicht inside another window by usig a handle...

Posted: Mon Dec 11, 2006 1:42 pm
by JP
That's pretty damned cool Acki, just had to try it out! :lol: