change a lot of calls from gl to qgl
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 May 2002 03:58:00 +0000 (03:58 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 May 2002 03:58:00 +0000 (03:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1838 d7cf8633-e32d-0410-b094-e92efae38249

gl_models.c
gl_textures.c
r_clip.c
vid_3dfxsvga.c
vid_glx.c
vid_shared.c
vid_wgl.c

index 815ddb4..6f435a0 100644 (file)
@@ -26,16 +26,16 @@ rmeshinfo_t aliasmeshinfo;
 /*
 void GL_SetupModelTransform (vec3_t origin, vec3_t angles, vec_t scale)
 {
-       glTranslatef (origin[0], origin[1], origin[2]);
+       qglTranslatef (origin[0], origin[1], origin[2]);
 
        if (scale != 1)
-               glScalef (scale, scale, scale);
+               qglScalef (scale, scale, scale);
        if (angles[1])
-           glRotatef (angles[1],  0, 0, 1);
+           qglRotatef (angles[1],  0, 0, 1);
        if (angles[0])
-           glRotatef (-angles[0],  0, 1, 0);
+           qglRotatef (-angles[0],  0, 1, 0);
        if (angles[2])
-           glRotatef (angles[2],  1, 0, 0);
+           qglRotatef (angles[2],  1, 0, 0);
 }
 */
 
index 5648a1e..8961ffe 100644 (file)
@@ -462,7 +462,7 @@ char engineversion[40];
 static void r_textures_start(void)
 {
        // deal with size limits of various drivers (3dfx in particular)
-       glGetIntegerv(GL_MAX_TEXTURE_SIZE, &realmaxsize);
+       qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &realmaxsize);
        CHECKGLERROR
 
        // use the largest scrap texture size we can (not sure if this is really a good idea)
index ee67e2b..db77a80 100644 (file)
--- a/r_clip.c
+++ b/r_clip.c
@@ -880,20 +880,20 @@ void R_Clip_DisplayBuffer(void)
                return;
        if (clipwidth > 256 || clipheight > 256)
                return;
-       glBlendFunc(GL_ONE, GL_ONE);
-       glBindTexture(GL_TEXTURE_2D, 8000);
+       qglBlendFunc(GL_ONE, GL_ONE);
+       qglBindTexture(GL_TEXTURE_2D, 8000);
        if (firstupload)
        {
                memset(clipbuffertex, 0, sizeof(clipbuffertex));
-               glTexImage2D(GL_TEXTURE_2D, 0, 1, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
+               qglTexImage2D(GL_TEXTURE_2D, 0, 1, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
        }
-       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+       qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+       qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        if (lighthalf)
-               glColor4ub(0.5, 0.5, 0.5);
+               qglColor4ub(128, 128, 128, 255);
        else
-               glColor4ub(1, 1, 1);
+               qglColor4ub(255, 255, 255, 255);
        firstupload = false;
        b = clipbuffertex;
        for (i = 0;i < clipwidth*clipheight;i++)
@@ -903,16 +903,16 @@ void R_Clip_DisplayBuffer(void)
                else
                        *b++ = 0;
        }
-       glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, clipwidth, clipheight, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
-       glBegin (GL_QUADS);
-       glTexCoord2f (0                 , 0                  );glVertex2f (0           , 0            );
-       glTexCoord2f (clipwidth / 256.0f, 0                  );glVertex2f (vid.conwidth, 0            );
-       glTexCoord2f (clipwidth / 256.0f, clipheight / 256.0f);glVertex2f (vid.conwidth, vid.conheight);
-       glTexCoord2f (0                 , clipheight / 256.0f);glVertex2f (0           , vid.conheight);
-       glEnd ();
-       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-//     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-//     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+       qglTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, clipwidth, clipheight, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
+       qglBegin (GL_QUADS);
+       qglTexCoord2f (0                 , 0                  );qglVertex2f (0           , 0            );
+       qglTexCoord2f (clipwidth / 256.0f, 0                  );qglVertex2f (vid.conwidth, 0            );
+       qglTexCoord2f (clipwidth / 256.0f, clipheight / 256.0f);qglVertex2f (vid.conwidth, vid.conheight);
+       qglTexCoord2f (0                 , clipheight / 256.0f);qglVertex2f (0           , vid.conheight);
+       qglEnd ();
+       qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+//     qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+//     qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 #endif
        */
 }
index 00a0593..9cbb581 100644 (file)
@@ -127,7 +127,7 @@ void VID_SetupDithering(void)
                        dither_select(GR_DITHER_4x4);
                        Con_Printf ("4x4.\n");
                } else {
-                       glDisable(GL_DITHER);
+                       qglDisable(GL_DITHER);
                        Con_Printf ("disabled.\n");
                }
        }
@@ -151,7 +151,7 @@ void VID_Finish (void)
 {
        if (r_render.integer)
        {
-               glFinish();
+               qglFinish();
                fxMesaSwapBuffers();
        }
 }
index 878429c..bb42edc 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -489,7 +489,7 @@ void VID_Finish (void)
        int usemouse;
        if (r_render.integer)
        {
-               glFinish();
+               qglFinish();
                glXSwapBuffers(vidx11_display, win);
        }
 
index c0b9fba..1e9a963 100644 (file)
@@ -330,7 +330,7 @@ void VID_CheckExtensions(void)
 
        if (gl_checkextension("GL_ARB_multitexture", multitexturefuncs, "-nomtex"))
        {
-               glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_textureunits);
+               qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_textureunits);
                if (gl_textureunits > 1)
                        gl_combine_extension = gl_checkextension("GL_ARB_texture_env_combine", NULL, "-nocombine") || gl_checkextension("GL_EXT_texture_env_combine", NULL, "-nocombine");
                else
index 08f7cdd..d8ca765 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -380,7 +380,7 @@ void VID_Finish (void)
        int usemouse;
        if (r_render.integer && !scr_skipupdate)
        {
-               glFinish();
+               qglFinish();
                SwapBuffers(maindc);
        }
 
@@ -437,7 +437,7 @@ void        VID_Shutdown (void)
                // LordHavoc: free textures before closing (may help NVIDIA)
                for (i = 0;i < 8192;i++)
                        temp[i] = i+1;
-               glDeleteTextures(8192, temp);
+               qglDeleteTextures(8192, temp);
 
        if (hRC)
            wglDeleteContext(hRC);