static pRegisterTouchWindow fghRegisterTouchWindow = (pRegisterTouchWindow)0xDEADBEEF;
#endif
-/*
- * Helper functions for getting client area from the window rect
- * and the window rect from the client area given the style of the window
- * (or a valid window pointer from which the style can be queried).
- */
-extern void fghGetBorderWidth(const DWORD windowStyle, int* xBorderWidth, int* yBorderWidth);
-
/*
* Setup the pixel format for a Win32 window
static void fghFillContextAttributes( int *attributes ) {
int where = 0, contextFlags, contextProfile;
- if ( !fghIsLegacyContextVersionRequested() ) {
- ATTRIB_VAL( WGL_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion );
- ATTRIB_VAL( WGL_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion );
- }
+ ATTRIB_VAL( WGL_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion );
+ ATTRIB_VAL( WGL_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion );
contextFlags =
fghMapBit( fgState.ContextFlags, GLUT_DEBUG, WGL_CONTEXT_DEBUG_BIT_ARB ) |
}
+/* Returns the width of the window borders based on the window's style.
+*/
+void fghGetBorderWidth(const DWORD windowStyle, int* xBorderWidth, int* yBorderWidth)
+{
+ if (windowStyle & WS_THICKFRAME)
+ {
+ *xBorderWidth = GetSystemMetrics(SM_CXSIZEFRAME);
+ *yBorderWidth = GetSystemMetrics(SM_CYSIZEFRAME);
+ }
+ else if (windowStyle & WS_DLGFRAME)
+ {
+ *xBorderWidth = GetSystemMetrics(SM_CXFIXEDFRAME);
+ *yBorderWidth = GetSystemMetrics(SM_CYFIXEDFRAME);
+ }
+ else
+ {
+ *xBorderWidth = 0;
+ *yBorderWidth = 0;
+ }
+}
+
+
/* Computes position of corners of window Rect (outer position including
* decorations) based on the provided client rect and based on the style
/* If window has title bar, correct rect for it */
if (windowStyle & WS_MAXIMIZEBOX) /* Need to query for WS_MAXIMIZEBOX to see if we have a title bar, the WS_CAPTION query is also true for a WS_DLGFRAME only... */
+ {
if (posIsOutside)
clientRect->bottom += GetSystemMetrics( SM_CYCAPTION );
else
clientRect->top -= GetSystemMetrics( SM_CYCAPTION );
+ }
/* get width of window's borders (frame), correct rect for it.
* Note, borders can be of zero width if style does not specify borders
/* If window has title bar, correct rect for it */
if (windowStyle & WS_MAXIMIZEBOX) /* Need to query for WS_MAXIMIZEBOX to see if we have a title bar, the WS_CAPTION query is also true for a WS_DLGFRAME only... */
+ {
if (wantPosOutside)
windowRect->bottom -= GetSystemMetrics( SM_CYCAPTION );
else
windowRect->top += GetSystemMetrics( SM_CYCAPTION );
+ }
/* get width of window's borders (frame), correct rect for it.
* Note, borders can be of zero width if style does not specify borders
return windowRect;
}
-/* Returns the width of the window borders based on the window's style.
- */
-void fghGetBorderWidth(const DWORD windowStyle, int* xBorderWidth, int* yBorderWidth)
-{
- if (windowStyle & WS_THICKFRAME)
- {
- *xBorderWidth = GetSystemMetrics(SM_CXSIZEFRAME);
- *yBorderWidth = GetSystemMetrics(SM_CYSIZEFRAME);
- }
- else if (windowStyle & WS_DLGFRAME)
- {
- *xBorderWidth = GetSystemMetrics(SM_CXFIXEDFRAME);
- *yBorderWidth = GetSystemMetrics(SM_CYFIXEDFRAME);
- }
- else
- {
- *xBorderWidth = 0;
- *yBorderWidth = 0;
- }
-}
-
#if(WINVER >= 0x500)
typedef struct
{
UpdateWindow( window->Window.Handle );
ShowCursor( TRUE ); /* XXX Old comments say "hide cursor"! */
-
}
/*
* Set the current window's iconified title
+ * There really isn't a way to set the icon name separate from the
+ * windows name in Win32, so, just set the windows name.
*/
void fgPlatformGlutSetIconTitle( const char* title )
{