Jump to content

  • Log In with Google      Sign In   
  • Create Account


D3D11 integration with MFC


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 GeneralMeliante   Members   -  Reputation: 149

Like
0Likes
Like

Posted 16 January 2013 - 11:58 AM

Hi everyone!

 

I need to integrate a program in DirectX11 already done with the view window on an MFC application, could you guys help me out somehow?

Some examples any idea how I should tackle this situation because I'm pretty clueless here.

 

I did create the MFC application, I know that the .cpp I should focus is the one ending in view where there are kind of a start function for creating the object and OnDrawn and such but i have no idea how to get my already done program and add it to the MFC application.

 

Anything would help here, a simple example made (I was trying to make this integration with a simple draw the triangle from the D3D SDK), anything really!

 

Thanks very much in advance!


Edited by GeneralMeliante, 16 January 2013 - 11:58 AM.


Sponsor:

#2 Quat   Members   -  Reputation: 402

Like
0Likes
Like

Posted 16 January 2013 - 01:32 PM

Just like in a Win32, your swap chain presents to the window you specify in the OutputWindow member of DXGI_SWAP_CHAIN_DESCDXGI_SWAP_CHAIN_DESC.  So in MFC, you will need to specify the hwnd to the MFC window you want to output to.  If I recall correctly, you will also need to tell MFC not to erase the background of the window you are drawing to (since you are using direct3d for all drawing).  A quick google search shows there are a lot of tutorials on this.


-----Quat

#3 GeneralMeliante   Members   -  Reputation: 149

Like
0Likes
Like

Posted 22 January 2013 - 09:02 AM

Hi, thank you for your response but i actually did an extensive search on google e got nothing really helpful since i`m looking for MFC with D3D11, there is quite a lot on D9 and as i was told it is not adequate to use it.

 

Could you please provide me with any of your tutorials findings?

 

thank you very much!



#4 Jason Z   Crossbones+   -  Reputation: 4720

Like
1Likes
Like

Posted 22 January 2013 - 08:30 PM

You don't have to look any further than the Hieroglyph 3 repository :)  There is a sample program called MFCwithD3D11, and it should show you the basics of how to get it up and running.  If you have any specific questions after checking it out, just post here or shoot me an IM and I'll be happy to help.



#5 GeneralMeliante   Members   -  Reputation: 149

Like
0Likes
Like

Posted 23 January 2013 - 09:12 AM

Hi Jason Z!

 

I actually looked on the Hieroglyph 3 repository and managed to put the MFCwithD3D11 to compile (it needed to be made a solution that really had the .cpp and another configuration necessary) and made it open but it only creates the 3 windows wasn't it suppose to draw a cube in each one of those windows?

 

Thank you very much i did find the examples on the Hieroglyph 3 really interesting but by now i only need to learn how to get my already done D3D11 program go to the view window on MFC.

 

Thanks!



#6 Jason Z   Crossbones+   -  Reputation: 4720

Like
1Likes
Like

Posted 24 January 2013 - 08:58 PM

Sorry about that - I hadn't added it to the solution when I converted over to VS2012...  I'll take a look at the example and get it updated soon.  If I recall correctly I just made a copy of the new project files for VS2012, but that project needs to be set up differently for using MFC.

 

However, you should be able to see how to associate a swap chain with a window handle from the code that is listed there.  This is ultimately no different than normal rendering - you create a swap chain with the target window's HWND as an input.  The way to do this can all be seen in the MFCwithD3D11View class.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS