Render to multiple windows

Started by
1 comment, last by cruZ 22 years, 6 months ago
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?
Advertisement
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.
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.

This topic is closed to new replies.

Advertisement