First shot at adding the idTech4 extentions.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 22 Mar 2019 10:54:17 -0400
changeset 115ea2ce36617d5
parent 114 f4f3bf9e36e1
child 116 911a1e7bf8b7
First shot at adding the idTech4 extentions.

Fixes Bugzilla #4551.
src/SDL12_compat.c
     1.1 --- a/src/SDL12_compat.c	Fri Mar 22 09:43:16 2019 -0400
     1.2 +++ b/src/SDL12_compat.c	Fri Mar 22 10:54:17 2019 -0400
     1.3 @@ -4115,5 +4115,22 @@
     1.4  }
     1.5  
     1.6  
     1.7 +/* SDL_GL_DisableContext and SDL_GL_EnableContext_Thread are not real SDL 1.2
     1.8 +   APIs, but some idTech4 games shipped with a custom SDL 1.2 build that added
     1.9 +   these functions, to let them make a GL context current on a background thread,
    1.10 +   so we supply them as well to be binary compatible for those games. */
    1.11 +
    1.12 +DECLSPEC void SDLCALL
    1.13 +SDL_GL_DisableContext(void)
    1.14 +{
    1.15 +    SDL20_GL_MakeCurrent(NULL, NULL);
    1.16 +}
    1.17 +
    1.18 +DECLSPEC void SDLCALL
    1.19 +SDL_GL_EnableContext_Thread(void)
    1.20 +{
    1.21 +    const SDL_bool enable = (VideoGLContext20 && VideoWindow20);
    1.22 +    SDL20_GL_MakeCurrent(enable ? VideoWindow20 : NULL, enable ? VideoGLContext20 : NULL);
    1.23 +}
    1.24  
    1.25  /* vi: set ts=4 sw=4 expandtab: */