#if TARGET_HOST_MS_WINDOWS
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam );
-GLboolean fgNewWGLCreateContext( SFG_Window* window );
+void fgNewWGLCreateContext( SFG_Window* window );
GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
unsigned char layer_type );
#endif
#endif
-GLboolean fgNewWGLCreateContext( SFG_Window* window )
+void fgNewWGLCreateContext( SFG_Window* window )
{
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetEntensionsStringARB;
+ HGLRC context;
+ int attribs[7];
+ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
if( (fgState.ContextFlags & GLUT_FORWARD_COMPATIBLE) &&
(fgState.MajorVersion > 2) )
{
- return GL_TRUE;
+ return;
}
wglMakeCurrent( window->Window.Device,
wglGetEntensionsStringARB=(PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
if ( wglGetEntensionsStringARB == NULL )
{
- return GL_TRUE;
+ return;
}
const char * pWglExtString=wglGetEntensionsStringARB(window->Window.Device);
- if ( pWglExtString == NULL )
- {
- return GL_TRUE;
- }
-
- if ( strstr(pWglExtString, "WGL_ARB_create_context") == NULL )
+ if (( pWglExtString == NULL ) || ( strstr(pWglExtString, "WGL_ARB_create_context") == NULL ))
{
- return GL_TRUE;
+ return;
}
/* new context creation */
- HGLRC context;
- int attribs[7];
- PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
-
attribs[0] = WGL_CONTEXT_MAJOR_VERSION_ARB;
attribs[1] = fgState.MajorVersion;
attribs[2] = WGL_CONTEXT_MINOR_VERSION_ARB;
fgError( "Unable to create OpenGL %d.%d context (flags %x)",
fgState.MajorVersion, fgState.MinorVersion, fgState.ContextFlags );
}
- else
- {
- fgWarning( "Success 3.0" );
- wglMakeCurrent( NULL, NULL );
- wglDeleteContext( window->Window.Context );
- window->Window.Context = context;
- }
- return GL_TRUE;
+ wglMakeCurrent( NULL, NULL );
+ wglDeleteContext( window->Window.Context );
+ window->Window.Context = context;
}