• Advertisement
Sign in to follow this  

Render on multiple windows

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

Hello, I'm going to write a simple editor for my game engine and I've discovered I've not yet implemented any system to do different renderings on multiple surfaces. ( it would be useful in the editor to have 4 panels with 4 different renderings ). I have a simple Renderer class which requires a void* ( simple hwnd ) from the Window class now. How could I develop the possibility to render using different techniques ( e.g. in wireframe in a panel, with shaders in another, etc ) on different surfaces/handles ? I know lots of coders use a RenderTarget class or something similar in their engine, but I never understood in what way it internally works. Thank you :) Please help me :) Goodbye =)

Share this post


Link to post
Share on other sites
Advertisement
Personally I'd probably just have a bunch of different renderers. You could have your wireframe renderer, your normal renderer, and whatever else you need. Each one would be responsible for the rendering contents of a particular window. Then you could just send each one the same scene graph or set of renderable data to chew on.

As for how to handle rendering to multiple windows...that depends on the graphics API you're using.

Share this post


Link to post
Share on other sites
Thanks. Yes, I could use multiple device, but I'm looking for a more elegant way.. I'm don't need an API-specific suggestion, I simply don't know how to structure this feature in my engine/renderer.

Share this post


Link to post
Share on other sites
Quote:
Original post by krautrock
Thanks. Yes, I could use multiple device, but I'm looking for a more elegant way.. I'm don't need an API-specific suggestion, I simply don't know how to structure this feature in my engine/renderer.


No multiple devices isn't necessary at all. All you need is one device that is shared among your different renderers, with a backbuffer that's large enough to accommodate the largest window you're drawing to. Then each renderer can just set the viewport to the size of the window, render to the backbuffer, and then present to that window. Then all you have to do is loop through however many renderers/windows you have active, and tell them all to do their thing.

Share this post


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

  • Advertisement