Irrlicht in a Windows Window! Cant find the HWND!

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
Tocs1001
Posts: 10
Joined: Tue Jun 27, 2006 7:15 pm

Irrlicht in a Windows Window! Cant find the HWND!

Post 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.
CodeDog
Posts: 106
Joined: Sat Oct 07, 2006 8:00 pm
Location: CA. USA
Contact:

Post 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
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post 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()
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

I just did:

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

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