Maximizing the display in code?
I have run into a small issue. When the user goes from full screen back to windowed or starts the game, I want to set it back to how they had it previously. I can set the window position, and size, but I see no way to change it to a maximized state. The best I can do is set it to a comfortable window size. Is there a way to do this in code or plans to add this in the future?
I'm all for a way to do this. I can probably implement it for X11. My favorite API would be al_set_display_flag(display, ALLEGRO_MAXIMIZED, true/false) to maximize/un-maximize the window and (al_get_display_flags(display) & ALLEGRO_MAXIMIZED) to check whether it is currently maximized.
SendMessage(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
You can use the USER API GetWindowPlacement to obtain the current status of
a given window -- the showCmd field of the returned WINDOWPLACEMENT structure
should be equal to SW_MAXIMIZE (3) if the window is maximized.
It could also be added as a new display flag since it looks cleaner if the window is first shown with the correct state.
On OSX the concept does not seem to exist, best is the zoom button thing:
Thread #610083. Printed from Allegro.cc
Is the zooming thing the same as the new fullscreening ability in Lion? Where windows that support it have a fullscreen button on the right side of the title bar? When you use that the menubar autohides at the top.