From 094c263eff25a3f7f9cf806661f89caf01d70026 Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Sun, 18 Mar 2012 05:13:16 +0000 Subject: [PATCH] added a message when new context creation was silently ignored due to wglCreateContextAttribsARB not available, similar as is done for x11 with glxCreateContextAttribsARB git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1189 7f0cb862-5218-0410-a997-914c9d46530a --- src/mswin/fg_state_mswin.c | 4 ++-- src/mswin/fg_window_mswin.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mswin/fg_state_mswin.c b/src/mswin/fg_state_mswin.c index 07ffdb1..d5f4419 100644 --- a/src/mswin/fg_state_mswin.c +++ b/src/mswin/fg_state_mswin.c @@ -140,10 +140,10 @@ int fgPlatformGlutGet ( GLenum eWhat ) return returnValue; case GLUT_WINDOW_BUFFER_SIZE: - returnValue = 1 ; /* ????? */ + returnValue = 1 ; /* TODO????? */ return returnValue; case GLUT_WINDOW_STENCIL_SIZE: - returnValue = 0 ; /* ????? */ + returnValue = 0 ; /* TODO????? */ return returnValue; case GLUT_WINDOW_X: diff --git a/src/mswin/fg_window_mswin.c b/src/mswin/fg_window_mswin.c index 6515063..ae5dad7 100644 --- a/src/mswin/fg_window_mswin.c +++ b/src/mswin/fg_window_mswin.c @@ -163,6 +163,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 +175,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 ); -- 1.7.10.4