Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

Windowed Mode Viewport Looks very weird

This topic is 4898 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 am setting a viewport in Dx9 using the coords of the window and its width and height. Simply switching back to fullscreen mode and everything looks great. This is a screenshot of how messed up in all looks. It seems as if DX renders a blurred version of my desktop onto the window.

Share this post


Link to post
Share on other sites
Advertisement
You're seeing corrupted video memory there. This tends to happen as an "optimization" by the drivers/runtime. It's re-using old memory without clearing it - if you release/delete resources there's no reason why it should actually clear out the contents (thus you see "echo's" of previous data).

I'll be reckoning that if you enable debug runtimes, you'll get an alternating pink/green display?

Based on your description it's a little difficult to offer an explanation as it could be a large number of things.

Check that your coordinates are correct for the given window, make sure you're calling IDirect3DDevice9::Clear( ) and that any/all resources are still valid before rendering.

hth
Jack

Share this post


Link to post
Share on other sites
I am definetly calling clear every frame and everything is definetly stable.
I know it all works it has all been working quite well and I've always been using debug mode except when I switch it off to play games.

So with your idea I switched it on and checked for a colored screen. My program is now erroring at the weirdest location, completly unrelated. If I stop setting the viewport then it works like normal again.


Are you suppose to set viewports for windowed mode?

Not to mention if I start my engine in fullscreen mode it works excellent, retail and debug mode, no errors at all.

It is only windowed mode with the viewport which cause's the problem.

Share this post


Link to post
Share on other sites
Okay!
I have gotten somewhere.

I made the viewport super small, only 50x50.
It works, the corner of the window shows a proper 50x50 where the rest of the window is a messed up version of the corner.

Now if I make it the right size...errors.

Share this post


Link to post
Share on other sites
....GetWindowRect()...there is the error.
I need to use GetClientRect() obviously...

Well thanks for the assistance, I managed to get it all worked out...
Stupid mistake.

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!