X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_window_mswin.c;h=bc6b886826c93dcb2f43ad921eba33f14bd67965;hb=f8a0d455b4ec10096337cee040166bd006e63eef;hp=6515063e6c32e00bc3e9ed61ecf5f9da58a2daca;hpb=5b3d339481bac6dbaeb599bffc1325f716585bfe;p=freeglut diff --git a/src/mswin/fg_window_mswin.c b/src/mswin/fg_window_mswin.c index 6515063..bc6b886 100644 --- a/src/mswin/fg_window_mswin.c +++ b/src/mswin/fg_window_mswin.c @@ -113,10 +113,8 @@ static wchar_t* fghWstrFromStr(const char* str) 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 ) | @@ -163,6 +161,9 @@ void fgNewWGLCreateContext( SFG_Window* window ) if ( !fghIsExtensionSupported( window->Window.pContext.Device, "WGL_ARB_create_context" ) ) { + /* wglCreateContextAttribsARB not found, yet the user has requested the new context creation */ + fgWarning( "OpenGL >2.1 context requested but wglCreateContextAttribsARB is not available! Falling back to legacy context creation" ); + /* Legacy context already created at this point in WM_CREATE path of fgPlatformWindowProc, just return */ return; } @@ -172,7 +173,10 @@ void fgNewWGLCreateContext( SFG_Window* window ) wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress( "wglCreateContextAttribsARB" ); if ( wglCreateContextAttribsARB == NULL ) { - fgError( "wglCreateContextAttribsARB not found" ); + /* wglCreateContextAttribsARB not found, yet the user has requested the new context creation */ + fgWarning( "OpenGL >2.1 context requested but wglCreateContextAttribsARB is not available! Falling back to legacy context creation" ); + /* Legacy context already created at this point in WM_CREATE path of fgPlatformWindowProc, just return */ + return; } context = wglCreateContextAttribsARB( window->Window.pContext.Device, 0, attributes ); @@ -390,10 +394,12 @@ void fghComputeWindowRectFromClientArea_UseStyle( const DWORD windowStyle, RECT /* 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 @@ -458,10 +464,12 @@ void fghComputeClientAreaFromWindowRect( const SFG_Window *window, RECT *windowR /* 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