Archived

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

Render to multiple windows

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

After I''ve completed my experimental engine I''m forced to write some basic editor. I wonder how I could render the same scene to multiple MDI child windows like 3DS Max does. CreateRenderTarget and SetViewport doesn''t let you define any hWnd to render to. Can I use the same d3ddevice for all windows anyway, or must I create a new d3ddevice for each win?

Share this post


Link to post
Share on other sites
I think you can use the same device for all of your windows (unless your windows are on different monitors where you don''t get enough speed if you use one device for all monitors) and you can specify which window to draw in d3dDevice->Present(,,,) arguments. I don''t remember the exact decloration of the function but one of the arguments is a HWND handler to a window.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That''s the simplest way, but if the windows aren''t the same size pixels will get stretched of dropped. The alternative is creating an additional swapchain and z-buffer for every view and set those as the render target in the OnDraw handler. You could also use one window and render the different views to portions of that window with the SetViewport method. Don''t use multiple devices though.

Share this post


Link to post
Share on other sites