Rendering new viewports using render contexts
Render contexts are in essence wrappers for native window handles. On Windows, this allows you to specify a HWND, and then have the renderer draw directly to it.
The very nature of render contexts is platform-specific, and is, therefore, not guaranteed to work the same from one rendering module (such as, D3D) to another (such as, OpenGL).
Note
Note: Render contexts are currently only supported while running in Editor mode on Windows, which is used for rendering viewports in tool windows.
In order to create a new context with your window handle, call IRenderer::CreateContext
.
Note
Note that contexts are automatically enabled on creation; call IRenderer::MakeMainContextActive
to re-enable the main view.
Rendering
When rendering a context, the first thing you need to do is activate it. This can be done by using IRenderer::SetCurrentContext
. Once enabled, the renderer is aware of the window that it should be passing to DirectX.
The next thing you need to...