Skip to content

Commit

Permalink
First shot at adding the idTech4 extentions.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #4551.
  • Loading branch information
icculus committed Mar 22, 2019
1 parent a3c1356 commit 4e78a06
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/SDL12_compat.c
Expand Up @@ -4115,5 +4115,22 @@ SDL_OpenAudio(SDL_AudioSpec *want, SDL_AudioSpec *obtained)
}


/* SDL_GL_DisableContext and SDL_GL_EnableContext_Thread are not real SDL 1.2
APIs, but some idTech4 games shipped with a custom SDL 1.2 build that added
these functions, to let them make a GL context current on a background thread,
so we supply them as well to be binary compatible for those games. */

DECLSPEC void SDLCALL
SDL_GL_DisableContext(void)
{
SDL20_GL_MakeCurrent(NULL, NULL);
}

DECLSPEC void SDLCALL
SDL_GL_EnableContext_Thread(void)
{
const SDL_bool enable = (VideoGLContext20 && VideoWindow20);
SDL20_GL_MakeCurrent(enable ? VideoWindow20 : NULL, enable ? VideoGLContext20 : NULL);
}

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 4e78a06

Please sign in to comment.