Jump to content
  • Advertisement
Sign in to follow this  
kosmon_x

Problem when switching from fullscreen to windowed

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

When I reset my device from fullscreen to windowed mode, it seems as though the clipping region is not set properly. The backbuffer fills the entire window, including the title bar. However, when I minimize and then maximize the window, the backbuffer seems to become clipped properly and resizes itself so that it no longer draws over the title bar. Anyone know how I can force the backbuffer to fit properly in the window without doing the minimize/maximize?

Share this post


Link to post
Share on other sites
Advertisement
Try calling MoveWindow() after you switch to windowed mode. I had a lot of trouble with the same problem. There's a trick to getting it to work properly, but I can't remember what it was.

Share this post


Link to post
Share on other sites
Thanks, the MoveWindow() trick works :) But, I'd really like to know why it works (ie, what exactly is going on behind the scenes).

I've tried to invalidate the window by calling RedrawWindow() with various parameters to force a WM_NCPAINT call, but it doesnt seem to help.

Anyone know why MoveWindow() and minimize/maximize work, and what the problem is here?

[Edited by - kosmon_x on May 31, 2005 3:09:54 AM]

Share this post


Link to post
Share on other sites
I beleive it's a problem with Direct3D, or the communication between Direct3D and windows components. Direct3D seems to be calculating the size of your window before it realizes the window has a title bar and borders.

Since you are switching to window mode from full-screen, there's no harm in setting the position of the window after the fact. But I would also be interested in knowing why it needs done.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endurion
Are you re-applying the border and caption styles before you reset the device for windowed mode?

I'm not sure I follow you. Why would you need to mess with the window styles? You can enter fullscreen mode with captioned windows.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endurion
Yes, but your mouse will change if the cursor is on the border or the caption, allowing you to even move the window.

Is this true? When I switch to fullscreen in my application, the captions and borders are gone. I don't use a hardware cursor within fullscreen, but I've never had any problem like this.

Well, in any case, I guess that's not the problem. I don't even remove the title bar in my engine. I doubt MoveWindow() would put it back on if I did.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endurion
Yes, but your mouse will change if the cursor is on the border or the caption, allowing you to even move the window.


Ah I just noticed that. That is a problem...
How do I get rid of the caption style before I switch into fullscreen and reapply it when I get out? Anyone know what the win32 call is?

Share this post


Link to post
Share on other sites
I don't think you can modify it:
Quote:

The following styles can be specified wherever a window style is required.
After the control has been created, these styles cannot be modified, except as noted.

...
WS_CAPTION - Creates a window that has a title bar (includes the WS_BORDER style).
...


I don't see any note, do you? But it's hard to be sure with MS.

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!