Archived

This topic is now archived and is closed to further replies.

DarkScythe

MFC D3D Woes...

Recommended Posts

Hi! I was wondering if anyone could help me? I am attempting to create a D3D level editor using MFC. The only problem I''ve encountered is that D3D resizes itself to take up the whole screen and I cannot seem to fix it! Here''s what I mean: The first screenshot shows the MFC app not using D3D, the second shows the exact MFC app except with D3D enabled! Here''s the splitter code I used: -------------------------------------------------------- if ( !d3dtoolsSplitter.CreateStatic( this, 1, 2 ) ) return FALSE; if ( !d3dtoolsSplitter.CreateView( 0, 0, RUNTIME_CLASS(CToolsPanel), CSize( TOOLPANEL_SIZE, cr.Height() ), pContext ) ) return FALSE; if ( !d3dtoolsSplitter.CreateView( 0, 1, RUNTIME_CLASS(CD3DEngineApp), CSize( cr.Width() - TOOLPANEL_SIZE, cr.Height() ), pContext ) ) return FALSE; -------------------------------------------------------- My D3D params are: d3dpp.Windowed = TRUE; d3dpp.BackBufferFormat = d3ddm.Format; The window handle passed to D3D is AfxGetMainWnd()->m_hWnd.. maybe that''s the problem? But what would I use to just isolate the second part of the splitter and make D3D only draw there?? Thanks for any help you can offer whatsoever..

Share this post


Link to post
Share on other sites
In a Splitter Window, only the Views are splitted, the Window is always the entire Application Window. If you pass CView::GetSafeHwnd() to the Direct3d initialize, you can attach the device to the view you want to.
To access the second view (if you want to) you must set up a second Render chain. (Dont know the D3DX Interface, but there is one)

Share this post


Link to post
Share on other sites