Maximizing the display in code?
jmasterx

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?

Thanks

Elias

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.

jmasterx

On Windows:

SendMessage(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);

for isMaximized:
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:
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html

Trent Gamblin

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.

Thread #610083. Printed from Allegro.cc