Windows within Windows

Started by
2 comments, last by legalize 16 years, 6 months ago
I'd like to do how calagari truspace does, how you can create 4 windows that can be seperately rendered within the running application, all of which are resizable. In my perception, the window that has focus when running the render button, will be rendered only-- does anyone have any tutorial or know some good sample code to get me started for the picture-in-picture windows? An included note: the windows will be viewing the same scene, just different camera angels, top, left, right, perspective. |[ 1 ][ 2 ] |[ 3 ][ 4 ] Thanks in advance for all the help. This application is the start of a world editor for me.
[size="2"][size="1"][size="2"]- Quinn
[size="2"][size="1"][size="2"]Software Developer, Mintrus
Advertisement
You're almost certainly talking about Viewports, give 'em a look in the SDK
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
Thanks. I'll take a look at that. Any other options?

I saw from another thread, I've seen a post where people
are using 'multiple devices' with 'swap chains'? Based on what,
I need to accomplish, is there an adverse difference between
viewports vs swap chaining devices?

Thanks again for any addt'l information.
[size="2"][size="1"][size="2"]- Quinn
[size="2"][size="1"][size="2"]Software Developer, Mintrus
There are several ways to achieve this.

1) Single device, single swap chain. In this method, you have a swap chain render target that is at least as large as the largest window. For each window you render the scene to the appropriately sized viewport on the render target and then do a RECTangle based Present of the rendered area in the render target to the window. All the windows share a single swap chain. One of them can be implicitly associated with the swap chain, but its not necessary since you are using the HWND override in the Present anyway.

2) Single device, multiple swap chains. In this method you have one swap chain per window and you just render each one and Present with no HWND override. The rendering is epsilon easier than 1), but you're burning video memory for all of the swap chains unlike 1).

3) Multiple devices, one per window. This is just plain dumb, don't do this. You don't need multiple devices in this scenario and doing so will just make the gods come down from Mt. Olympus and smite thee. Don't do it.

In Chapter 7. Viewing and Projection in my book I have a sample application that renders multiple views of the same scene.

My free book on Direct3D: "The Direct3D Graphics Pipeline"
My blog on programming, vintage computing, music, politics, etc.: Legalize Adulthood!

This topic is closed to new replies.

Advertisement