Remove a lot of OpenGL extension checks.
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Aug 2018 23:17:18 +0000 (23:17 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Aug 2018 23:17:18 +0000 (23:17 +0000)
Rename OpenGL extension functions and defines to core names.

Require the functions for all of the OpenGL3.2 Core Profile functionality - we're not asking for a Core Profile context yet, that will be later.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12453 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
ft2.c
gl_backend.c
gl_rmain.c
gl_textures.c
glquake.h
r_shadow.c
vid_sdl.c
vid_shared.c

index 36eccda..8d427e1 100644 (file)
@@ -2590,10 +2590,9 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        SCR_DrawLoadingScreen_SharedSetup(clear);
        SCR_DrawLoadingScreen(clear);
 #else
-       if (qglDrawBuffer)
-               qglDrawBuffer(GL_BACK);
+       qglDrawBuffer(GL_BACK);
        SCR_DrawLoadingScreen_SharedSetup(clear);
-       if (vid.stereobuffer && qglDrawBuffer)
+       if (vid.stereobuffer)
        {
                qglDrawBuffer(GL_BACK_LEFT);
                SCR_DrawLoadingScreen(clear);
@@ -2602,8 +2601,7 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        }
        else
        {
-               if (qglDrawBuffer)
-                       qglDrawBuffer(GL_BACK);
+               qglDrawBuffer(GL_BACK);
                SCR_DrawLoadingScreen(clear);
        }
 #endif
@@ -2788,11 +2786,8 @@ void CL_UpdateScreen(void)
        SCR_SetUpToDrawConsole();
 
 #ifndef USE_GLES2
-       if (qglDrawBuffer)
-       {
-               CHECKGLERROR
-               qglDrawBuffer(GL_BACK);CHECKGLERROR
-       }
+       CHECKGLERROR
+       qglDrawBuffer(GL_BACK);CHECKGLERROR
 #endif
 
        R_Viewport_InitOrtho(&viewport, &identitymatrix, 0, 0, vid.width, vid.height, 0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100, NULL);
@@ -2859,8 +2854,7 @@ void CL_UpdateScreen(void)
        SCR_CaptureVideo();
 #endif
 
-       if (qglFlush)
-               qglFlush(); // FIXME: should we really be using qglFlush here?
+       qglFlush(); // ensure that the commands are submitted to the GPU before we do other things
 
        if (!vid_activewindow)
                VID_SetMouse(false, false, false);
diff --git a/ft2.c b/ft2.c
index 01823f4..c8d7476 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -1635,7 +1635,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                        }
                        Image_WriteTGABGRA(va(vabuf, sizeof(vabuf), "%s.tga", map_identifier), w, h, data);
 #ifndef USE_GLES2
-                       if (r_font_compress.integer && qglGetCompressedTexImageARB && Draw_IsPicLoaded(map->pic))
+                       if (r_font_compress.integer && Draw_IsPicLoaded(map->pic))
                                R_SaveTextureDDSFile(Draw_GetPicTexture(map->pic), va(vabuf, sizeof(vabuf), "dds/%s.dds", map_identifier), r_texture_dds_save.integer < 2, true);
 #endif
                }
index 68c16fc..670d1b5 100644 (file)
@@ -1058,27 +1058,27 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                if (colortexture4 && colortexture4->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3 , GL_RENDERBUFFER, colortexture4->renderbuffernum);CHECKGLERROR
 
 #ifndef USE_GLES2
-               if (colortexture4 && qglDrawBuffersARB)
+               if (colortexture4)
                {
-                       qglDrawBuffersARB(4, drawbuffers);CHECKGLERROR
+                       qglDrawBuffers(4, drawbuffers);CHECKGLERROR
                        qglReadBuffer(GL_NONE);CHECKGLERROR
                }
-               else if (colortexture3 && qglDrawBuffersARB)
+               else if (colortexture3)
                {
-                       qglDrawBuffersARB(3, drawbuffers);CHECKGLERROR
+                       qglDrawBuffers(3, drawbuffers);CHECKGLERROR
                        qglReadBuffer(GL_NONE);CHECKGLERROR
                }
-               else if (colortexture2 && qglDrawBuffersARB)
+               else if (colortexture2)
                {
-                       qglDrawBuffersARB(2, drawbuffers);CHECKGLERROR
+                       qglDrawBuffers(2, drawbuffers);CHECKGLERROR
                        qglReadBuffer(GL_NONE);CHECKGLERROR
                }
-               else if (colortexture && qglDrawBuffer)
+               else if (colortexture)
                {
                        qglDrawBuffer(GL_COLOR_ATTACHMENT0);CHECKGLERROR
                        qglReadBuffer(GL_COLOR_ATTACHMENT0);CHECKGLERROR
                }
-               else if (qglDrawBuffer)
+               else
                {
                        qglDrawBuffer(GL_NONE);CHECKGLERROR
                        qglReadBuffer(GL_NONE);CHECKGLERROR
@@ -1449,18 +1449,18 @@ void GL_AlphaToCoverage(qboolean state)
                case RENDERPATH_GLES2:
                        break;
                case RENDERPATH_GL32:
-#ifdef GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
+#ifndef USE_GLES2
                        // alpha to coverage turns the alpha value of the pixel into 0%, 25%, 50%, 75% or 100% by masking the multisample fragments accordingly
                        CHECKGLERROR
                        if (gl_state.alphatocoverage)
                        {
-                               qglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);CHECKGLERROR
-//                             qglEnable(GL_MULTISAMPLE_ARB);CHECKGLERROR
+                               qglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);CHECKGLERROR
+//                             qglEnable(GL_MULTISAMPLE);CHECKGLERROR
                        }
                        else
                        {
-                               qglDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);CHECKGLERROR
-//                             qglDisable(GL_MULTISAMPLE_ARB);CHECKGLERROR
+                               qglDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);CHECKGLERROR
+//                             qglDisable(GL_MULTISAMPLE);CHECKGLERROR
                        }
 #endif
                        break;
@@ -2250,7 +2250,7 @@ void GL_BlendEquationSubtract(qboolean negated)
                {
                case RENDERPATH_GL32:
                case RENDERPATH_GLES2:
-                       qglBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT);CHECKGLERROR
+                       qglBlendEquation(GL_FUNC_REVERSE_SUBTRACT);CHECKGLERROR
                        break;
                }
        }
@@ -2260,7 +2260,7 @@ void GL_BlendEquationSubtract(qboolean negated)
                {
                case RENDERPATH_GL32:
                case RENDERPATH_GLES2:
-                       qglBlendEquationEXT(GL_FUNC_ADD);CHECKGLERROR
+                       qglBlendEquation(GL_FUNC_ADD);CHECKGLERROR
                        break;
                }
        }
index 2ea81a8..142c07d 100644 (file)
@@ -2363,9 +2363,9 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
                R_SKINFRAME_LOAD_AVERAGE_COLORS(basepixels_width * basepixels_height, basepixels[4 * pix + comp]);
 #ifndef USE_GLES2
                //Con_Printf("Texture %s has average colors %f %f %f alpha %f\n", name, skinframe->avgcolor[0], skinframe->avgcolor[1], skinframe->avgcolor[2], skinframe->avgcolor[3]);
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->base)
+               if (r_savedds && skinframe->base)
                        R_SaveTextureDDSFile(skinframe->base, va(vabuf, sizeof(vabuf), "dds/%s.dds", skinframe->basename), r_texture_dds_save.integer < 2, skinframe->hasalpha);
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->fog)
+               if (r_savedds && skinframe->fog)
                        R_SaveTextureDDSFile(skinframe->fog, va(vabuf, sizeof(vabuf), "dds/%s_mask.dds", skinframe->basename), r_texture_dds_save.integer < 2, true);
 #endif
        }
@@ -2409,7 +2409,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
                        Mem_Free(pixels);
                }
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->nmap)
+               if (r_savedds && skinframe->nmap)
                        R_SaveTextureDDSFile(skinframe->nmap, va(vabuf, sizeof(vabuf), "dds/%s_norm.dds", skinframe->basename), r_texture_dds_save.integer < 2, true);
 #endif
        }
@@ -2421,7 +2421,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        {
                skinframe->glow = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, textureflags & (gl_texturecompression_glow.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->glow)
+               if (r_savedds && skinframe->glow)
                        R_SaveTextureDDSFile(skinframe->glow, va(vabuf, sizeof(vabuf), "dds/%s_glow.dds", skinframe->basename), r_texture_dds_save.integer < 2, true);
 #endif
                Mem_Free(pixels);pixels = NULL;
@@ -2432,7 +2432,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        {
                skinframe->gloss = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_gloss", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, (TEXF_ALPHA | textureflags) & (gl_texturecompression_gloss.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->gloss)
+               if (r_savedds && skinframe->gloss)
                        R_SaveTextureDDSFile(skinframe->gloss, va(vabuf, sizeof(vabuf), "dds/%s_gloss.dds", skinframe->basename), r_texture_dds_save.integer < 2, true);
 #endif
                Mem_Free(pixels);
@@ -2444,7 +2444,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        {
                skinframe->pants = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_pants", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, textureflags & (gl_texturecompression_color.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->pants)
+               if (r_savedds && skinframe->pants)
                        R_SaveTextureDDSFile(skinframe->pants, va(vabuf, sizeof(vabuf), "dds/%s_pants.dds", skinframe->basename), r_texture_dds_save.integer < 2, false);
 #endif
                Mem_Free(pixels);
@@ -2456,7 +2456,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        {
                skinframe->shirt = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_shirt", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, textureflags & (gl_texturecompression_color.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->shirt)
+               if (r_savedds && skinframe->shirt)
                        R_SaveTextureDDSFile(skinframe->shirt, va(vabuf, sizeof(vabuf), "dds/%s_shirt.dds", skinframe->basename), r_texture_dds_save.integer < 2, false);
 #endif
                Mem_Free(pixels);
@@ -2468,7 +2468,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        {
                skinframe->reflect = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_reflect", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, textureflags & (gl_texturecompression_reflectmask.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
 #ifndef USE_GLES2
-               if (r_savedds && qglGetCompressedTexImageARB && skinframe->reflect)
+               if (r_savedds && skinframe->reflect)
                        R_SaveTextureDDSFile(skinframe->reflect, va(vabuf, sizeof(vabuf), "dds/%s_reflect.dds", skinframe->basename), r_texture_dds_save.integer < 2, true);
 #endif
                Mem_Free(pixels);
@@ -3115,9 +3115,9 @@ static void gl_main_shutdown(void)
        {
        case RENDERPATH_GL32:
        case RENDERPATH_GLES2:
-#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
+#if defined(GL_SAMPLES_PASSED) && !defined(USE_GLES2)
                if (r_maxqueries)
-                       qglDeleteQueriesARB(r_maxqueries, r_queries);
+                       qglDeleteQueries(r_maxqueries, r_queries);
 #endif
                break;
        }
index d5ce367..7503d65 100644 (file)
@@ -79,7 +79,7 @@ static textypeinfo_t textype_depth16                     = {"depth16",
 static textypeinfo_t textype_depth24                     = {"depth24",                  TEXTYPE_DEPTHBUFFER24        ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16              , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
 static textypeinfo_t textype_depth24stencil8             = {"depth24stencil8",          TEXTYPE_DEPTHBUFFER24STENCIL8,  2,  2,  2.0f, GL_DEPTH_COMPONENT16              , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
 static textypeinfo_t textype_colorbuffer                 = {"colorbuffer",              TEXTYPE_COLORBUFFER          ,  2,  2,  2.0f, GL_RGB565                         , GL_RGBA           , GL_UNSIGNED_SHORT_5_6_5};
-static textypeinfo_t textype_colorbuffer16f              = {"colorbuffer16f",           TEXTYPE_COLORBUFFER16F       ,  2,  2,  2.0f, GL_RGBA16F                        , GL_RGBA           , GL_HALF_FLOAT_ARB};
+static textypeinfo_t textype_colorbuffer16f              = {"colorbuffer16f",           TEXTYPE_COLORBUFFER16F       ,  2,  2,  2.0f, GL_RGBA16F                        , GL_RGBA           , GL_HALF_FLOAT};
 static textypeinfo_t textype_colorbuffer32f              = {"colorbuffer32f",           TEXTYPE_COLORBUFFER32F       ,  2,  2,  2.0f, GL_RGBA32F                        , GL_RGBA           , GL_FLOAT};
 
 // image formats:
@@ -95,16 +95,16 @@ static textypeinfo_t textype_etc1                        = {"etc1",
 #endif
 #else
 // framebuffer texture formats
-static textypeinfo_t textype_shadowmap16_comp            = {"shadowmap16_comp",         TEXTYPE_SHADOWMAP16_COMP     ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
-static textypeinfo_t textype_shadowmap16_raw             = {"shadowmap16_raw",          TEXTYPE_SHADOWMAP16_RAW      ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
-static textypeinfo_t textype_shadowmap24_comp            = {"shadowmap24_comp",         TEXTYPE_SHADOWMAP24_COMP     ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
-static textypeinfo_t textype_shadowmap24_raw             = {"shadowmap24_raw",          TEXTYPE_SHADOWMAP24_RAW      ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
-static textypeinfo_t textype_depth16                     = {"depth16",                  TEXTYPE_DEPTHBUFFER16        ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
-static textypeinfo_t textype_depth24                     = {"depth24",                  TEXTYPE_DEPTHBUFFER24        ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24_ARB          , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
-static textypeinfo_t textype_depth24stencil8             = {"depth24stencil8",          TEXTYPE_DEPTHBUFFER24STENCIL8,  4,  4,  4.0f, GL_DEPTH24_STENCIL8_EXT           , GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT};
-static textypeinfo_t textype_colorbuffer                 = {"colorbuffer",              TEXTYPE_COLORBUFFER          ,  4,  4,  4.0f, GL_RGBA                               , GL_BGRA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_colorbuffer16f              = {"colorbuffer16f",           TEXTYPE_COLORBUFFER16F       ,  8,  8,  8.0f, GL_RGBA16F_ARB                        , GL_RGBA           , GL_HALF_FLOAT_ARB};
-static textypeinfo_t textype_colorbuffer32f              = {"colorbuffer32f",           TEXTYPE_COLORBUFFER32F       , 16, 16, 16.0f, GL_RGBA32F_ARB                        , GL_RGBA           , GL_FLOAT         };
+static textypeinfo_t textype_shadowmap16_comp            = {"shadowmap16_comp",         TEXTYPE_SHADOWMAP16_COMP     ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16              , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
+static textypeinfo_t textype_shadowmap16_raw             = {"shadowmap16_raw",          TEXTYPE_SHADOWMAP16_RAW      ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16              , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
+static textypeinfo_t textype_shadowmap24_comp            = {"shadowmap24_comp",         TEXTYPE_SHADOWMAP24_COMP     ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24              , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
+static textypeinfo_t textype_shadowmap24_raw             = {"shadowmap24_raw",          TEXTYPE_SHADOWMAP24_RAW      ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24              , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
+static textypeinfo_t textype_depth16                     = {"depth16",                  TEXTYPE_DEPTHBUFFER16        ,  2,  2,  2.0f, GL_DEPTH_COMPONENT16              , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
+static textypeinfo_t textype_depth24                     = {"depth24",                  TEXTYPE_DEPTHBUFFER24        ,  4,  4,  4.0f, GL_DEPTH_COMPONENT24              , GL_DEPTH_COMPONENT, GL_UNSIGNED_INT  };
+static textypeinfo_t textype_depth24stencil8             = {"depth24stencil8",          TEXTYPE_DEPTHBUFFER24STENCIL8,  4,  4,  4.0f, GL_DEPTH24_STENCIL8               , GL_DEPTH_STENCIL  , GL_UNSIGNED_INT_24_8};
+static textypeinfo_t textype_colorbuffer                 = {"colorbuffer",              TEXTYPE_COLORBUFFER          ,  4,  4,  4.0f, GL_RGBA                           , GL_BGRA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_colorbuffer16f              = {"colorbuffer16f",           TEXTYPE_COLORBUFFER16F       ,  8,  8,  8.0f, GL_RGBA16F                        , GL_RGBA           , GL_HALF_FLOAT    };
+static textypeinfo_t textype_colorbuffer32f              = {"colorbuffer32f",           TEXTYPE_COLORBUFFER32F       , 16, 16, 16.0f, GL_RGBA32F                        , GL_RGBA           , GL_FLOAT         };
 
 // image formats:
 static textypeinfo_t textype_alpha                       = {"alpha",                    TEXTYPE_ALPHA         ,  1,  4,  4.0f, GL_ALPHA                              , GL_ALPHA          , GL_UNSIGNED_BYTE };
@@ -122,14 +122,14 @@ static textypeinfo_t textype_dxt1                        = {"dxt1",
 static textypeinfo_t textype_dxt1a                       = {"dxt1a",                    TEXTYPE_DXT1A         ,  4,  0,  0.5f, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT      , 0                 , 0                };
 static textypeinfo_t textype_dxt3                        = {"dxt3",                     TEXTYPE_DXT3          ,  4,  0,  1.0f, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT      , 0                 , 0                };
 static textypeinfo_t textype_dxt5                        = {"dxt5",                     TEXTYPE_DXT5          ,  4,  0,  1.0f, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT      , 0                 , 0                };
-static textypeinfo_t textype_sRGB_palette                = {"sRGB_palette",             TEXTYPE_PALETTE       ,  1,  4,  4.0f, GL_SRGB_EXT                           , GL_BGRA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_sRGB_palette_alpha          = {"sRGB_palette_alpha",       TEXTYPE_PALETTE       ,  1,  4,  4.0f, GL_SRGB_ALPHA_EXT                     , GL_BGRA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_sRGB_rgba                   = {"sRGB_rgba",                TEXTYPE_RGBA          ,  4,  4,  4.0f, GL_SRGB_EXT                           , GL_RGBA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_sRGB_rgba_alpha             = {"sRGB_rgba_alpha",          TEXTYPE_RGBA          ,  4,  4,  4.0f, GL_SRGB_ALPHA_EXT                     , GL_RGBA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_palette                = {"sRGB_palette",             TEXTYPE_PALETTE       ,  1,  4,  4.0f, GL_SRGB                               , GL_BGRA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_palette_alpha          = {"sRGB_palette_alpha",       TEXTYPE_PALETTE       ,  1,  4,  4.0f, GL_SRGB_ALPHA                         , GL_BGRA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_rgba                   = {"sRGB_rgba",                TEXTYPE_RGBA          ,  4,  4,  4.0f, GL_SRGB                               , GL_RGBA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_rgba_alpha             = {"sRGB_rgba_alpha",          TEXTYPE_RGBA          ,  4,  4,  4.0f, GL_SRGB_ALPHA                         , GL_RGBA           , GL_UNSIGNED_BYTE };
 static textypeinfo_t textype_sRGB_rgba_compress          = {"sRGB_rgba_compress",       TEXTYPE_RGBA          ,  4,  4,  0.5f, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT      , GL_RGBA           , GL_UNSIGNED_BYTE };
 static textypeinfo_t textype_sRGB_rgba_alpha_compress    = {"sRGB_rgba_alpha_compress", TEXTYPE_RGBA          ,  4,  4,  1.0f, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_sRGB_bgra                   = {"sRGB_bgra",                TEXTYPE_BGRA          ,  4,  4,  4.0f, GL_SRGB_EXT                           , GL_BGRA           , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_sRGB_bgra_alpha             = {"sRGB_bgra_alpha",          TEXTYPE_BGRA          ,  4,  4,  4.0f, GL_SRGB_ALPHA_EXT                     , GL_BGRA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_bgra                   = {"sRGB_bgra",                TEXTYPE_BGRA          ,  4,  4,  4.0f, GL_SRGB                               , GL_BGRA           , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_sRGB_bgra_alpha             = {"sRGB_bgra_alpha",          TEXTYPE_BGRA          ,  4,  4,  4.0f, GL_SRGB_ALPHA                         , GL_BGRA           , GL_UNSIGNED_BYTE };
 static textypeinfo_t textype_sRGB_bgra_compress          = {"sRGB_bgra_compress",       TEXTYPE_BGRA          ,  4,  4,  0.5f, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT      , GL_BGRA           , GL_UNSIGNED_BYTE };
 static textypeinfo_t textype_sRGB_bgra_alpha_compress    = {"sRGB_bgra_alpha_compress", TEXTYPE_BGRA          ,  4,  4,  1.0f, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_BGRA           , GL_UNSIGNED_BYTE };
 static textypeinfo_t textype_sRGB_dxt1                   = {"sRGB_dxt1",                TEXTYPE_DXT1          ,  4,  0,  0.5f, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT      , 0                 , 0                };
@@ -890,18 +890,18 @@ static void GL_SetupTextureParameters(int flags, textype_t textype, int texturet
                qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, gl_filter_mag);CHECKGLERROR
        }
 
-#ifdef GL_TEXTURE_COMPARE_MODE_ARB
+#ifndef USE_GLES2
        switch(textype)
        {
        case TEXTYPE_SHADOWMAP16_COMP:
        case TEXTYPE_SHADOWMAP24_COMP:
-               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);CHECKGLERROR
-               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);CHECKGLERROR
+               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);CHECKGLERROR
+               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);CHECKGLERROR
                break;
        case TEXTYPE_SHADOWMAP16_RAW:
        case TEXTYPE_SHADOWMAP24_RAW:
-               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);CHECKGLERROR
-               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);CHECKGLERROR
+               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_MODE, GL_NONE);CHECKGLERROR
+               qglTexParameteri(textureenum, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);CHECKGLERROR
                break;
        default:
                break;
@@ -1030,14 +1030,11 @@ static void R_UploadFullTexture(gltexture_t *glt, const unsigned char *data)
                        qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
 
 #ifndef USE_GLES2
-                       if (qglGetCompressedTexImageARB)
-                       {
-                               if (gl_texturecompression.integer >= 2)
-                                       qglHint(GL_TEXTURE_COMPRESSION_HINT_ARB, GL_NICEST);
-                               else
-                                       qglHint(GL_TEXTURE_COMPRESSION_HINT_ARB, GL_FASTEST);
-                               CHECKGLERROR
-                       }
+                       if (gl_texturecompression.integer >= 2)
+                               qglHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST);
+                       else
+                               qglHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);
+                       CHECKGLERROR
 #endif
                        switch(glt->texturetype)
                        {
@@ -1526,7 +1523,7 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
                memcpy(dds+84, ddsfourcc, 4);
                for (mip = 0;mip < mipmaps;mip++)
                {
-                       qglGetCompressedTexImageARB(gltexturetypeenums[glt->texturetype], mip, dds + mipinfo[mip][3]);CHECKGLERROR
+                       qglGetCompressedTexImage(gltexturetypeenums[glt->texturetype], mip, dds + mipinfo[mip][3]);CHECKGLERROR
                }
        }
        else
@@ -2205,7 +2202,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen
                case RENDERPATH_GLES2:
                        if (bytesperblock)
                        {
-                               qglCompressedTexImage2DARB(GL_TEXTURE_2D, mip, glt->glinternalformat, upload_mipwidth, upload_mipheight, 0, mipsize, upload_mippixels);CHECKGLERROR
+                               qglCompressedTexImage2D(GL_TEXTURE_2D, mip, glt->glinternalformat, upload_mipwidth, upload_mipheight, 0, mipsize, upload_mippixels);CHECKGLERROR
                        }
                        else
                        {
index 3c90e53..aa1fabc 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -57,8 +57,8 @@ typedef float GLfloat;
 typedef float GLclampf;
 typedef double GLdouble;
 typedef double GLclampd;
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
 
 #define GL_STEREO                                      0x0C33
 #define GL_DONT_CARE                           0x1100
@@ -202,19 +202,19 @@ typedef ptrdiff_t GLsizeiptrARB;
 #endif
 
 // GL_ARB_depth_texture
-#ifndef GL_DEPTH_COMPONENT32_ARB
-#define GL_DEPTH_COMPONENT16_ARB          0x81A5
-#define GL_DEPTH_COMPONENT24_ARB          0x81A6
-#define GL_DEPTH_COMPONENT32_ARB          0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
-//#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
+#ifndef GL_DEPTH_COMPONENT32
+#define GL_DEPTH_COMPONENT16          0x81A5
+#define GL_DEPTH_COMPONENT24          0x81A6
+#define GL_DEPTH_COMPONENT32          0x81A7
+#define GL_TEXTURE_DEPTH_SIZE         0x884A
+//#define GL_DEPTH_TEXTURE_MODE         0x884B
 #endif
 
 // GL_ARB_shadow
-#ifndef GL_TEXTURE_COMPARE_MODE_ARB
-#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
+#ifndef GL_TEXTURE_COMPARE_MODE
+#define GL_TEXTURE_COMPARE_MODE       0x884C
+#define GL_TEXTURE_COMPARE_FUNC       0x884D
+#define GL_COMPARE_R_TO_TEXTURE       0x884E
 #endif
 
 // GL_ARB_multitexture
@@ -295,12 +295,12 @@ extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint
 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE           0x851C
 #endif
 
-#ifndef GL_DEPTH_COMPONENT16_ARB
-#define GL_DEPTH_COMPONENT16_ARB       0x81A5
-#define GL_DEPTH_COMPONENT24_ARB       0x81A6
-#define GL_DEPTH_COMPONENT32_ARB       0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB      0x884A
-//#define GL_DEPTH_TEXTURE_MODE_ARB      0x884B
+#ifndef GL_DEPTH_COMPONENT16
+#define GL_DEPTH_COMPONENT16       0x81A5
+#define GL_DEPTH_COMPONENT24       0x81A6
+#define GL_DEPTH_COMPONENT32       0x81A7
+#define GL_TEXTURE_DEPTH_SIZE      0x884A
+//#define GL_DEPTH_TEXTURE_MODE      0x884B
 #endif
 
 #ifndef GL_SCISSOR_TEST
@@ -319,14 +319,14 @@ extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint
 #define GL_MIN                        0x8007
 #define GL_MAX                        0x8008
 #define GL_BLEND_EQUATION             0x8009 // also supplied by GL_blend_subtract
-extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_blend_subtract
+extern void (GLAPIENTRY *qglBlendEquation)(GLenum); // also supplied by GL_blend_subtract
 #endif
 
 //GL_EXT_blend_subtract
 #ifndef GL_FUNC_SUBTRACT
 #define GL_FUNC_SUBTRACT              0x800A
 #define GL_FUNC_REVERSE_SUBTRACT      0x800B
-extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_blend_subtract
+extern void (GLAPIENTRY *qglBlendEquation)(GLenum); // also supplied by GL_blend_subtract
 #endif
 
 //GL_ARB_texture_non_power_of_two
@@ -371,8 +371,8 @@ extern void (GLAPIENTRY *qglGenBuffers) (GLsizei n, GLuint *buffers);
 extern GLboolean (GLAPIENTRY *qglIsBuffer) (GLuint buffer);
 extern GLvoid* (GLAPIENTRY *qglMapBuffer) (GLenum target, GLenum access);
 extern GLboolean (GLAPIENTRY *qglUnmapBuffer) (GLenum target);
-extern void (GLAPIENTRY *qglBufferData) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-extern void (GLAPIENTRY *qglBufferSubData) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+extern void (GLAPIENTRY *qglBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+extern void (GLAPIENTRY *qglBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
 
 //GL_ARB_framebuffer_object
 // (slight differences from GL_EXT_framebuffer_object as this integrates GL_EXT_packed_depth_stencil)
@@ -474,63 +474,63 @@ extern GLvoid (GLAPIENTRY *qglBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint s
 extern GLvoid (GLAPIENTRY *qglGenerateMipmap)(GLenum target);
 
 // GL_ARB_draw_buffers
-#ifndef GL_MAX_DRAW_BUFFERS_ARB
-#define GL_MAX_DRAW_BUFFERS_ARB                              0x8824
-#define GL_DRAW_BUFFER0_ARB                                  0x8825
-#define GL_DRAW_BUFFER1_ARB                                  0x8826
-#define GL_DRAW_BUFFER2_ARB                                  0x8827
-#define GL_DRAW_BUFFER3_ARB                                  0x8828
-#define GL_DRAW_BUFFER4_ARB                                  0x8829
-#define GL_DRAW_BUFFER5_ARB                                  0x882A
-#define GL_DRAW_BUFFER6_ARB                                  0x882B
-#define GL_DRAW_BUFFER7_ARB                                  0x882C
-#define GL_DRAW_BUFFER8_ARB                                  0x882D
-#define GL_DRAW_BUFFER9_ARB                                  0x882E
-#define GL_DRAW_BUFFER10_ARB                                 0x882F
-#define GL_DRAW_BUFFER11_ARB                                 0x8830
-#define GL_DRAW_BUFFER12_ARB                                 0x8831
-#define GL_DRAW_BUFFER13_ARB                                 0x8832
-#define GL_DRAW_BUFFER14_ARB                                 0x8833
-#define GL_DRAW_BUFFER15_ARB                                 0x8834
+#ifndef GL_MAX_DRAW_BUFFERS
+#define GL_MAX_DRAW_BUFFERS                              0x8824
+#define GL_DRAW_BUFFER0                                  0x8825
+#define GL_DRAW_BUFFER1                                  0x8826
+#define GL_DRAW_BUFFER2                                  0x8827
+#define GL_DRAW_BUFFER3                                  0x8828
+#define GL_DRAW_BUFFER4                                  0x8829
+#define GL_DRAW_BUFFER5                                  0x882A
+#define GL_DRAW_BUFFER6                                  0x882B
+#define GL_DRAW_BUFFER7                                  0x882C
+#define GL_DRAW_BUFFER8                                  0x882D
+#define GL_DRAW_BUFFER9                                  0x882E
+#define GL_DRAW_BUFFER10                                 0x882F
+#define GL_DRAW_BUFFER11                                 0x8830
+#define GL_DRAW_BUFFER12                                 0x8831
+#define GL_DRAW_BUFFER13                                 0x8832
+#define GL_DRAW_BUFFER14                                 0x8833
+#define GL_DRAW_BUFFER15                                 0x8834
 #endif
-extern void (GLAPIENTRY *qglDrawBuffersARB)(GLsizei n, const GLenum *bufs);
+extern void (GLAPIENTRY *qglDrawBuffers)(GLsizei n, const GLenum *bufs);
 
 // GL_ARB_texture_float
-#ifndef GL_RGBA32F_ARB
-#define GL_RGBA32F_ARB                                       0x8814
-#define GL_RGB32F_ARB                                        0x8815
-#define GL_ALPHA32F_ARB                                      0x8816
-#define GL_INTENSITY32F_ARB                                  0x8817
-#define GL_LUMINANCE32F_ARB                                  0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB                            0x8819
-#define GL_RGBA16F_ARB                                       0x881A
-#define GL_RGB16F_ARB                                        0x881B
-#define GL_ALPHA16F_ARB                                      0x881C
-#define GL_INTENSITY16F_ARB                                  0x881D
-#define GL_LUMINANCE16F_ARB                                  0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB                            0x881F
+#ifndef GL_RGBA32F
+#define GL_RGBA32F                                       0x8814
+#define GL_RGB32F                                        0x8815
+#define GL_ALPHA32F                                      0x8816
+#define GL_INTENSITY32F                                  0x8817
+#define GL_LUMINANCE32F                                  0x8818
+#define GL_LUMINANCE_ALPHA32F                            0x8819
+#define GL_RGBA16F                                       0x881A
+#define GL_RGB16F                                        0x881B
+#define GL_ALPHA16F                                      0x881C
+#define GL_INTENSITY16F                                  0x881D
+#define GL_LUMINANCE16F                                  0x881E
+#define GL_LUMINANCE_ALPHA16F                            0x881F
 #endif
 
 // GL_ARB_half_float_pixel
-#ifndef GL_HALF_FLOAT_ARB
-typedef unsigned short GLhalfARB;
-#define GL_HALF_FLOAT_ARB                                    0x140B
+#ifndef GL_HALF_FLOAT
+typedef unsigned short GLhalf;
+#define GL_HALF_FLOAT                                    0x140B
 #endif
 
 // GL_EXT_texture_sRGB
-#ifndef GL_SRGB_EXT
-#define GL_SRGB_EXT                                          0x8C40
-#define GL_SRGB8_EXT                                         0x8C41
-#define GL_SRGB_ALPHA_EXT                                    0x8C42
-#define GL_SRGB8_ALPHA8_EXT                                  0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT                              0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT                            0x8C45
-#define GL_SLUMINANCE_EXT                                    0x8C46
-#define GL_SLUMINANCE8_EXT                                   0x8C47
-#define GL_COMPRESSED_SRGB_EXT                               0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT                         0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT                         0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT                   0x8C4B
+#ifndef GL_SRGB8_ALPHA8
+#define GL_SRGB                                          0x8C40
+#define GL_SRGB8                                         0x8C41
+#define GL_SRGB_ALPHA                                    0x8C42
+#define GL_SRGB8_ALPHA8                                  0x8C43
+#define GL_SLUMINANCE_ALPHA                              0x8C44
+#define GL_SLUMINANCE8_ALPHA8                            0x8C45
+#define GL_SLUMINANCE                                    0x8C46
+#define GL_SLUMINANCE8                                   0x8C47
+#define GL_COMPRESSED_SRGB                               0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA                         0x8C49
+#define GL_COMPRESSED_SLUMINANCE                         0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA                   0x8C4B
 #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT                     0x8C4C
 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT               0x8C4D
 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT               0x8C4E
@@ -579,7 +579,7 @@ extern void (GLAPIENTRY *qglGetActiveUniformName)(GLuint program, GLuint uniform
 extern GLuint (GLAPIENTRY *qglGetUniformBlockIndex)(GLuint program, const char* uniformBlockName);
 extern void (GLAPIENTRY *qglGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname,  GLint* params);
 extern void (GLAPIENTRY *qglGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, char* uniformBlockName);
-extern void (GLAPIENTRY *qglBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptrARB offset, GLsizeiptrARB size);
+extern void (GLAPIENTRY *qglBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
 extern void (GLAPIENTRY *qglBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
 extern void (GLAPIENTRY *qglGetIntegeri_v)(GLenum target, GLuint index, GLint* data);
 extern void (GLAPIENTRY *qglUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
@@ -841,25 +841,25 @@ extern void (GLAPIENTRY *qglGetVertexAttribPointerv)(GLuint index, GLenum pname,
 #endif
 
 // GL_ARB_texture_compression
-extern void (GLAPIENTRY *qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-extern void (GLAPIENTRY *qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
-//extern void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-extern void (GLAPIENTRY *qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-extern void (GLAPIENTRY *qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-//extern void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-extern void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod, void *img);
-#ifndef GL_COMPRESSED_RGB_ARB
-#define GL_COMPRESSED_ALPHA_ARB                                                0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB                                    0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB                      0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB                                    0x84EC
-#define GL_COMPRESSED_RGB_ARB                                          0x84ED
-#define GL_COMPRESSED_RGBA_ARB                                         0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB                                0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB           0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB                                      0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB          0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB                      0x86A3
+extern void (GLAPIENTRY *qglCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+extern void (GLAPIENTRY *qglCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
+//extern void (GLAPIENTRY *qglCompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+extern void (GLAPIENTRY *qglCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+extern void (GLAPIENTRY *qglCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+//extern void (GLAPIENTRY *qglCompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+extern void (GLAPIENTRY *qglGetCompressedTexImage)(GLenum target, GLint lod, void *img);
+#ifndef GL_COMPRESSED_RGB
+#define GL_COMPRESSED_ALPHA                                            0x84E9
+#define GL_COMPRESSED_LUMINANCE                                        0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA                  0x84EB
+#define GL_COMPRESSED_INTENSITY                                        0x84EC
+#define GL_COMPRESSED_RGB                                              0x84ED
+#define GL_COMPRESSED_RGBA                                             0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT                            0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE               0x86A0
+#define GL_TEXTURE_COMPRESSED                                  0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS              0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS                  0x86A3
 #endif
 
 // GL_EXT_texture_compression_s3tc
@@ -871,28 +871,28 @@ extern void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod,
 #endif
 
 // GL_ARB_occlusion_query
-extern void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
-extern void (GLAPIENTRY *qglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
-extern GLboolean (GLAPIENTRY *qglIsQueryARB)(GLuint qid);
-extern void (GLAPIENTRY *qglBeginQueryARB)(GLenum target, GLuint qid);
-extern void (GLAPIENTRY *qglEndQueryARB)(GLenum target);
-extern void (GLAPIENTRY *qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
-extern void (GLAPIENTRY *qglGetQueryObjectivARB)(GLuint qid, GLenum pname, GLint *params);
-extern void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLuint *params);
-#ifndef GL_SAMPLES_PASSED_ARB
-#define GL_SAMPLES_PASSED_ARB                             0x8914
-#define GL_QUERY_COUNTER_BITS_ARB                         0x8864
-#define GL_CURRENT_QUERY_ARB                              0x8865
-#define GL_QUERY_RESULT_ARB                               0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB                     0x8867
+extern void (GLAPIENTRY *qglGenQueries)(GLsizei n, GLuint *ids);
+extern void (GLAPIENTRY *qglDeleteQueries)(GLsizei n, const GLuint *ids);
+extern GLboolean (GLAPIENTRY *qglIsQuery)(GLuint qid);
+extern void (GLAPIENTRY *qglBeginQuery)(GLenum target, GLuint qid);
+extern void (GLAPIENTRY *qglEndQuery)(GLenum target);
+extern void (GLAPIENTRY *qglGetQueryiv)(GLenum target, GLenum pname, GLint *params);
+extern void (GLAPIENTRY *qglGetQueryObjectiv)(GLuint qid, GLenum pname, GLint *params);
+extern void (GLAPIENTRY *qglGetQueryObjectuiv)(GLuint qid, GLenum pname, GLuint *params);
+#ifndef GL_SAMPLES_PASSED
+#define GL_SAMPLES_PASSED                             0x8914
+#define GL_QUERY_COUNTER_BITS                         0x8864
+#define GL_CURRENT_QUERY                              0x8865
+#define GL_QUERY_RESULT                               0x8866
+#define GL_QUERY_RESULT_AVAILABLE                     0x8867
 #endif
 
 // GL_ARB_query_buffer_object
-#ifndef GL_QUERY_BUFFER_ARB
-#define GL_QUERY_BUFFER_ARB                               0x9192
-#define GL_QUERY_BUFFER_BINDING_ARB                       0x9193
-#define GL_QUERY_RESULT_NO_WAIT_ARB                       0x9194
-#define GL_QUERY_BUFFER_BARRIER_BIT_ARB                   0x00008000
+#ifndef GL_QUERY_BUFFER
+#define GL_QUERY_BUFFER                               0x9192
+#define GL_QUERY_BUFFER_BINDING                       0x9193
+#define GL_QUERY_RESULT_NO_WAIT                       0x9194
+#define GL_QUERY_BUFFER_BARRIER_BIT                   0x00008000
 #endif
 
 // GL_EXT_bgr
@@ -906,23 +906,23 @@ extern void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLui
 //GL_ARB_texture_gather
 
 //GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB              0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB      0x809F
-#define GL_SAMPLE_COVERAGE_ARB          0x80A0
-#define GL_SAMPLE_BUFFERS_ARB           0x80A8
-#define GL_SAMPLES_ARB                  0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB    0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB   0x80AB
-#define GL_MULTISAMPLE_BIT_ARB          0x20000000
-extern void (GLAPIENTRY *qglSampleCoverageARB)(GLclampf value, GLboolean invert);
+#define GL_MULTISAMPLE              0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE      0x809F
+#define GL_SAMPLE_COVERAGE          0x80A0
+#define GL_SAMPLE_BUFFERS           0x80A8
+#define GL_SAMPLES                  0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE    0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT   0x80AB
+#define GL_MULTISAMPLE_BIT          0x20000000
+extern void (GLAPIENTRY *qglSampleCoverage)(GLclampf value, GLboolean invert);
 
 extern void (GLAPIENTRY *qglPointSize)(GLfloat size);
 
 //GL_EXT_packed_depth_stencil
-#define GL_DEPTH_STENCIL_EXT            0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT        0x84FA
-#define GL_DEPTH24_STENCIL8_EXT         0x88F0
+#define GL_DEPTH_STENCIL            0x84F9
+#define GL_UNSIGNED_INT_24_8        0x84FA
+#define GL_DEPTH24_STENCIL8         0x88F0
 
 //GL_EXT_blend_func_separate
 #ifndef GL_BLEND_DST_RGB
@@ -981,46 +981,46 @@ void GL_PrintError(int errornumber, const char *filename, int linenumber);
 #endif
 
 #ifdef USE_GLES2
-#define qglIsBufferARB glIsBuffer
+#define qglIsBuffer glIsBuffer
 #define qglIsEnabled glIsEnabled
-#define qglIsFramebufferEXT glIsFramebuffer
-//#define qglIsQueryARB glIsQuery
-#define qglIsRenderbufferEXT glIsRenderbuffer
-//#define qglUnmapBufferARB glUnmapBuffer
+#define qglIsFramebuffer glIsFramebuffer
+//#define qglIsQuery glIsQuery
+#define qglIsRenderbuffer glIsRenderbuffer
+//#define qglUnmapBuffer glUnmapBuffer
 #define qglCheckFramebufferStatus glCheckFramebufferStatus
 #define qglGetError glGetError
 #define qglCreateProgram glCreateProgram
 #define qglCreateShader glCreateShader
-//#define qglGetHandleARB glGetHandle
+//#define qglGetHandle glGetHandle
 #define qglGetAttribLocation glGetAttribLocation
 #define qglGetUniformLocation glGetUniformLocation
-//#define qglMapBufferARB glMapBuffer
+//#define qglMapBuffer glMapBuffer
 #define qglGetString glGetString
-//#define qglActiveStencilFaceEXT glActiveStencilFace
+//#define qglActiveStencilFace glActiveStencilFace
 #define qglActiveTexture glActiveTexture
 #define qglAttachShader glAttachShader
-//#define qglBeginQueryARB glBeginQuery
+//#define qglBeginQuery glBeginQuery
 #define qglBindAttribLocation glBindAttribLocation
 //#define qglBindFragDataLocation glBindFragDataLocation
 #define qglBindBuffer glBindBuffer
 #define qglBindFramebuffer glBindFramebuffer
 #define qglBindRenderbuffer glBindRenderbuffer
 #define qglBindTexture glBindTexture
-#define qglBlendEquationEXT glBlendEquation
+#define qglBlendEquation glBlendEquation
 #define qglBlendFunc glBlendFunc
 #define qglBlendFuncSeparate glBlendFuncSeparate
-#define qglBufferDataARB glBufferData
-#define qglBufferSubDataARB glBufferSubData
+#define qglBufferData glBufferData
+#define qglBufferSubData glBufferSubData
 #define qglClear glClear
 #define qglClearColor glClearColor
 #define qglClearDepthf glClearDepthf
 #define qglClearStencil glClearStencil
 #define qglColorMask glColorMask
 #define qglCompileShader glCompileShader
-#define qglCompressedTexImage2DARB glCompressedTexImage2D
-#define qglCompressedTexImage3DARB glCompressedTexImage3D
-#define qglCompressedTexSubImage2DARB glCompressedTexSubImage2D
-#define qglCompressedTexSubImage3DARB glCompressedTexSubImage3D
+#define qglCompressedTexImage2D glCompressedTexImage2D
+#define qglCompressedTexImage3D glCompressedTexImage3D
+#define qglCompressedTexSubImage2D glCompressedTexSubImage2D
+#define qglCompressedTexSubImage3D glCompressedTexSubImage3D
 #define qglCopyTexImage2D glCopyTexImage2D
 #define qglCopyTexSubImage2D glCopyTexSubImage2D
 #define qglCopyTexSubImage3D glCopyTexSubImage3D
@@ -1029,7 +1029,7 @@ void GL_PrintError(int errornumber, const char *filename, int linenumber);
 #define qglDeleteFramebuffers glDeleteFramebuffers
 #define qglDeleteProgram glDeleteProgram
 #define qglDeleteShader glDeleteShader
-//#define qglDeleteQueriesARB glDeleteQueries
+//#define qglDeleteQueries glDeleteQueries
 #define qglDeleteRenderbuffers glDeleteRenderbuffers
 #define qglDeleteTextures glDeleteTextures
 #define qglDepthFunc glDepthFunc
@@ -1040,11 +1040,11 @@ void GL_PrintError(int errornumber, const char *filename, int linenumber);
 #define qglDisableVertexAttribArray glDisableVertexAttribArray
 #define qglDrawArrays glDrawArrays
 //#define qglDrawBuffer glDrawBuffer
-//#define qglDrawBuffersARB glDrawBuffers
+//#define qglDrawBuffers glDrawBuffers
 #define qglDrawElements glDrawElements
 #define qglEnable glEnable
 #define qglEnableVertexAttribArray glEnableVertexAttribArray
-//#define qglEndQueryARB glEndQuery
+//#define qglEndQuery glEndQuery
 #define qglFinish glFinish
 #define qglFlush glFlush
 #define qglFramebufferRenderbuffer glFramebufferRenderbuffer
@@ -1052,27 +1052,27 @@ void GL_PrintError(int errornumber, const char *filename, int linenumber);
 #define qglFramebufferTexture3DEXT glFramebufferTexture3D
 #define qglGenBuffers glGenBuffers
 #define qglGenFramebuffers glGenFramebuffers
-//#define qglGenQueriesARB glGenQueries
+//#define qglGenQueries glGenQueries
 #define qglGenRenderbuffers glGenRenderbuffers
 #define qglGenTextures glGenTextures
-#define qglGenerateMipmapEXT glGenerateMipmap
+#define qglGenerateMipmap glGenerateMipmap
 #define qglGetActiveAttrib glGetActiveAttrib
 #define qglGetActiveUniform glGetActiveUniform
 #define qglGetAttachedShaders glGetAttachedShaders
 #define qglGetBooleanv glGetBooleanv
-//#define qglGetCompressedTexImageARB glGetCompressedTexImage
+//#define qglGetCompressedTexImage glGetCompressedTexImage
 #define qglGetDoublev glGetDoublev
 #define qglGetFloatv glGetFloatv
-#define qglGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
+#define qglGetFramebufferAttachmentParameteriv glGetFramebufferAttachmentParameteriv
 #define qglGetProgramInfoLog glGetProgramInfoLog
 #define qglGetShaderInfoLog glGetShaderInfoLog
 #define qglGetIntegerv glGetIntegerv
 #define qglGetShaderiv glGetShaderiv
 #define qglGetProgramiv glGetProgramiv
-//#define qglGetQueryObjectivARB glGetQueryObjectiv
-//#define qglGetQueryObjectuivARB glGetQueryObjectuiv
-//#define qglGetQueryivARB glGetQueryiv
-#define qglGetRenderbufferParameterivEXT glGetRenderbufferParameteriv
+//#define qglGetQueryObjectiv glGetQueryObjectiv
+//#define qglGetQueryObjectuiv glGetQueryObjectuiv
+//#define qglGetQueryiv glGetQueryiv
+#define qglGetRenderbufferParameteriv glGetRenderbufferParameteriv
 #define qglGetShaderSource glGetShaderSource
 #define qglGetTexImage glGetTexImage
 #define qglGetTexLevelParameterfv glGetTexLevelParameterfv
index 113ad01..1553ac6 100644 (file)
@@ -4429,7 +4429,7 @@ static void R_BeginCoronaQuery(rtlight_t *rtlight, float scale, qboolean usequer
 {
        float zdist;
        vec3_t centerorigin;
-#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
+#ifndef USE_GLES2
        float vertex3f[12];
 #endif
        // if it's too close, skip it
@@ -4449,21 +4449,21 @@ static void R_BeginCoronaQuery(rtlight_t *rtlight, float scale, qboolean usequer
                {
                case RENDERPATH_GL32:
                case RENDERPATH_GLES2:
-#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
+#ifndef USE_GLES2
                        CHECKGLERROR
                        // NOTE: GL_DEPTH_TEST must be enabled or ATI won't count samples, so use GL_DepthFunc instead
-                       qglBeginQueryARB(GL_SAMPLES_PASSED_ARB, rtlight->corona_queryindex_allpixels);
+                       qglBeginQuery(GL_SAMPLES_PASSED, rtlight->corona_queryindex_allpixels);
                        GL_DepthFunc(GL_ALWAYS);
                        R_CalcSprite_Vertex3f(vertex3f, centerorigin, r_refdef.view.right, r_refdef.view.up, scale, -scale, -scale, scale);
                        R_Mesh_PrepareVertices_Vertex3f(4, vertex3f, NULL, 0);
                        R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
-                       qglEndQueryARB(GL_SAMPLES_PASSED_ARB);
+                       qglEndQuery(GL_SAMPLES_PASSED);
                        GL_DepthFunc(GL_LEQUAL);
-                       qglBeginQueryARB(GL_SAMPLES_PASSED_ARB, rtlight->corona_queryindex_visiblepixels);
+                       qglBeginQuery(GL_SAMPLES_PASSED, rtlight->corona_queryindex_visiblepixels);
                        R_CalcSprite_Vertex3f(vertex3f, rtlight->shadoworigin, r_refdef.view.right, r_refdef.view.up, scale, -scale, -scale, scale);
                        R_Mesh_PrepareVertices_Vertex3f(4, vertex3f, NULL, 0);
                        R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
-                       qglEndQueryARB(GL_SAMPLES_PASSED_ARB);
+                       qglEndQuery(GL_SAMPLES_PASSED);
                        CHECKGLERROR
 #endif
                        break;
@@ -4478,7 +4478,6 @@ static void R_DrawCorona(rtlight_t *rtlight, float cscale, float scale)
 {
        vec3_t color;
        unsigned int occlude = 0;
-       GLint allpixels = 0, visiblepixels = 0;
 
        // now we have to check the query result
        if (rtlight->corona_queryindex_visiblepixels)
@@ -4487,31 +4486,22 @@ static void R_DrawCorona(rtlight_t *rtlight, float cscale, float scale)
                {
                case RENDERPATH_GL32:
                case RENDERPATH_GLES2:
-#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
-                       // See if we can use the GPU-side method to prevent implicit sync
-                       if (vid.support.arb_query_buffer_object) {
+#ifndef USE_GLES2
+                       // store the pixel counts into a uniform buffer for the shader to
+                       // use - we'll never know the results on the cpu without
+                       // synchronizing and we don't want that
 #define BUFFER_OFFSET(i)    ((GLint *)((unsigned char*)NULL + (i)))
-                               if (!r_shadow_occlusion_buf) {
-                                       qglGenBuffers(1, &r_shadow_occlusion_buf);
-                                       qglBindBuffer(GL_QUERY_BUFFER_ARB, r_shadow_occlusion_buf);
-                                       qglBufferData(GL_QUERY_BUFFER_ARB, 8, NULL, GL_DYNAMIC_COPY);
-                               } else {
-                                       qglBindBuffer(GL_QUERY_BUFFER_ARB, r_shadow_occlusion_buf);
-                               }
-                               qglGetQueryObjectivARB(rtlight->corona_queryindex_visiblepixels, GL_QUERY_RESULT_ARB, BUFFER_OFFSET(0));
-                               qglGetQueryObjectivARB(rtlight->corona_queryindex_allpixels, GL_QUERY_RESULT_ARB, BUFFER_OFFSET(4));
-                               qglBindBufferBase(GL_UNIFORM_BUFFER, 0, r_shadow_occlusion_buf);
-                               occlude = MATERIALFLAG_OCCLUDE;
-                               cscale *= rtlight->corona_visibility;
-                               CHECKGLERROR
-                               break;
+                       if (!r_shadow_occlusion_buf) {
+                               qglGenBuffers(1, &r_shadow_occlusion_buf);
+                               qglBindBuffer(GL_QUERY_BUFFER, r_shadow_occlusion_buf);
+                               qglBufferData(GL_QUERY_BUFFER, 8, NULL, GL_DYNAMIC_COPY);
+                       } else {
+                               qglBindBuffer(GL_QUERY_BUFFER, r_shadow_occlusion_buf);
                        }
-                       CHECKGLERROR
-                       qglGetQueryObjectivARB(rtlight->corona_queryindex_visiblepixels, GL_QUERY_RESULT_ARB, &visiblepixels);
-                       qglGetQueryObjectivARB(rtlight->corona_queryindex_allpixels, GL_QUERY_RESULT_ARB, &allpixels);
-                       if (visiblepixels < 1 || allpixels < 1)
-                               return;
-                       rtlight->corona_visibility *= bound(0, (float)visiblepixels / (float)allpixels, 1);
+                       qglGetQueryObjectiv(rtlight->corona_queryindex_visiblepixels, GL_QUERY_RESULT, BUFFER_OFFSET(0));
+                       qglGetQueryObjectiv(rtlight->corona_queryindex_allpixels, GL_QUERY_RESULT, BUFFER_OFFSET(4));
+                       qglBindBufferBase(GL_UNIFORM_BUFFER, 0, r_shadow_occlusion_buf);
+                       occlude = MATERIALFLAG_OCCLUDE;
                        cscale *= rtlight->corona_visibility;
                        CHECKGLERROR
                        break;
@@ -4560,16 +4550,14 @@ void R_Shadow_DrawCoronas(void)
 
        range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
 
-       // check occlusion of coronas
-       // use GL_ARB_occlusion_query if available
-       // otherwise use raytraces
+       // check occlusion of coronas, using occlusion queries or raytraces
        r_numqueries = 0;
        switch (vid.renderpath)
        {
        case RENDERPATH_GL32:
        case RENDERPATH_GLES2:
-               usequery = vid.support.arb_occlusion_query && r_coronas_occlusionquery.integer;
-#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
+               usequery = r_coronas_occlusionquery.integer;
+#ifndef USE_GLES2
                if (usequery)
                {
                        GL_ColorMask(0,0,0,0);
@@ -4580,7 +4568,7 @@ void R_Shadow_DrawCoronas(void)
                                r_maxqueries = ((unsigned int)range + r_refdef.scene.numlights) * 4;
                                r_maxqueries = min(r_maxqueries, MAX_OCCLUSION_QUERIES);
                                CHECKGLERROR
-                               qglGenQueriesARB(r_maxqueries - i, r_queries + i);
+                               qglGenQueries(r_maxqueries - i, r_queries + i);
                                CHECKGLERROR
                        }
                        RSurf_ActiveModelEntity(r_refdef.scene.worldentity, false, false, false);
index d47ffdb..aeea4cc 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -1324,8 +1324,8 @@ void wrapglBindRenderbuffer(GLenum target, GLuint renderbuffer) {PRECALL;glBindR
 void wrapglBindTexture(GLenum target, GLuint texture) {PRECALL;glBindTexture(target, texture);POSTCALL;}
 void wrapglBlendEquation(GLenum e) {PRECALL;glBlendEquation(e);POSTCALL;}
 void wrapglBlendFunc(GLenum sfactor, GLenum dfactor) {PRECALL;glBlendFunc(sfactor, dfactor);POSTCALL;}
-void wrapglBufferData(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) {PRECALL;glBufferData(target, size, data, usage);POSTCALL;}
-void wrapglBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) {PRECALL;glBufferSubData(target, offset, size, data);POSTCALL;}
+void wrapglBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) {PRECALL;glBufferData(target, size, data, usage);POSTCALL;}
+void wrapglBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) {PRECALL;glBufferSubData(target, offset, size, data);POSTCALL;}
 void wrapglClear(GLbitfield mask) {PRECALL;glClear(mask);POSTCALL;}
 void wrapglClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {PRECALL;glClearColor(red, green, blue, alpha);POSTCALL;}
 void wrapglClearDepth(GLclampd depth) {PRECALL;/*Con_Printf("glClearDepth(%f)\n", depth);glClearDepthf((float)depth);*/POSTCALL;}
@@ -1493,46 +1493,46 @@ void wrapglGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid **pointer)
 void GLES_Init(void)
 {
 #ifndef qglClear
-       qglIsBufferARB = wrapglIsBuffer;
+       qglIsBuffer = wrapglIsBuffer;
        qglIsEnabled = wrapglIsEnabled;
-       qglIsFramebufferEXT = wrapglIsFramebuffer;
-//     qglIsQueryARB = wrapglIsQuery;
-       qglIsRenderbufferEXT = wrapglIsRenderbuffer;
-//     qglUnmapBufferARB = wrapglUnmapBuffer;
+       qglIsFramebuffer = wrapglIsFramebuffer;
+//     qglIsQuery = wrapglIsQuery;
+       qglIsRenderbuffer = wrapglIsRenderbuffer;
+//     qglUnmapBuffer = wrapglUnmapBuffer;
        qglCheckFramebufferStatus = wrapglCheckFramebufferStatus;
        qglGetError = wrapglGetError;
        qglCreateProgram = wrapglCreateProgram;
        qglCreateShader = wrapglCreateShader;
-//     qglGetHandleARB = wrapglGetHandle;
+//     qglGetHandle = wrapglGetHandle;
        qglGetAttribLocation = wrapglGetAttribLocation;
        qglGetUniformLocation = wrapglGetUniformLocation;
 //     qglMapBuffer = wrapglMapBuffer;
        qglGetString = wrapglGetString;
-//     qglActiveStencilFaceEXT = wrapglActiveStencilFace;
+//     qglActiveStencilFace = wrapglActiveStencilFace;
        qglActiveTexture = wrapglActiveTexture;
        qglArrayElement = wrapglArrayElement;
        qglAttachShader = wrapglAttachShader;
-//     qglBeginQueryARB = wrapglBeginQuery;
+//     qglBeginQuery = wrapglBeginQuery;
        qglBindAttribLocation = wrapglBindAttribLocation;
 //     qglBindFragDataLocation = wrapglBindFragDataLocation;
        qglBindBuffer = wrapglBindBuffer;
        qglBindFramebuffer = wrapglBindFramebuffer;
        qglBindRenderbuffer = wrapglBindRenderbuffer;
        qglBindTexture = wrapglBindTexture;
-       qglBlendEquationEXT = wrapglBlendEquation;
+       qglBlendEquation = wrapglBlendEquation;
        qglBlendFunc = wrapglBlendFunc;
-       qglBufferDataARB = wrapglBufferData;
-       qglBufferSubDataARB = wrapglBufferSubData;
+       qglBufferData = wrapglBufferData;
+       qglBufferSubData = wrapglBufferSubData;
        qglClear = wrapglClear;
        qglClearColor = wrapglClearColor;
        qglClearDepth = wrapglClearDepth;
        qglClearStencil = wrapglClearStencil;
        qglColorMask = wrapglColorMask;
        qglCompileShader = wrapglCompileShader;
-       qglCompressedTexImage2DARB = wrapglCompressedTexImage2D;
-       qglCompressedTexImage3DARB = wrapglCompressedTexImage3D;
-       qglCompressedTexSubImage2DARB = wrapglCompressedTexSubImage2D;
-       qglCompressedTexSubImage3DARB = wrapglCompressedTexSubImage3D;
+       qglCompressedTexImage2D = wrapglCompressedTexImage2D;
+       qglCompressedTexImage3D = wrapglCompressedTexImage3D;
+       qglCompressedTexSubImage2D = wrapglCompressedTexSubImage2D;
+       qglCompressedTexSubImage3D = wrapglCompressedTexSubImage3D;
        qglCopyTexImage2D = wrapglCopyTexImage2D;
        qglCopyTexSubImage2D = wrapglCopyTexSubImage2D;
        qglCopyTexSubImage3D = wrapglCopyTexSubImage3D;
@@ -1541,7 +1541,7 @@ void GLES_Init(void)
        qglDeleteFramebuffers = wrapglDeleteFramebuffers;
        qglDeleteProgram = wrapglDeleteProgram;
        qglDeleteShader = wrapglDeleteShader;
-//     qglDeleteQueriesARB = wrapglDeleteQueries;
+//     qglDeleteQueries = wrapglDeleteQueries;
        qglDeleteRenderbuffers = wrapglDeleteRenderbuffers;
        qglDeleteTextures = wrapglDeleteTextures;
        qglDepthFunc = wrapglDepthFunc;
@@ -1552,39 +1552,39 @@ void GLES_Init(void)
        qglDisableVertexAttribArray = wrapglDisableVertexAttribArray;
        qglDrawArrays = wrapglDrawArrays;
 //     qglDrawBuffer = wrapglDrawBuffer;
-//     qglDrawBuffersARB = wrapglDrawBuffers;
+//     qglDrawBuffers = wrapglDrawBuffers;
        qglDrawElements = wrapglDrawElements;
        qglEnable = wrapglEnable;
        qglEnableVertexAttribArray = wrapglEnableVertexAttribArray;
-//     qglEndQueryARB = wrapglEndQuery;
+//     qglEndQuery = wrapglEndQuery;
        qglFinish = wrapglFinish;
        qglFlush = wrapglFlush;
-       qglFramebufferRenderbufferEXT = wrapglFramebufferRenderbuffer;
-       qglFramebufferTexture2DEXT = wrapglFramebufferTexture2D;
-       qglFramebufferTexture3DEXT = wrapglFramebufferTexture3D;
+       qglFramebufferRenderbuffer = wrapglFramebufferRenderbuffer;
+       qglFramebufferTexture2D = wrapglFramebufferTexture2D;
+       qglFramebufferTexture3D = wrapglFramebufferTexture3D;
        qglGenBuffers = wrapglGenBuffers;
        qglGenFramebuffers = wrapglGenFramebuffers;
-//     qglGenQueriesARB = wrapglGenQueries;
+//     qglGenQueries = wrapglGenQueries;
        qglGenRenderbuffers = wrapglGenRenderbuffers;
        qglGenTextures = wrapglGenTextures;
-       qglGenerateMipmapEXT = wrapglGenerateMipmap;
+       qglGenerateMipmap = wrapglGenerateMipmap;
        qglGetActiveAttrib = wrapglGetActiveAttrib;
        qglGetActiveUniform = wrapglGetActiveUniform;
        qglGetAttachedShaders = wrapglGetAttachedShaders;
        qglGetBooleanv = wrapglGetBooleanv;
-//     qglGetCompressedTexImageARB = wrapglGetCompressedTexImage;
+//     qglGetCompressedTexImage = wrapglGetCompressedTexImage;
        qglGetDoublev = wrapglGetDoublev;
        qglGetFloatv = wrapglGetFloatv;
-       qglGetFramebufferAttachmentParameterivEXT = wrapglGetFramebufferAttachmentParameteriv;
+       qglGetFramebufferAttachmentParameteriv = wrapglGetFramebufferAttachmentParameteriv;
        qglGetProgramInfoLog = wrapglGetProgramInfoLog;
        qglGetShaderInfoLog = wrapglGetShaderInfoLog;
        qglGetIntegerv = wrapglGetIntegerv;
        qglGetShaderiv = wrapglGetShaderiv;
        qglGetProgramiv = wrapglGetProgramiv;
-//     qglGetQueryObjectivARB = wrapglGetQueryObjectiv;
-//     qglGetQueryObjectuivARB = wrapglGetQueryObjectuiv;
-//     qglGetQueryivARB = wrapglGetQueryiv;
-       qglGetRenderbufferParameterivEXT = wrapglGetRenderbufferParameteriv;
+//     qglGetQueryObjectiv = wrapglGetQueryObjectiv;
+//     qglGetQueryObjectuiv = wrapglGetQueryObjectuiv;
+//     qglGetQueryiv = wrapglGetQueryiv;
+       qglGetRenderbufferParameteriv = wrapglGetRenderbufferParameteriv;
        qglGetShaderSource = wrapglGetShaderSource;
        qglGetTexImage = wrapglGetTexImage;
        qglGetTexLevelParameterfv = wrapglGetTexLevelParameterfv;
index 5938a45..0abf25d 100644 (file)
@@ -279,11 +279,11 @@ void (GLAPIENTRY *qglPolygonMode)(GLenum face, GLenum mode);
 
 void (GLAPIENTRY *qglPointSize)(GLfloat size);
 
-void (GLAPIENTRY *qglBlendEquationEXT)(GLenum);
+void (GLAPIENTRY *qglBlendEquation)(GLenum);
 
 void (GLAPIENTRY *qglStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum);
 void (GLAPIENTRY *qglStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint);
-void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
+void (GLAPIENTRY *qglActiveStencilFace)(GLenum);
 
 void (GLAPIENTRY *qglDeleteShader)(GLuint obj);
 void (GLAPIENTRY *qglDeleteProgram)(GLuint obj);
@@ -381,8 +381,8 @@ void (GLAPIENTRY *qglGenBuffers) (GLsizei n, GLuint *buffers);
 GLboolean (GLAPIENTRY *qglIsBuffer) (GLuint buffer);
 GLvoid* (GLAPIENTRY *qglMapBuffer) (GLenum target, GLenum access);
 GLboolean (GLAPIENTRY *qglUnmapBuffer) (GLenum target);
-void (GLAPIENTRY *qglBufferData) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-void (GLAPIENTRY *qglBufferSubData) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+void (GLAPIENTRY *qglBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+void (GLAPIENTRY *qglBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
 
 //GL_ARB_framebuffer_object
 GLboolean (GLAPIENTRY *qglIsRenderbuffer)(GLuint renderbuffer);
@@ -406,26 +406,26 @@ GLvoid (GLAPIENTRY *qglGetFramebufferAttachmentParameteriv)(GLenum target, GLenu
 GLvoid (GLAPIENTRY *qglBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 GLvoid (GLAPIENTRY *qglGenerateMipmap)(GLenum target);
 
-void (GLAPIENTRY *qglDrawBuffersARB)(GLsizei n, const GLenum *bufs);
+void (GLAPIENTRY *qglDrawBuffers)(GLsizei n, const GLenum *bufs);
 
-void (GLAPIENTRY *qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
-//void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-//void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod, void *img);
+void (GLAPIENTRY *qglCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+void (GLAPIENTRY *qglCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
+//void (GLAPIENTRY *qglCompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+void (GLAPIENTRY *qglCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+void (GLAPIENTRY *qglCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+//void (GLAPIENTRY *qglCompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+void (GLAPIENTRY *qglGetCompressedTexImage)(GLenum target, GLint lod, void *img);
 
-void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
-void (GLAPIENTRY *qglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
-GLboolean (GLAPIENTRY *qglIsQueryARB)(GLuint qid);
-void (GLAPIENTRY *qglBeginQueryARB)(GLenum target, GLuint qid);
-void (GLAPIENTRY *qglEndQueryARB)(GLenum target);
-void (GLAPIENTRY *qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
-void (GLAPIENTRY *qglGetQueryObjectivARB)(GLuint qid, GLenum pname, GLint *params);
-void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLuint *params);
+void (GLAPIENTRY *qglGenQueries)(GLsizei n, GLuint *ids);
+void (GLAPIENTRY *qglDeleteQueries)(GLsizei n, const GLuint *ids);
+GLboolean (GLAPIENTRY *qglIsQuery)(GLuint qid);
+void (GLAPIENTRY *qglBeginQuery)(GLenum target, GLuint qid);
+void (GLAPIENTRY *qglEndQuery)(GLenum target);
+void (GLAPIENTRY *qglGetQueryiv)(GLenum target, GLenum pname, GLint *params);
+void (GLAPIENTRY *qglGetQueryObjectiv)(GLuint qid, GLenum pname, GLint *params);
+void (GLAPIENTRY *qglGetQueryObjectuiv)(GLuint qid, GLenum pname, GLuint *params);
 
-void (GLAPIENTRY *qglSampleCoverageARB)(GLclampf value, GLboolean invert);
+void (GLAPIENTRY *qglSampleCoverage)(GLclampf value, GLboolean invert);
 
 void (GLAPIENTRY *qglGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices);
 void (GLAPIENTRY *qglGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
@@ -433,7 +433,7 @@ void (GLAPIENTRY *qglGetActiveUniformName)(GLuint program, GLuint uniformIndex,
 GLuint (GLAPIENTRY *qglGetUniformBlockIndex)(GLuint program, const GLchar* uniformBlockName);
 void (GLAPIENTRY *qglGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname,  GLint* params);
 void (GLAPIENTRY *qglGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
-void (GLAPIENTRY *qglBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptrARB offset, GLsizeiptrARB size);
+void (GLAPIENTRY *qglBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
 void (GLAPIENTRY *qglBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
 void (GLAPIENTRY *qglGetIntegeri_v)(GLenum target, GLuint index, GLint* data);
 void (GLAPIENTRY *qglUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
@@ -670,100 +670,65 @@ static dllfunction_t openglfuncs[] =
        {"glGetVertexAttribfv", (void **) &qglGetVertexAttribfv},
        {"glGetVertexAttribiv", (void **) &qglGetVertexAttribiv},
        {"glGetVertexAttribPointerv", (void **) &qglGetVertexAttribPointerv},
-       {"glBindBuffer"    , (void **) &qglBindBuffer},
-       {"glDeleteBuffers" , (void **) &qglDeleteBuffers},
-       {"glGenBuffers"    , (void **) &qglGenBuffers},
-       {"glIsBuffer"      , (void **) &qglIsBuffer},
-       {"glMapBuffer"     , (void **) &qglMapBuffer},
-       {"glUnmapBuffer"   , (void **) &qglUnmapBuffer},
-       {"glBufferData"    , (void **) &qglBufferData},
-       {"glBufferSubData" , (void **) &qglBufferSubData},
-       {"glIsRenderbuffer"                      , (void **) &qglIsRenderbuffer},
-       {"glBindRenderbuffer"                    , (void **) &qglBindRenderbuffer},
-       {"glDeleteRenderbuffers"                 , (void **) &qglDeleteRenderbuffers},
-       {"glGenRenderbuffers"                    , (void **) &qglGenRenderbuffers},
-       {"glRenderbufferStorage"                 , (void **) &qglRenderbufferStorage},
-       {"glRenderbufferStorageMultisample"      , (void **) &qglRenderbufferStorageMultisample},
-       {"glGetRenderbufferParameteriv"          , (void **) &qglGetRenderbufferParameteriv},
-       {"glIsFramebuffer"                       , (void **) &qglIsFramebuffer},
-       {"glBindFramebuffer"                     , (void **) &qglBindFramebuffer},
-       {"glDeleteFramebuffers"                  , (void **) &qglDeleteFramebuffers},
-       {"glGenFramebuffers"                     , (void **) &qglGenFramebuffers},
-       {"glCheckFramebufferStatus"              , (void **) &qglCheckFramebufferStatus},
-       {"glFramebufferTexture1D"                , (void **) &qglFramebufferTexture1D},
-       {"glFramebufferTexture2D"                , (void **) &qglFramebufferTexture2D},
-       {"glFramebufferTexture3D"                , (void **) &qglFramebufferTexture3D},
-       {"glFramebufferTextureLayer"             , (void **) &qglFramebufferTextureLayer},
-       {"glFramebufferRenderbuffer"             , (void **) &qglFramebufferRenderbuffer},
-       {"glGetFramebufferAttachmentParameteriv" , (void **) &qglGetFramebufferAttachmentParameteriv},
-       {"glBlitFramebuffer"                     , (void **) &qglBlitFramebuffer},
-       {"glGenerateMipmap"                      , (void **) &qglGenerateMipmap},
-       {"glGetUniformIndices"        , (void **) &qglGetUniformIndices},
-       {"glGetActiveUniformsiv"      , (void **) &qglGetActiveUniformsiv},
-       {"glGetActiveUniformName"     , (void **) &qglGetActiveUniformName},
-       {"glGetUniformBlockIndex"     , (void **) &qglGetUniformBlockIndex},
-       {"glGetActiveUniformBlockiv"  , (void **) &qglGetActiveUniformBlockiv},
+       {"glBindBuffer", (void **) &qglBindBuffer},
+       {"glDeleteBuffers", (void **) &qglDeleteBuffers},
+       {"glGenBuffers", (void **) &qglGenBuffers},
+       {"glIsBuffer", (void **) &qglIsBuffer},
+       {"glMapBuffer", (void **) &qglMapBuffer},
+       {"glUnmapBuffer", (void **) &qglUnmapBuffer},
+       {"glBufferData", (void **) &qglBufferData},
+       {"glBufferSubData", (void **) &qglBufferSubData},
+       {"glIsRenderbuffer", (void **) &qglIsRenderbuffer},
+       {"glBindRenderbuffer", (void **) &qglBindRenderbuffer},
+       {"glDeleteRenderbuffers", (void **) &qglDeleteRenderbuffers},
+       {"glGenRenderbuffers", (void **) &qglGenRenderbuffers},
+       {"glRenderbufferStorage", (void **) &qglRenderbufferStorage},
+       {"glRenderbufferStorageMultisample", (void **) &qglRenderbufferStorageMultisample},
+       {"glGetRenderbufferParameteriv", (void **) &qglGetRenderbufferParameteriv},
+       {"glIsFramebuffer", (void **) &qglIsFramebuffer},
+       {"glBindFramebuffer", (void **) &qglBindFramebuffer},
+       {"glDeleteFramebuffers", (void **) &qglDeleteFramebuffers},
+       {"glGenFramebuffers", (void **) &qglGenFramebuffers},
+       {"glCheckFramebufferStatus", (void **) &qglCheckFramebufferStatus},
+       {"glFramebufferTexture1D", (void **) &qglFramebufferTexture1D},
+       {"glFramebufferTexture2D", (void **) &qglFramebufferTexture2D},
+       {"glFramebufferTexture3D", (void **) &qglFramebufferTexture3D},
+       {"glFramebufferTextureLayer", (void **) &qglFramebufferTextureLayer},
+       {"glFramebufferRenderbuffer", (void **) &qglFramebufferRenderbuffer},
+       {"glGetFramebufferAttachmentParameteriv", (void **) &qglGetFramebufferAttachmentParameteriv},
+       {"glBlitFramebuffer", (void **) &qglBlitFramebuffer},
+       {"glGenerateMipmap", (void **) &qglGenerateMipmap},
+       {"glGetUniformIndices", (void **) &qglGetUniformIndices},
+       {"glGetActiveUniformsiv", (void **) &qglGetActiveUniformsiv},
+       {"glGetActiveUniformName", (void **) &qglGetActiveUniformName},
+       {"glGetUniformBlockIndex", (void **) &qglGetUniformBlockIndex},
+       {"glGetActiveUniformBlockiv", (void **) &qglGetActiveUniformBlockiv},
        {"glGetActiveUniformBlockName", (void **) &qglGetActiveUniformBlockName},
-       {"glBindBufferRange"          , (void **) &qglBindBufferRange},
-       {"glBindBufferBase"           , (void **) &qglBindBufferBase},
-       {"glGetIntegeri_v"            , (void **) &qglGetIntegeri_v},
-       {"glUniformBlockBinding"      , (void **) &qglUniformBlockBinding},
-       {NULL, NULL}
-};
-
-static dllfunction_t blendequationfuncs[] =
-{
-       {"glBlendEquationEXT", (void **) &qglBlendEquationEXT},
-       {NULL, NULL}
-};
-
-static dllfunction_t glsl130funcs[] =
-{
+       {"glBindBufferRange", (void **) &qglBindBufferRange},
+       {"glBindBufferBase", (void **) &qglBindBufferBase},
+       {"glGetIntegeri_v", (void **) &qglGetIntegeri_v},
+       {"glUniformBlockBinding", (void **) &qglUniformBlockBinding},
+       {"glBlendEquation", (void **) &qglBlendEquation},
+       {"glCompressedTexImage3D", (void **) &qglCompressedTexImage3D},
+       {"glCompressedTexImage2D", (void **) &qglCompressedTexImage2D},
+       {"glCompressedTexSubImage3D", (void **) &qglCompressedTexSubImage3D},
+       {"glCompressedTexSubImage2D", (void **) &qglCompressedTexSubImage2D},
+       {"glGetCompressedTexImage", (void **) &qglGetCompressedTexImage},
+       {"glGenQueries", (void **) &qglGenQueries},
+       {"glDeleteQueries", (void **) &qglDeleteQueries},
+       {"glIsQuery", (void **) &qglIsQuery},
+       {"glBeginQuery", (void **) &qglBeginQuery},
+       {"glEndQuery", (void **) &qglEndQuery},
+       {"glGetQueryiv", (void **) &qglGetQueryiv},
+       {"glGetQueryObjectiv", (void **) &qglGetQueryObjectiv},
+       {"glGetQueryObjectuiv", (void **) &qglGetQueryObjectuiv},
+       {"glDrawBuffers", (void **) &qglDrawBuffers},
+       {"glSampleCoverage", (void **) &qglSampleCoverage},
+       {"glBlendFuncSeparate", (void **) &qglBlendFuncSeparate},
        {"glBindFragDataLocation", (void **) &qglBindFragDataLocation},
        {NULL, NULL}
 };
 
-static dllfunction_t texturecompressionfuncs[] =
-{
-       {"glCompressedTexImage3DARB",    (void **) &qglCompressedTexImage3DARB},
-       {"glCompressedTexImage2DARB",    (void **) &qglCompressedTexImage2DARB},
-       {"glCompressedTexSubImage3DARB", (void **) &qglCompressedTexSubImage3DARB},
-       {"glCompressedTexSubImage2DARB", (void **) &qglCompressedTexSubImage2DARB},
-       {"glGetCompressedTexImageARB",   (void **) &qglGetCompressedTexImageARB},
-       {NULL, NULL}
-};
-
-static dllfunction_t occlusionqueryfuncs[] =
-{
-       {"glGenQueriesARB",              (void **) &qglGenQueriesARB},
-       {"glDeleteQueriesARB",           (void **) &qglDeleteQueriesARB},
-       {"glIsQueryARB",                 (void **) &qglIsQueryARB},
-       {"glBeginQueryARB",              (void **) &qglBeginQueryARB},
-       {"glEndQueryARB",                (void **) &qglEndQueryARB},
-       {"glGetQueryivARB",              (void **) &qglGetQueryivARB},
-       {"glGetQueryObjectivARB",        (void **) &qglGetQueryObjectivARB},
-       {"glGetQueryObjectuivARB",       (void **) &qglGetQueryObjectuivARB},
-       {NULL, NULL}
-};
-
-static dllfunction_t drawbuffersfuncs[] =
-{
-       {"glDrawBuffersARB",             (void **) &qglDrawBuffersARB},
-       {NULL, NULL}
-};
-
-static dllfunction_t multisamplefuncs[] =
-{
-       {"glSampleCoverageARB",          (void **) &qglSampleCoverageARB},
-       {NULL, NULL}
-};
-
-static dllfunction_t blendfuncseparatefuncs[] =
-{
-       {"glBlendFuncSeparateEXT", (void **) &qglBlendFuncSeparate},
-       {NULL, NULL}
-};
-
 static dllfunction_t debugoutputfuncs[] =
 {
        {"glDebugMessageControlARB", (void **)&qglDebugMessageControlARB},
@@ -783,23 +748,6 @@ void VID_ClearExtensions(void)
 
        // clear the extension flags
        memset(&vid.support, 0, sizeof(vid.support));
-       vid.renderpath = RENDERPATH_GL32;
-       vid.sRGBcapable2D = false;
-       vid.sRGBcapable3D = false;
-       vid.maxtexturesize_2d = 0;
-       vid.maxtexturesize_3d = 0;
-       vid.maxtexturesize_cubemap = 0;
-       vid.max_anisotropy = 1;
-       vid.maxdrawbuffers = 1;
-
-#ifndef USE_GLES2
-       // this is a complete list of all functions that are directly checked in the renderer
-       qglDrawBuffer = NULL;
-       qglFlush = NULL;
-       qglGetCompressedTexImageARB = NULL;
-       qglFramebufferTexture2D = NULL;
-       qglDrawBuffersARB = NULL;
-#endif
 }
 
 #ifndef USE_GLES2
@@ -821,30 +769,28 @@ void VID_CheckExtensions(void)
        if (vid.support.glshaderversion < 100)
                vid.support.glshaderversion = 100;
        Con_DPrintf("Detected GLSL #version %i\n", vid.support.glshaderversion);
-       // get the glBindFragDataLocation function
-       if (vid.support.glshaderversion >= 130)
-               vid.support.gl20shaders130 = GL_CheckExtension("glshaders130", glsl130funcs, "-noglsl130", true);
+       vid.support.gl20shaders130 = true;
 
        // GL drivers generally prefer GL_BGRA
        vid.forcetextype = GL_BGRA;
 
        vid.support.amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", NULL, "-notexture4", false);
-       vid.support.arb_draw_buffers = GL_CheckExtension("GL_ARB_draw_buffers", drawbuffersfuncs, "-nodrawbuffers", false);
-       vid.support.arb_occlusion_query = GL_CheckExtension("GL_ARB_occlusion_query", occlusionqueryfuncs, "-noocclusionquery", false);
-       vid.support.arb_query_buffer_object = GL_CheckExtension("GL_ARB_query_buffer_object", NULL, "-noquerybuffer", true);
-       vid.support.arb_texture_compression = GL_CheckExtension("GL_ARB_texture_compression", texturecompressionfuncs, "-notexturecompression", false);
+       vid.support.arb_draw_buffers = true;
+       vid.support.arb_occlusion_query = true;
+       vid.support.arb_query_buffer_object = true;
+       vid.support.arb_texture_compression = true;
        vid.support.arb_texture_gather = GL_CheckExtension("GL_ARB_texture_gather", NULL, "-notexturegather", false);
-       vid.support.ext_blend_minmax = GL_CheckExtension("GL_EXT_blend_minmax", blendequationfuncs, "-noblendminmax", false);
-       vid.support.ext_blend_subtract = GL_CheckExtension("GL_EXT_blend_subtract", blendequationfuncs, "-noblendsubtract", false);
-       vid.support.ext_blend_func_separate = GL_CheckExtension("GL_EXT_blend_func_separate", blendfuncseparatefuncs, "-noblendfuncseparate", false);
-       vid.support.ext_packed_depth_stencil = GL_CheckExtension("GL_EXT_packed_depth_stencil", NULL, "-nopackeddepthstencil", false);
+       vid.support.ext_blend_minmax = true;
+       vid.support.ext_blend_subtract = true;
+       vid.support.ext_blend_func_separate = true;
+       vid.support.ext_packed_depth_stencil = true;
        vid.support.ext_texture_compression_s3tc = GL_CheckExtension("GL_EXT_texture_compression_s3tc", NULL, "-nos3tc", false);
        vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false);
-       vid.support.ext_texture_srgb = GL_CheckExtension("GL_EXT_texture_sRGB", NULL, "-nosrgb", false);
-       vid.support.arb_texture_float = GL_CheckExtension("GL_ARB_texture_float", NULL, "-notexturefloat", false);
-       vid.support.arb_half_float_pixel = GL_CheckExtension("GL_ARB_half_float_pixel", NULL, "-nohalffloatpixel", false);
-       vid.support.arb_half_float_vertex = GL_CheckExtension("GL_ARB_half_float_vertex", NULL, "-nohalffloatvertex", false);
-       vid.support.arb_multisample = GL_CheckExtension("GL_ARB_multisample", multisamplefuncs, "-nomultisample", false);
+       vid.support.ext_texture_srgb = true;
+       vid.support.arb_texture_float = true;
+       vid.support.arb_half_float_pixel = true;
+       vid.support.arb_half_float_vertex = true;
+       vid.support.arb_multisample = true;
        vid.support.arb_debug_output = GL_CheckExtension("GL_ARB_debug_output", debugoutputfuncs, "-nogldebugoutput", false);
        vid.allowalphatocoverage = false;
 
@@ -872,7 +818,7 @@ void VID_CheckExtensions(void)
 // COMMANDLINEOPTION: GL: -nomultisample disables GL_ARB_multisample
 
        if (vid.support.arb_draw_buffers)
-               qglGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, (GLint*)&vid.maxdrawbuffers);
+               qglGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&vid.maxdrawbuffers);
 
        qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
        qglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, (GLint*)&vid.max_anisotropy);
@@ -882,16 +828,16 @@ void VID_CheckExtensions(void)
        vid.renderpath = RENDERPATH_GL32;
        vid.sRGBcapable2D = false;
        vid.sRGBcapable3D = true;
-       vid.allowalphatocoverage = true; // but see below, it may get turned to false again if GL_SAMPLES_ARB is <= 1
+       vid.allowalphatocoverage = true; // but see below, it may get turned to false again if GL_SAMPLES is <= 1
 
        // enable multisample antialiasing if possible
        if(vid.support.arb_multisample)
        {
                int samples = 0;
-               qglGetIntegerv(GL_SAMPLES_ARB, &samples);
+               qglGetIntegerv(GL_SAMPLES, &samples);
                vid.samples = samples;
                if (samples > 1)
-                       qglEnable(GL_MULTISAMPLE_ARB);
+                       qglEnable(GL_MULTISAMPLE);
                else
                        vid.allowalphatocoverage = false;
        }