Archived

This topic is now archived and is closed to further replies.

Changing between display settings

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

Let''s say I have a full-screen Direct3D application that is a popup style window. I want the program to change to windowed mode when the user presses a key. From what I understand, I''ll need to pass in a D3DPRESENT_PARAMETERS object and reset the device with a call to Reset(). Sounds simple enough when all my resources are managed. So how would I go about changing the window type to an overlapped window? I don''t want to start with an overlapped window when the program begins, since the edges still show up in the full-screen application. --- n00bHaTeR: i got fired today gamer2000: lol! noobHaTeR:

Share this post


Link to post
Share on other sites
From my experience with Direct3D you don''t need to have your window start as a WM_POPUP style window. Direct3D will take care of resizing the window and changing the style for you.

Just create your window with the WS_OVERLAPPEDWINDOW style and when you switch to fullscreen the borders will be gone and Direct3D will be rendering to the whole screen.

When you switch back everything should be back to normal. I think you will need to resize the window though.

Share this post


Link to post
Share on other sites
I don''t have the code with me, but after calling Reset(), you need to call SetWindowLong(hWnd,GWL_STYLE,WS_OVERLAPPEDWINDOW) and then call RedrawWindow(hWnd,RDW_FRAME) to update it.

Share this post


Link to post
Share on other sites
Oh cool, thanks!
I''ve tried starting with an overlapped window a couple times. It creates several problems. I can see the toolbar at the bottom (or parts of it) and also the corners in the top left and right. With a popup, everything seems to be fine though.

One more thing... if the user changes the size of the window, minimizes it, or maximizes it when in windowed mode, are there any special things I need to take care of, such as losing the device again? I plan on checking the device state in my PresentScene() function so if the device is ever lost, it will be reset automatically. I noticed that the computer starts running really slow when I minimize some DirectX applications.

Share this post


Link to post
Share on other sites