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:
parent
af57171b72
commit
8c71219642
4 changed files with 47 additions and 25 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue