*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Fri, 08 Aug 2003 20:09:15 +0000
changeset 671338a62f9a528
parent 670 b8679559e432
child 672 5955fa16d4b8
*** empty log message ***
src/video/wincommon/SDL_wingl.c
     1.1 --- a/src/video/wincommon/SDL_wingl.c	Fri Aug 08 18:00:39 2003 +0000
     1.2 +++ b/src/video/wincommon/SDL_wingl.c	Fri Aug 08 20:09:15 2003 +0000
     1.3 @@ -87,7 +87,7 @@
     1.4  	int pformat;
     1.5  	const char * (WINAPI *wglGetExtensionsStringARB)(HDC) = 0;
     1.6  	
     1.7 -	hwnd = CreateWindow(NULL, "PFormat", WS_POPUP | WS_DISABLED,
     1.8 +	hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED,
     1.9  	                    0, 0, 10, 10,
    1.10  	                    NULL, NULL, SDL_Instance,NULL);
    1.11  	hdc = GetDC(hwnd);
    1.12 @@ -96,7 +96,9 @@
    1.13  	SetPixelFormat(hdc, pformat, &GL_pfd);
    1.14  
    1.15  	hglrc = this->gl_data->wglCreateContext(hdc);
    1.16 -	this->gl_data->wglMakeCurrent(hdc, hglrc);
    1.17 +	if ( hglrc ) {
    1.18 +		this->gl_data->wglMakeCurrent(hdc, hglrc);
    1.19 +	}
    1.20  
    1.21  	wglGetExtensionsStringARB = (const char * (WINAPI *)(HDC))
    1.22  		this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
    1.23 @@ -118,8 +120,10 @@
    1.24  		this->gl_data->wgl_arb_pixel_format = 0;
    1.25  	}
    1.26  	
    1.27 -	this->gl_data->wglMakeCurrent(NULL, NULL);
    1.28 -	this->gl_data->wglDeleteContext(hglrc);
    1.29 +	if ( hglrc ) {
    1.30 +		this->gl_data->wglMakeCurrent(NULL, NULL);
    1.31 +		this->gl_data->wglDeleteContext(hglrc);
    1.32 +	}
    1.33  	ReleaseDC(hwnd, hdc);
    1.34  	DestroyWindow(hwnd);
    1.35  }