From 229e718d66fd7083a76c5d1aa883fa717887cfbf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 8 Aug 2003 20:09:15 +0000 Subject: [PATCH] *** empty log message *** --- src/video/wincommon/SDL_wingl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video/wincommon/SDL_wingl.c b/src/video/wincommon/SDL_wingl.c index a09445487..b774b833a 100644 --- a/src/video/wincommon/SDL_wingl.c +++ b/src/video/wincommon/SDL_wingl.c @@ -87,7 +87,7 @@ static int Init_WGL_ARB_extensions(_THIS) int pformat; const char * (WINAPI *wglGetExtensionsStringARB)(HDC) = 0; - hwnd = CreateWindow(NULL, "PFormat", WS_POPUP | WS_DISABLED, + hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED, 0, 0, 10, 10, NULL, NULL, SDL_Instance,NULL); hdc = GetDC(hwnd); @@ -96,7 +96,9 @@ static int Init_WGL_ARB_extensions(_THIS) SetPixelFormat(hdc, pformat, &GL_pfd); hglrc = this->gl_data->wglCreateContext(hdc); - this->gl_data->wglMakeCurrent(hdc, hglrc); + if ( hglrc ) { + this->gl_data->wglMakeCurrent(hdc, hglrc); + } wglGetExtensionsStringARB = (const char * (WINAPI *)(HDC)) this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB"); @@ -118,8 +120,10 @@ static int Init_WGL_ARB_extensions(_THIS) this->gl_data->wgl_arb_pixel_format = 0; } - this->gl_data->wglMakeCurrent(NULL, NULL); - this->gl_data->wglDeleteContext(hglrc); + if ( hglrc ) { + this->gl_data->wglMakeCurrent(NULL, NULL); + this->gl_data->wglDeleteContext(hglrc); + } ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); }