# [SOLVED] Using DirectX with QT / Win32 API...

## Recommended Posts

Hey all, I'm trying to build a very simplistic world editor, to integrate into a 3d engine of mine. Its more a proof of concept thing, but the faster i can build it the better. The first stumbling block iv hit though is actually integrating DirectX (or even OpenGL) with another application, so that the area i render to doesnt cover the whole window. I want to be able to use other controls (either win32 or QT, doesnt really matter) to save/load/import models and whatnot - so that i dont need to actually code up a GUI myself. I've been googling around for some time but still havent come across much of an answer. Im sure its fairly straight forward at least. Most of my tool development is in C#, so im quite happy to use that with DX for this little editor. I made a little paint drawing to show what i meant, but my webhost has just died on me. Thus, i will try to explain with some of the best ascii art ever.
**********************************************
* Menu here                                  *
**********************************************
*            *                               *
*            *                               *
*            *                               *
*            *          DirectX drawing      *
*  Windows   *              goes here        *
*  Controls  *                               *
*    here    *                               *
*            *                               *
*            *                               *
*            *                               *
*            *                               *
*            *                               *
**********************************************

[Edited by - Tesl on March 4, 2006 7:10:46 AM]

##### Share on other sites
I actually asked a similar question a while back and here is what was recommended to me: use standard windows controls and when you create your D3D device, whatever control you want to use to render D3D to (a frame control was recommended), pass the control's handle (ie. controlName.Handle) instead of this. This way you don't have to deal with all those child windows. Hope this helps.

-AJ

##### Share on other sites
Hey Tesl,

In case your 3D engine works with his own thread/process, you can use the WM_COPYDATA windows(TM) message to exchange information between your Win32 app and your 3D engine. This is what I did in my project, and I was happily surprised by the result (meaning that it works pretty well and it was simple to implement). I also implemented what u235 suggested, which was providing my Direct3D application with a GUI hWnd.
Cheers
StratBoy61

##### Share on other sites
Thanks guys, i was looking through my code last night and was hoping id be able to do that. Im not really that familiar with win32 programming, and i wasn't sure if a controls handle is effectively the same thing as a parent window handle :)

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Forum Statistics

• Total Topics
627711
• Total Posts
2978753

• 21
• 14
• 12
• 39