Jump to content
  • Advertisement
Sign in to follow this  
yahastu

Windowed window style

This topic is 3909 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 using:
DWORD windowedStyle = WS_MAXIMIZE | WS_MAXIMIZEBOX  | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE | WS_SIZEBOX ;
DWORD fullscreenStyle = WS_POPUP | WS_VISIBLE;

After creating the window, if I move another window over it, the rendering gets all messed up -- it appears that the back buffer dimensions have changed to something much smaller and inappropriate for the current window size. As soon as I stop dragging the other window, it goes back to looking correct. However, if I resize the window, then this problem goes away: I can move other windows around all I like without the back buffer being messed up. Is this some weird styles issue?

Share this post


Link to post
Share on other sites
Advertisement
Perhaps I haven't been clear enough..

I create a windowed window using the style I showed above (windowedstyle).
Rendering looks fine until another window gains focus, at which point, DirectX does not properly render it anymore -- it looks like th back buffer dimensions suddenly changed or something.

If I resize the window, then changing focus does not cause this problem.

So, it is definitely a DirectX specific problem..

Share this post


Link to post
Share on other sites
This is not directly related to your window styles.

Are you calculating the correct window size from the wanted client area size?

If you use the same size for CreateWindow as you use for the backbuffer size this causes stretching issues.

Use AdjustWindowRectEx as romas said. Pass in the styles you use for CreateWindowEx (both style and extended style flags) and let it calculate the needed window size.

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!