Using an externaly created direct3d9 device with irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
deamonpog
Posts: 4
Joined: Fri May 04, 2012 5:13 am

Using an externaly created direct3d9 device with irrlicht

Post by deamonpog »

I have a game engine which uses DirectX 9.
I want to draw some new things on that same screen(of that game engine), using IrrLicht.
I have the handle to IDirect3DDevice9.

is there any way to do this?
i have only few days left... :(

Thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Using an externaly created direct3d9 device with irrlich

Post by hybrid »

Yes, the beginScene method takes a parameter where you can pass in external handles for drawing. Note, though, that the state changes which are made by the external program might interfere with those that Irrlicht does.
deamonpog
Posts: 4
Joined: Fri May 04, 2012 5:13 am

Re: Using an externaly created direct3d9 device with irrlich

Post by deamonpog »

thanks for the reply.
can u direct me to the exact API call.. is it the beginScene() of videoDriver?
(yes the other engine gives a time for my function to draw something in each frame)
DJLinux
Posts: 19
Joined: Fri Dec 02, 2011 4:39 am
Location: germany
Contact:

Re: Using an externaly created direct3d9 device with irrlich

Post by DJLinux »

You have to fill the members from the SExposedVideoData struct. ( IDirect3D9 * D3D9, IDirect3DDevice9 * D3DDev9, void * HWnd)
Then call IVideoDriver->beginScene() with it.

DJ.
(Sorry about my bad English)
deamonpog
Posts: 4
Joined: Fri May 04, 2012 5:13 am

Re: Using an externaly created direct3d9 device with irrlich

Post by deamonpog »

hey thanks. I figured that out. but now, How to get the IVideoDriver?

or, am i misunderstanding..
are you telling me to create and use an IrrlichtDevice , and get the IVideoDriver of it with GetVideoDriver call and then call the beginScene() function??
that would be great if its possible(to write to the same window with my other engine and irrlicht with 2 different devices).. :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Using an externaly created direct3d9 device with irrlich

Post by hybrid »

If you do not need the Irrlicht window, you should pass the window handle to the createDeviceEx function. Basically the same pattern, only at startup. BTW: We have example 14, which covers all these modes and ways.
deamonpog
Posts: 4
Joined: Fri May 04, 2012 5:13 am

Re: Using an externaly created direct3d9 device with irrlich

Post by deamonpog »

Hey thank you all.. yah i used CreateDeviceEx.. passed my HWND and Created a new Direct3d Device .. works fine.. im drawing on another game.. 2 directx devices rendered on the same window.. actualy what i am doing is a custom HUD like thing for the game.. :)
thanks again..
cheers..
:D
Post Reply