Sign in to follow this  

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

This topic is 4303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Hi there, I like your ascii art, it's very concise. From what I'm understanding of your question, why not just Create one main window, and then create a bunch of child windows to solve your problem. Have one child window be the QT/win2API gui that does your model loading/unloading, have another child window as your QT/win32API menu, and finally have another child window be the window that directx has control over. You dont have to give directx your main window's Device Context(DC), you can give directx any windows DC.

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

This topic is 4303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this