+
+/*
+ * Toggle full screen mode. Thanks to cwis@nerim.fr for the
+ * implementation.
+ */
+static void flip_full_screen(void)
+{
+ if (!full_screen) {
+ int cx, cy;
+
+ cx = GetSystemMetrics(SM_CXSCREEN);
+ cy = GetSystemMetrics(SM_CYSCREEN);
+ GetWindowPlacement(hwnd, &old_wind_placement);
+ old_wind_style = GetWindowLong(hwnd, GWL_STYLE);
+ SetWindowLong(hwnd, GWL_STYLE,
+ old_wind_style & ~(WS_CAPTION | WS_BORDER | WS_THICKFRAME));
+ SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW);
+ full_screen = 1;
+ } else {
+ SetWindowLong(hwnd, GWL_STYLE, old_wind_style);
+ SetWindowPlacement(hwnd,&old_wind_placement);
+ full_screen = 0;
+ }
+}