Sign in to follow this  

in dx9, is the size of additional swapchain must be smaller than the size of device back buffer

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

i want to create 3d editor it has multi views like udk.

first i create a device Use CreateDevice API, it fill D3DPRESENT_PARAMETERS.BackBufferWidth/BackBufferHeight with the window size.

for other views, i create some additional swapchains, they are works well when they size is smaller than the device BackBufferWidth/BackBufferHeight.

when i resize the window which use additional swapchain, i will release its swapchain, and recreate it use the new size.

but when the new size greater than the orignal BackBufferWidth/BackBufferHeight, i can't see any thing.

i don't known if the additional swap chain size can't be greater than the BackBufferWidth/BackBufferHeight.

 

Share this post


Link to post
Share on other sites

Shouldn't be so. My bet is that you forget to create suitable depth stencil surfaces for each of your swapchains (and bind them). IIRC a big enough depth is ok, a smaller not.

Any hints from the debug runtime ?

it say nothing. i have set EnableAutoDepthStencil = true when i create Device or CreateAdditionalSwapChain. so i think it already has a depth stencil buffer.

 

blink.png

 

just because of this, i have check all the size of all views, when some view's size greater than the orignal BackBufferWidth/BackBufferHeight, i reset the device use this new Width and height. use API: 

IDirect3DDevice9::Reset 

it works.

 

but i met a new problem again. how to draw a big back buffer to a small window.

for example. 

my window : Width : 800 Height:600

the size of back buffer : 1024 768.

i have call SetViewport with 800, 600, but it display a part of the back buffer on screen.

 

like this:

 

--------------------------------------------------

|                                      ||                      |

|                                      ||                      |

|                                      ||                      |

|                                      ||                      |

|                                      ||                      |

|                                      ||                      |

|===================||                      |

|                                                              |

|                                                              |

--------------------------------------------------

Share this post


Link to post
Share on other sites

i find udk is not reduce the rendertarget size when we reduce the resolution.

[attachment=17033:1.jpg]

 

when i change resolution to 800x600, it already rendering to a 1024x768 backbuffer.

 

this is mine:

 

[attachment=17034:2.jpg]

 

i just draw a simple fullscreen trangle.. but it display full rendertarget on my window even if i set viewport with the small value.(894x590).

all rendering is disable depth/ cull.

Share this post


Link to post
Share on other sites

This topic is 1601 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this