Page 1 of 1

HWND

Posted: Fri Feb 19, 2010 11:08 am
by dehseth
how can I get HWND of my directX window?

Posted: Fri Feb 19, 2010 11:35 am
by hybrid
Please read the API docs. There's a ExposedVideoData structure you can access.

Posted: Fri Feb 19, 2010 11:50 am
by dehseth
ok thanks...

Code: Select all

video::SExposedVideoData* evd = g_driver->getExposedVideoData();
	
	HWND hwnd = reinterpret_cast<HWND>(evd->D3D9.HWnd);
so seems like I need to know which api (Dx8, Dx9, opengl) I am using right?

Posted: Fri Feb 19, 2010 12:12 pm
by Sylence
Yes, but there is the IVideoDriver::getDriverType() method that will tell you what driver type you are using...

Posted: Fri Feb 19, 2010 12:16 pm
by hybrid
You need to know the driver type anyway, because the code using this handle is driver dependant. However, all Window handles are located at the same place, so there's not much difference when just using this one handle.

Posted: Fri Feb 19, 2010 12:33 pm
by dehseth
I wonder are you planing to implement DX10, 11 etc? I guess people are going to start using windows 7 in next year.

Posted: Fri Feb 19, 2010 1:44 pm
by vins
I'm using Windows 7 and Irrlicht works fine.

Posted: Fri Feb 19, 2010 2:34 pm
by dehseth
no I mean it uses DX9 interface.. what about DX10, DX11 implmentation..

Posted: Fri Feb 19, 2010 4:50 pm
by hybrid
I doubt that you need it, but anyway: Which feature of DX11 do you need?

Posted: Fri Feb 19, 2010 7:35 pm
by dehseth
I haven't used vista/win 7 yet and I only work with dx9. So there's no specific function(s) I need right now. I just wonder will there be any kind of implementation in future?

Posted: Fri Feb 19, 2010 9:01 pm
by hybrid
If you want, you can simply output DX10 on startup. Since you don't need a special feature, it will just be the same.

Posted: Fri Mar 05, 2010 10:00 am
by tinhtoitrangtay

Code: Select all

video::SExposedVideoData* evd = g_driver->getExposedVideoData();
   
   HWND hwnd = reinterpret_cast<HWND>(evd->D3D9.HWnd);
It don't work. You maybe upload a example. Thanks

Posted: Mon Mar 08, 2010 3:15 pm
by slavik262
tinhtoitrangtay wrote:

Code: Select all

video::SExposedVideoData* evd = g_driver->getExposedVideoData();
   
   HWND hwnd = reinterpret_cast<HWND>(evd->D3D9.HWnd);
It don't work. You maybe upload a example. Thanks
That's not going to get you much help. Could you post more of the code so we can see what's "not working"? It's likely that the problem lies somewhere else. I've used getExposedVideoData() for several programs and everything works fine.