The gl_data is optional for the driver, so don't early out of the context delete call if it doesn't exist.

This commit is contained in:
Sam Lantinga 2012-09-30 01:08:48 -07:00
parent af57171b72
commit 8c71219642
4 changed files with 47 additions and 25 deletions

View file

@ -613,6 +613,11 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
HDC hdc;
int status;
if (!_this->gl_data) {
SDL_SetError("OpenGL not initialized");
return -1;
}
if (window) {
hdc = ((SDL_WindowData *) window->driverdata)->hdc;
} else {
@ -666,6 +671,9 @@ WIN_GL_SwapWindow(_THIS, SDL_Window * window)
void
WIN_GL_DeleteContext(_THIS, SDL_GLContext context)
{
if (!_this->gl_data) {
return;
}
_this->gl_data->wglDeleteContext((HGLRC) context);
}