Sign in to follow this  
Halsafar

Windowed Mode Viewport Looks very weird

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
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

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