Jump to content
  • Advertisement
Sign in to follow this  
giugio

c++ mfc and cdialog

This topic is 3049 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

Hy. I wold create an application mfc with a dialog or a picturebox that display a directx11 scene. Now I have a simple application that create an hwnd of directx11 and a function that draw all the object on the screen with shaders , vertex and indexbuffer. How i can create a simple mfc dialog with mfc controls and an directx11 area that display the scene in the dialog? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hi,

I use mfc with dx9, maybe that can help you somewhat:

I create an mfc app (any kind will do, view/doc, dialog, etc...) and then create an extra cwnd with the parent set to the cwnd of the app window:

screenwnd.CreateEx(parent, x, y, cx, cy);

and then create the dx device with the wnd handle of the created cwnd:

d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, screenwnd.m_hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &d3ddevice );

and then when I do:

d3ddevice->Clear();
d3ddevice->BeginScene();
..Render...
d3ddevice->EndScene();
d3ddevice->Present(&visiblerc, NULL, NULL, NULL);

I see the rendered screen.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!