I'm working on a project in which the resolution is changed to sort of a "hard-coded" 1280x720. Let's say the previous resolution was 1920x1080. When my program returns to 1920x1080, all the windows will be re-sized smaller, which will be very annoying to the user of the program. I'm using DirectDraw for "nostalgia" on this one (and realize there are newer Dx versions which make the return to Windows much more automatic).
Is there a "trick" as far as the ordering of the shutdown calls to make the return to the original display mode less disruptive, or some Windows message I can work with?
Thank you
changing the display resolution is really not a desirable action :P
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144196%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/cc144196%28v=vs.85%29.aspx)
I'm not quite sure what you're getting at in your question, but...
IDirectDraw7::SetDisplayMode()
HRESULT SetDisplayMode(DWORD dwWidth
DWORD dwHeight,
DWORD dwBPP, // bits per pixel
DWORD dwRefreshRate,
DWORD dwFlags);
Maybe try calling/invoking it somewhere before releasing your interface?
Better: IDirectDraw7::RestoreDisplayMode method (http://msdn.microsoft.com/en-us/library/windows/desktop/gg426154%28v=vs.85%29.aspx)
AnDino:
Thank you. There is RestoreDisplayMode for that. MS recommends against trying to restore the old mode yourself with SetDisplayMode.
Dave:
Thanks. You gave me an idea how to tackle this. In the beginning I had it in the user's resolution, which worked but had stretching issues, so I tried changing the resolution, which works but has the window-resizing problem (if the window is maximized). I think I might have a way around it now. It has to be exact pixels, so no stretching or shrinking. It's in how I'm doing the blits (they should have a bounding rectangle that is NOT the size of the display)
right - best to let the user decide some things, and your code should adapt to their world - lol
it's not always practical
what you might do is display a message that says, "best if xxx minimum resolution is used"