Page 1 of 1

Irrlicht in a Windows Window! Cant find the HWND!

Posted: Sun Nov 12, 2006 1:53 pm
by Tocs1001
Ok I'm using MFC so most of this is precreated!

Image

I'm trying to get the 3D area where you see white. I tryed going into the App's class and using GetMainWnd (); but it created an entire other window for Irrlicht. I was wondering if anyone knows which function in which MFC class allows me to get the handle to the white area so I can pass it to Irrlicht. The editor is a single document BTW.

Posted: Fri Nov 17, 2006 5:56 pm
by CodeDog
GetClientRect will get you the client area. Make a borderless irrlicht window and use the client area as its position and size. You can update in OnPaint.
You can also look at http://irrlicht.sourceforge.net/tut014.html

Posted: Sat Nov 18, 2006 5:16 am
by drac_gd
easiest way is use a dialog then and a control ( I used a button ).. make it invisible. use class wizard to make a control variable ( say CButton m_Screen for example ) then call m_Screen.GetSafeHwnd() and pass it to irrlicht irr::createDeviceEx in irr::SIrrlichtCreationParameters. As was said in previous post you can call m_Screen.GetClientRect or after irrlicht is created you can call driver->getScreenSize()

Posted: Sat Nov 18, 2006 6:11 am
by TheC
I just did:

HWND IrrWnd = CreateWindowEx("BUTTON"....

then in SCreationParameters (for CreateDeviceEx), I set my hwnd to that.