diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 394802add..6b183de90 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -224,7 +224,7 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name)) qglMultiTexCoord2fARB = (void *) getglext("glMultiTexCoord2fARB"); qglMultiTexCoord3fARB = (void *) getglext("glMultiTexCoord3fARB"); - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_mtexarbable); + qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_mtexarbable); gl_mtexable = true; qglMTexCoord2fSGIS = qglMultiTexCoord2fARB; @@ -514,38 +514,38 @@ void GL_Init(void *(*getglfunction) (char *name)) - gl_vendor = glGetString (GL_VENDOR); + gl_vendor = qglGetString (GL_VENDOR); Con_SafePrintf ("GL_VENDOR: %s\n", gl_vendor); - gl_renderer = glGetString (GL_RENDERER); + gl_renderer = qglGetString (GL_RENDERER); Con_SafePrintf ("GL_RENDERER: %s\n", gl_renderer); - gl_version = glGetString (GL_VERSION); + gl_version = qglGetString (GL_VERSION); Con_SafePrintf ("GL_VERSION: %s\n", gl_version); - gl_extensions = glGetString (GL_EXTENSIONS); + gl_extensions = qglGetString (GL_EXTENSIONS); Con_DPrintf ("GL_EXTENSIONS: %s\n", gl_extensions); GL_CheckExtensions (getglfunction); - glClearColor (0,0,0,0); //clear to black so that it looks a little nicer on start. - glClear(GL_COLOR_BUFFER_BIT); - glCullFace(GL_FRONT); - glEnable(GL_TEXTURE_2D); + qglClearColor (0,0,0,0); //clear to black so that it looks a little nicer on start. + qglClear(GL_COLOR_BUFFER_BIT); + qglCullFace(GL_FRONT); + qglEnable(GL_TEXTURE_2D); - glEnable(GL_ALPHA_TEST); - glAlphaFunc(GL_GREATER, 0.666); + qglEnable(GL_ALPHA_TEST); + qglAlphaFunc(GL_GREATER, 0.666); - glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); - glShadeModel (GL_FLAT); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + qglShadeModel (GL_FLAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); +// qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); } unsigned int d_8to24rgbtable[256]; diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 7212bbc32..bc684f5a3 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -134,7 +134,7 @@ PROC glTexCoordPointerEXT; PROC glVertexPointerEXT; typedef void (APIENTRY *lp3DFXFUNC) (int, int, int, int, int, const void*); -lp3DFXFUNC glColorTableEXT; +lp3DFXFUNC qglColorTableEXT; qboolean is8bit = false; qboolean isPermedia = false; @@ -774,8 +774,8 @@ qboolean VID_AttachGL (rendererstate_t *info) } _vid_wait_override.modified = false; TRACE(("dbg: VID_AttachGL: qSwapBuffers\n")); - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); + qglClearColor(0, 0, 0, 0); + qglClear(GL_COLOR_BUFFER_BIT); qSwapBuffers(maindc); return true; @@ -1273,13 +1273,13 @@ void VID_Init8bitPalette() char thePalette[256*3]; char *oldPalette, *newPalette; - glColorTableEXT = (void *)qwglGetProcAddress("glColorTableEXT"); - if (!glColorTableEXT || strstr(gl_extensions, "GL_EXT_shared_texture_palette") || + qglColorTableEXT = (void *)qwglGetProcAddress("glColorTableEXT"); + if (!qglColorTableEXT || strstr(gl_extensions, "GL_EXT_shared_texture_palette") || COM_CheckParm("-no8bit")) return; Con_SafePrintf("8-bit GL extensions enabled.\n"); - glEnable( GL_SHARED_TEXTURE_PALETTE_EXT ); + qglEnable( GL_SHARED_TEXTURE_PALETTE_EXT ); oldPalette = (char *) d_8to24rgbtable; //d_8to24table3dfx; newPalette = thePalette; for (i=0;i<256;i++) { @@ -1288,7 +1288,7 @@ void VID_Init8bitPalette() *newPalette++ = *oldPalette++; oldPalette++; } - glColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, + qglColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, (void *) thePalette); is8bit = TRUE; } diff --git a/engine/gl/gl_vidsdl.c b/engine/gl/gl_vidsdl.c index 707d60af8..80736d7d4 100644 --- a/engine/gl/gl_vidsdl.c +++ b/engine/gl/gl_vidsdl.c @@ -89,7 +89,7 @@ Con_Printf("Getting gamma\n"); GLVID_SetPalette (palette); GL_Init(SDL_GL_GetProcAddress); - glViewport (0, 0, glwidth, glheight); + qglViewport (0, 0, glwidth, glheight); mouseactive = false; if (vid_isfullscreen) @@ -119,7 +119,7 @@ void GL_BeginRendering (int *x, int *y, int *width, int *height) // if (!wglMakeCurrent( maindc, baseRC )) // Sys_Error ("wglMakeCurrent failed"); -// glViewport (*x, *y, *width, *height); +// qglViewport (*x, *y, *width, *height); } qboolean screenflush; diff --git a/engine/gl/gl_warp.c b/engine/gl/gl_warp.c index cbff6ac4e..6b9a5f955 100644 --- a/engine/gl/gl_warp.c +++ b/engine/gl/gl_warp.c @@ -222,10 +222,10 @@ void EmitWaterPolys (msurface_t *fa, float basealpha) { float f = 10; - glEnable(GL_AUTO_NORMAL); + qglEnable(GL_AUTO_NORMAL); for (p=fa->polys ; p ; p=p->next) { - glBegin (GL_POLYGON); + qglBegin (GL_POLYGON); for (i=0,v=p->verts[0] ; inumverts ; i++, v+=VERTEXSIZE) { os = v[3]; @@ -237,28 +237,28 @@ void EmitWaterPolys (msurface_t *fa, float basealpha) t = ot + turbsin[(int)((os*0.125+realtime) * TURBSCALE) & 255]; t *= (1.0/64); - glNormal3f(fa->plane->normal[0] + (sin(realtime+v[0]/f+v[1]/f))/4, fa->plane->normal[1] +(sin(realtime-v[1]/f))/4, fa->plane->normal[2] + (sin(realtime+v[2]/f))/4); - glTexCoord2f (s, t); - glVertex3fv (v); + qglNormal3f(fa->plane->normal[0] + (sin(realtime+v[0]/f+v[1]/f))/4, fa->plane->normal[1] +(sin(realtime-v[1]/f))/4, fa->plane->normal[2] + (sin(realtime+v[2]/f))/4); + qglTexCoord2f (s, t); + qglVertex3fv (v); } - glEnd (); + qglEnd (); } - glDisable(GL_AUTO_NORMAL); + qglDisable(GL_AUTO_NORMAL); } else if (r_waterlayers.value>=1) { float a, stm, ttm; int l; - glDisable(GL_ALPHA_TEST); - glEnable(GL_BLEND); //to ensure. + qglDisable(GL_ALPHA_TEST); + qglEnable(GL_BLEND); //to ensure. for (a=basealpha,l = 0; l < r_waterlayers.value; l++,a=a*4/6) { - glColor4f(1, 1, 1, a); + qglColor4f(1, 1, 1, a); stm =cos(l)/10; ttm =sin(l)/10; for (p=fa->polys ; p ; p=p->next) { - glBegin (GL_POLYGON); + qglBegin (GL_POLYGON); for (i=0,v=p->verts[0] ; inumverts ; i++, v+=VERTEXSIZE) { os = v[3]/(l*0.5+0.2); @@ -270,10 +270,10 @@ void EmitWaterPolys (msurface_t *fa, float basealpha) t = ot + turbsin[(int)((os*0.125+cl.time+l*8) * TURBSCALE) & 255];//*r_watersurfacewarp.value; t *= (1.0/64); - glTexCoord2f (s+cl.time*stm, t+cl.time*ttm); - glVertex3fv (v); + qglTexCoord2f (s+cl.time*stm, t+cl.time*ttm); + qglVertex3fv (v); } - glEnd (); + qglEnd (); } } @@ -283,7 +283,7 @@ void EmitWaterPolys (msurface_t *fa, float basealpha) #endif for (p=fa->polys ; p ; p=p->next) { - glBegin (GL_POLYGON); + qglBegin (GL_POLYGON); for (i=0,v=p->verts[0] ; inumverts ; i++, v+=VERTEXSIZE) { os = v[3]; @@ -295,10 +295,10 @@ void EmitWaterPolys (msurface_t *fa, float basealpha) t = ot + turbsin[(int)((os*0.125+realtime) * TURBSCALE) & 255]; t *= (1.0/64); - glTexCoord2f (s, t); - glVertex3fv (v); + qglTexCoord2f (s, t); + qglVertex3fv (v); } - glEnd (); + qglEnd (); } #ifdef WATERLAYERS } @@ -327,16 +327,16 @@ void EmitSkyPolys (msurface_t *fa) extern void GL_DrawAliasMesh (mesh_t *mesh, int texnum); fa->mesh->colors_array = NULL; - glDisable(GL_TEXTURE_2D); - glColor3f(0,0,0); + qglDisable(GL_TEXTURE_2D); + qglColor3f(0,0,0); GL_DrawAliasMesh(fa->mesh, 1); - glEnable(GL_TEXTURE_2D); + qglEnable(GL_TEXTURE_2D); } else { for (p=fa->polys ; p ; p=p->next) { - glBegin (GL_POLYGON); + qglBegin (GL_POLYGON); for (i=0,v=p->verts[0] ; inumverts ; i++, v+=VERTEXSIZE) { VectorSubtract (v, r_origin, dir); @@ -352,10 +352,10 @@ void EmitSkyPolys (msurface_t *fa) s = (speedscale + dir[0]) * (1.0/128); t = (speedscale + dir[1]) * (1.0/128); - glTexCoord2f (s, t); - glVertex3fv (v); + qglTexCoord2f (s, t); + qglVertex3fv (v); } - glEnd (); + qglEnd (); } } } @@ -379,14 +379,14 @@ void EmitBothSkyLayers (msurface_t *fa) EmitSkyPolys (fa); - glEnable (GL_BLEND); + qglEnable (GL_BLEND); GL_Bind (alphaskytexture); speedscale = cl.gametime*16; speedscale -= (int)speedscale & ~127 ; EmitSkyPolys (fa); - glDisable (GL_BLEND); + qglDisable (GL_BLEND); } /* @@ -411,13 +411,13 @@ void R_DrawSkyChain (msurface_t *s) if (fc < 0) fc = 0; pal = host_basepal+fc*3; - glDisable(GL_TEXTURE_2D); - glColor3f(pal[0]/255.0f, pal[1]/255.0f, pal[2]/255.0f); + qglDisable(GL_TEXTURE_2D); + qglColor3f(pal[0]/255.0f, pal[1]/255.0f, pal[2]/255.0f); for (fa=s ; fa ; fa=fa->texturechain) EmitSkyPolys (fa); - glColor3f(1, 1, 1); - glEnable(GL_TEXTURE_2D); + qglColor3f(1, 1, 1); + qglEnable(GL_TEXTURE_2D); return; } @@ -437,7 +437,7 @@ void R_DrawSkyChain (msurface_t *s) for (fa=s ; fa ; fa=fa->texturechain) EmitSkyPolys (fa); - glEnable (GL_BLEND); + qglEnable (GL_BLEND); GL_Bind (alphaskytexture); speedscale = cl.gametime; speedscale += realtime - cl.gametimemark; @@ -447,7 +447,7 @@ void R_DrawSkyChain (msurface_t *s) for (fa=s ; fa ; fa=fa->texturechain) EmitSkyPolys (fa); - glDisable (GL_BLEND); + qglDisable (GL_BLEND); } /* @@ -477,8 +477,8 @@ void R_LoadSkys (void) skyboxtex[i] = Mod_LoadHiResTexture(name, false, false, true); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); } Q_strncpyz(loadedskybox, gl_skyboxname.string, sizeof(loadedskybox)); gl_skyboxname.modified = false; @@ -761,7 +761,7 @@ void R_DrawSkyBoxChain (msurface_t *s) R_DrawSkyBox (s); - glColorMask(0, 0, 0, 0); + qglColorMask(0, 0, 0, 0); for (fa=s ; fa ; fa=fa->texturechain) { if (fa->mesh) @@ -770,14 +770,14 @@ void R_DrawSkyBoxChain (msurface_t *s) { for (p=fa->polys ; p ; p=p->next) { - glBegin(GL_POLYGON); + qglBegin(GL_POLYGON); for (i = 0; i < p->numverts; i++) - glVertex3fv(p->verts[i]); - glEnd(); + qglVertex3fv(p->verts[i]); + qglEnd(); } } } - glColorMask(1, 1, 1, 1); + qglColorMask(1, 1, 1, 1); } void R_AddSkySurface (msurface_t *fa) @@ -868,8 +868,8 @@ void MakeSkyVec (float s, float t, int axis) t = 511.0/512; t = 1.0 - t; - glTexCoord2f (s, t); - glVertex3fv (v); + qglTexCoord2f (s, t); + qglVertex3fv (v); } /* @@ -888,10 +888,10 @@ void R_DrawSkyBox (msurface_t *s) return; #if 0 -glEnable (GL_BLEND); -glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); -glColor4f (1,1,1,0.5); -glDisable (GL_DEPTH_TEST); +qglEnable (GL_BLEND); +qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); +qglColor4f (1,1,1,0.5); +qglDisable (GL_DEPTH_TEST); #endif for (i=0 ; i<6 ; i++) { @@ -906,23 +906,23 @@ skymins[1][i] = -1; skymaxs[0][i] = 1; skymaxs[1][i] = 1; #endif - glBegin (GL_QUADS); + qglBegin (GL_QUADS); MakeSkyVec (skymins[0][i], skymins[1][i], i); MakeSkyVec (skymins[0][i], skymaxs[1][i], i); MakeSkyVec (skymaxs[0][i], skymaxs[1][i], i); MakeSkyVec (skymaxs[0][i], skymins[1][i], i); - glEnd (); + qglEnd (); } #if 0 -glDisable (GL_BLEND); -glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); -glColor4f (1,1,1,0.5); -glEnable (GL_DEPTH_TEST); +qglDisable (GL_BLEND); +qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); +qglColor4f (1,1,1,0.5); +qglEnable (GL_DEPTH_TEST); #endif if (!cls.allow_skyboxes && s) //allow a little extra fps. { - glColorMask(0, 0, 0, 0); //depth only. + qglColorMask(0, 0, 0, 0); //depth only. for (fa = s; fa; fa = fa->texturechain) { if (fa->mesh) @@ -931,14 +931,14 @@ glEnable (GL_DEPTH_TEST); { for (poly = fa->polys; poly; poly = poly->next) { - glBegin (GL_POLYGON); + qglBegin (GL_POLYGON); for (i = 0; i < poly->numverts; i++) - glVertex3fv (&poly->verts[0][0]+i*VERTEXSIZE); - glEnd (); + qglVertex3fv (&poly->verts[0][0]+i*VERTEXSIZE); + qglEnd (); } } } - glColorMask(1, 1, 1, 1); + qglColorMask(1, 1, 1, 1); } } diff --git a/engine/gl/glmod_doom.c b/engine/gl/glmod_doom.c index a0dbef352..941a7107e 100644 --- a/engine/gl/glmod_doom.c +++ b/engine/gl/glmod_doom.c @@ -332,16 +332,16 @@ static void GLR_DrawWall(unsigned short texnum, unsigned short s, unsigned short GL_Bind(tex->gltexture); - glBegin(GL_QUADS); - glTexCoord2f(s1, t2); - glVertex3f(x1, y1, frontfloor); - glTexCoord2f(s1, t1); - glVertex3f(x1, y1, backfloor); - glTexCoord2f(s2, t1); - glVertex3f(x2, y2, backfloor); - glTexCoord2f(s2, t2); - glVertex3f(x2, y2, frontfloor); - glEnd(); + qglBegin(GL_QUADS); + qglTexCoord2f(s1, t2); + qglVertex3f(x1, y1, frontfloor); + qglTexCoord2f(s1, t1); + qglVertex3f(x1, y1, backfloor); + qglTexCoord2f(s2, t1); + qglVertex3f(x2, y2, backfloor); + qglTexCoord2f(s2, t2); + qglVertex3f(x2, y2, frontfloor); + qglEnd(); } static void GLR_DrawSSector(unsigned int ssec) @@ -357,7 +357,7 @@ static void GLR_DrawSSector(unsigned int ssec) break; sec = sectorm + sidedefsm[linedefsl[segsl[seg].linedef].sidedef[segsl[seg].direction]].sector; - glColor4ub(sec->lightlev, sec->lightlev, sec->lightlev, 255); + qglColor4ub(sec->lightlev, sec->lightlev, sec->lightlev, 255); sec->visframe = r_visframecount; for (seg = ssectorsl[ssec].first + ssectorsl[ssec].segcount-1; seg >= ssectorsl[ssec].first; seg--) { @@ -636,45 +636,45 @@ qboolean GLR_DoomWorld(void) if (!nodel || !nodec) return true; //err... buggy - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisable(GL_BLEND); - glDisable(GL_ALPHA_TEST); - glEnable(GL_CULL_FACE); + qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + qglDisable(GL_BLEND); + qglDisable(GL_ALPHA_TEST); + qglEnable(GL_CULL_FACE); GL_DisableMultitexture(); r_visframecount++; GLR_RecursiveDoomNode(nodec-1); if (developer.value) - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE); for (i = 0; i < sectorc; i++) { if (sectorm[i].visframe == r_visframecount) { - glColor4ub(sectorm[i].lightlev, sectorm[i].lightlev, sectorm[i].lightlev, 255); + qglColor4ub(sectorm[i].lightlev, sectorm[i].lightlev, sectorm[i].lightlev, 255); GL_Bind(sectorm[i].floortex); - glBegin(GL_TRIANGLES); + qglBegin(GL_TRIANGLES); for (v = 0; v < sectorm[i].numflattris*3; v++) { v1 = sectorm[i].flats[v]; - glTexCoord2f(vertexesl[v1].xpos/64.0f, vertexesl[v1].ypos/64.0f); - glVertex3f(vertexesl[v1].xpos, vertexesl[v1].ypos, sectorm[i].floorheight); + qglTexCoord2f(vertexesl[v1].xpos/64.0f, vertexesl[v1].ypos/64.0f); + qglVertex3f(vertexesl[v1].xpos, vertexesl[v1].ypos, sectorm[i].floorheight); } - glEnd(); + qglEnd(); GL_Bind(sectorm[i].ceilingtex); - glBegin(GL_TRIANGLES); + qglBegin(GL_TRIANGLES); for (v = sectorm[i].numflattris*3-1; v >= 0; v--) { v1 = sectorm[i].flats[v]; - glTexCoord2f(vertexesl[v1].xpos/64.0f, vertexesl[v1].ypos/64.0f); - glVertex3f(vertexesl[v1].xpos, vertexesl[v1].ypos, sectorm[i].ceilingheight); + qglTexCoord2f(vertexesl[v1].xpos/64.0f, vertexesl[v1].ypos/64.0f); + qglVertex3f(vertexesl[v1].xpos, vertexesl[v1].ypos, sectorm[i].ceilingheight); } - glEnd(); + qglEnd(); c_brush_polys += sectorm[i].numflattris; } } - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); return true; } #endif