};\r
\r
/* Window's state description. This structure should be kept portable. */\r
+#if TARGET_HOST_POSIX_X11\r
+typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;\r
+struct tagSFG_PlatformWindowState\r
+{\r
+ int OldWidth; /* Window width from before a resize */\r
+ int OldHeight; /* " height " " " " */\r
+};\r
+#endif\r
+\r
+\r
typedef struct tagSFG_WindowState SFG_WindowState;\r
struct tagSFG_WindowState\r
{\r
/* Note that on Windows, sizes always refer to the client area, thus without the window decorations */\r
int Width; /* Window's width in pixels */\r
int Height; /* The same about the height */\r
-#if TARGET_HOST_POSIX_X11\r
- int OldWidth; /* Window width from before a resize */\r
- int OldHeight; /* " height " " " " */\r
-#elif TARGET_HOST_MS_WINDOWS\r
- RECT OldRect; /* window rect - stored before the window is made fullscreen */\r
- DWORD OldStyle; /* window style - stored before the window is made fullscreen */\r
-#endif\r
+\r
+ SFG_PlatformWindowState pWState; /* Window width/height (X11) or rectangle/style (Windows) from before a resize */\r
\r
GLboolean Redisplay; /* Do we have to redisplay? */\r
GLboolean Visible; /* Is the window visible now */\r
height = event.xconfigure.height;\r
}\r
\r
- if( ( width != window->State.OldWidth ) ||\r
- ( height != window->State.OldHeight ) )\r
+ if( ( width != window->State.pWState.OldWidth ) ||\r
+ ( height != window->State.pWState.OldHeight ) )\r
{\r
SFG_Window *current_window = fgStructure.CurrentWindow;\r
\r
- window->State.OldWidth = width;\r
- window->State.OldHeight = height;\r
+ window->State.pWState.OldWidth = width;\r
+ window->State.pWState.OldHeight = height;\r
if( FETCH_WCB( *window, Reshape ) )\r
INVOKE_WCB( *window, Reshape, ( width, height ) );\r
else\r
{\r
window->Window.pContext.FBConfig = NULL;\r
\r
- window->State.OldHeight = window->State.OldWidth = -1;\r
+ window->State.pWState.OldHeight = window->State.pWState.OldWidth = -1;\r
}\r
#endif\r
\r
/* restore original window size */\r
SFG_Window *win = fgStructure.CurrentWindow;\r
fgStructure.CurrentWindow->State.NeedToResize = GL_TRUE;\r
- fgStructure.CurrentWindow->State.Width = win->State.OldWidth;\r
- fgStructure.CurrentWindow->State.Height = win->State.OldHeight;\r
+ fgStructure.CurrentWindow->State.Width = win->State.pWState.OldWidth;\r
+ fgStructure.CurrentWindow->State.Height = win->State.pWState.OldHeight;\r
\r
} else {\r
/* resize the window to cover the entire screen */\r
};\r
\r
\r
+/* Window's state description. This structure should be kept portable. */\r
+typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;\r
+struct tagSFG_PlatformWindowState\r
+{\r
+ RECT OldRect; /* window rect - stored before the window is made fullscreen */\r
+ DWORD OldStyle; /* window style - stored before the window is made fullscreen */\r
+};\r
+\r
+\r
+\r
/* Joystick-Specific Definitions */\r
#if !defined(_WIN32_WCE)\r
# define _JS_MAX_AXES 8\r
\r
\r
/* store current window rect */\r
- GetWindowRect( win->Window.Handle, &win->State.OldRect );\r
+ GetWindowRect( win->Window.Handle, &win->State.pWState.OldRect );\r
\r
/* store current window style */\r
- win->State.OldStyle = s = GetWindowLong(win->Window.Handle, GWL_STYLE);\r
+ win->State.pWState.OldStyle = s = GetWindowLong(win->Window.Handle, GWL_STYLE);\r
\r
/* remove decorations from style and add popup style*/\r
s &= ~WS_OVERLAPPEDWINDOW;\r
/* For fullscreen mode, find the monitor that is covered the most\r
* by the window and get its rect as the resize target.\r
*/\r
- hMonitor= MonitorFromRect(&win->State.OldRect, MONITOR_DEFAULTTONEAREST);\r
+ hMonitor= MonitorFromRect(&win->State.pWState.OldRect, MONITOR_DEFAULTTONEAREST);\r
mi.cbSize = sizeof(mi);\r
GetMonitorInfo(hMonitor, &mi);\r
rect = mi.rcMonitor;\r
}\r
\r
/* restore style of window before making it fullscreen */\r
- SetWindowLong(win->Window.Handle, GWL_STYLE, win->State.OldStyle);\r
+ SetWindowLong(win->Window.Handle, GWL_STYLE, win->State.pWState.OldStyle);\r
SetWindowPos(win->Window.Handle, HWND_TOP, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);\r
\r
/* Then resize */\r
SetWindowPos(win->Window.Handle,\r
HWND_TOP,\r
- win->State.OldRect.left,\r
- win->State.OldRect.top,\r
- win->State.OldRect.right - win->State.OldRect.left,\r
- win->State.OldRect.bottom - win->State.OldRect.top,\r
+ win->State.pWState.OldRect.left,\r
+ win->State.pWState.OldRect.top,\r
+ win->State.pWState.OldRect.right - win->State.pWState.OldRect.left,\r
+ win->State.pWState.OldRect.bottom - win->State.pWState.OldRect.top,\r
SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING |\r
SWP_NOZORDER\r
);\r