Jump to content
  • Advertisement
Sign in to follow this  

[solved] output gets "corrupted" when window size changes

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

Edit: Please see my second post, the problem described here is already solved So... I have this app using multiple target windows to render into using D3D9. Of course, I ran into the usual "how to handle resizing windows" problem and found a post saying that I could just create a back buffer with the desktop's size and use viewports afterwards. Since this meant I got around doing a device reset each and every time a window gets resized, I went that route. But, I am confused: My calls to Clear and Present were changed accordingly and work fine. I tested this by clearing only half of the target windows but presenting the full rectangle, resulting in half the windows being the color I cleared to and the other half getting that nice D3D debug flicker. So, I expect that area to be covered and I'm rather certain that that stuff is set up correctly, i.e. I'm not just presenting areas of the backbuffer that don't contain anything. Additionally, my test scene is definitely okay. Before changing to using viewports it rendered fine, which means that the vertex and index buffers were okay, the camera returned correct view and projection matrices etc... I assume this is the same now, as I haven't changed a thing in that regard. The problem now is: I don't see a thing anymore. The D3D debug runtimes don't give any errors and the only warnings I get are redundant render states, so nothing to worry about for now. Do I have to take the D3DVIEWPORT9 into account for the view and projection transform I use in my shaders in any way? I looked in D3D docs and found no further information about the usage of viewports... [Edited by - matches81 on June 19, 2009 8:34:52 AM]

Share this post

Link to post
Share on other sites
Once again, a stupid oversight ruins the day.
I forgot to change the depth stencil buffer's size accordingly. My initial problem is solved, I guess, so I'm renaming the thread, too.

However, I have a new problem.
At startup, I'm back to getting the results I want, i.e. something like this:

But, as soon as I resize the window, this happens:

Sorry, I seem unable to get any kind of image posted :(
This is the exact same problem I had with my previous implementation that created a backbuffer with the size of the client window. It seems that some portions of the window are just not updated. The portions that aren't updated change when changing the window's size and remain constant between size changes.

Any clues?

Edit: Again, stupid oversight. I set the Z-value to clear to in the Clear call, but forgot to add the D3DCLEAR_ZBUFFER flag... Feel free to delete this thread entirely, as it just comes down to being blind due to hours of programming.

[Edited by - matches81 on June 19, 2009 8:13:38 AM]

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!