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
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

HWND

Post by dehseth »

how can I get HWND of my directX window?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Please read the API docs. There's a ExposedVideoData structure you can access.
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post 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?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Yes, but there is the IVideoDriver::getDriverType() method that will tell you what driver type you are using...
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post 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.
vins
Posts: 51
Joined: Mon Aug 16, 2004 6:14 pm
Location: Sofia, Bulgaria
Contact:

Post by vins »

I'm using Windows 7 and Irrlicht works fine.
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

no I mean it uses DX9 interface.. what about DX10, DX11 implmentation..
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I doubt that you need it, but anyway: Which feature of DX11 do you need?
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post 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?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
tinhtoitrangtay
Posts: 70
Joined: Tue Oct 28, 2008 12:59 pm

Post 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
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post 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.
Post Reply