Changing between display settings

Started by
3 comments, last by Weston 19 years, 11 months ago
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:
---Will DDR for food.
Advertisement
Check the documentation of SetWindowLong in the MSDN.

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.
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.
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.
---Will DDR for food.

This topic is closed to new replies.

Advertisement