if (r_speeds.integer < 2 || !r_timereport_active)
return;
- qglFinish();
+ CHECKGLERROR
+ qglFinish();CHECKGLERROR
r_timereport_temp = r_timereport_current;
r_timereport_current = Sys_DoubleTime();
t = (int) ((r_timereport_current - r_timereport_temp) * 1000000.0 + 0.5);
unsigned char *b, *out;
char filename[32];
int outoffset = (width/2)*(height/2);
+ CHECKGLERROR
//return SCR_ScreenShot(filename, cls.capturevideo_buffer, cls.capturevideo_buffer + vid.width * vid.height * 3, cls.capturevideo_buffer + vid.width * vid.height * 6, 0, 0, vid.width, vid.height, false, false, false, jpeg, true);
// speed is critical here, so do saving as directly as possible
switch (cls.capturevideo_format)
{
case CAPTUREVIDEOFORMAT_RAWYV12:
// FIXME: width/height must be multiple of 2, enforce this?
- qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);
- CHECKGLERROR
+ qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);CHECKGLERROR
// process one line at a time, and CbCr every other line at 2 pixel intervals
for (y = 0;y < height;y++)
{
return false;
return true;
case CAPTUREVIDEOFORMAT_RAWRGB:
- qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);
- CHECKGLERROR
+ qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);CHECKGLERROR
for (;cls.capturevideo_frame < newframenum;cls.capturevideo_frame++)
if (!FS_Write (cls.capturevideo_videofile, cls.capturevideo_buffer, width*height*3))
return false;
return true;
case CAPTUREVIDEOFORMAT_JPEG:
- qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);
- CHECKGLERROR
+ qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, cls.capturevideo_buffer);CHECKGLERROR
for (;cls.capturevideo_frame < newframenum;cls.capturevideo_frame++)
{
sprintf(filename, "video/dp%06d.jpg", cls.capturevideo_frame);
cls.capturevideo_buffer[14] = (height >> 0) & 0xFF;
cls.capturevideo_buffer[15] = (height >> 8) & 0xFF;
cls.capturevideo_buffer[16] = 24; // pixel size
- qglReadPixels (x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, cls.capturevideo_buffer + 18);
- CHECKGLERROR
+ qglReadPixels (x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, cls.capturevideo_buffer + 18);CHECKGLERROR
for (;cls.capturevideo_frame < newframenum;cls.capturevideo_frame++)
{
sprintf(filename, "video/dp%06d.tga", cls.capturevideo_frame);
if (!r_render.integer)
return false;
- qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer1);
CHECKGLERROR
+ qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer1);CHECKGLERROR
if (scr_screenshot_gammaboost.value != 1 && gammacorrect)
{
if (r_render.integer)
{
// clear to black
+ CHECKGLERROR
if (fogenabled)
- qglClearColor(fogcolor[0],fogcolor[1],fogcolor[2],0);
+ {
+ qglClearColor(fogcolor[0],fogcolor[1],fogcolor[2],0);CHECKGLERROR
+ }
else
- qglClearColor(0,0,0,0);
- CHECKGLERROR
+ {
+ qglClearColor(0,0,0,0);CHECKGLERROR
+ }
qglClearDepth(1);CHECKGLERROR
if (gl_stencil)
{
// don't do anything if not initialized yet
if (vid_hidden)
return;
- qglViewport(0, 0, vid.width, vid.height);
- //qglDisable(GL_SCISSOR_TEST);
- //qglDepthMask(1);
- qglColorMask(1,1,1,1);
- //qglClearColor(0,0,0,0);
- //qglClear(GL_COLOR_BUFFER_BIT);
- //qglCullFace(GL_FRONT);
- //qglDisable(GL_CULL_FACE);
+ CHECKGLERROR
+ qglViewport(0, 0, vid.width, vid.height);CHECKGLERROR
+ //qglDisable(GL_SCISSOR_TEST);CHECKGLERROR
+ //qglDepthMask(1);CHECKGLERROR
+ qglColorMask(1,1,1,1);CHECKGLERROR
+ //qglClearColor(0,0,0,0);CHECKGLERROR
+ //qglClear(GL_COLOR_BUFFER_BIT);CHECKGLERROR
+ //qglCullFace(GL_FRONT);CHECKGLERROR
+ //qglDisable(GL_CULL_FACE);CHECKGLERROR
//R_ClearScreen();
R_Textures_Frame();
GL_SetupView_Mode_Ortho(0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100);
R_TimeReport("start");
CHECKGLERROR
- qglViewport(0, 0, vid.width, vid.height);
- qglDisable(GL_SCISSOR_TEST);
- qglDepthMask(1);
- qglColorMask(1,1,1,1);
- qglClearColor(0,0,0,0);
- qglClear(GL_COLOR_BUFFER_BIT);
- CHECKGLERROR
+ qglViewport(0, 0, vid.width, vid.height);CHECKGLERROR
+ qglDisable(GL_SCISSOR_TEST);CHECKGLERROR
+ qglDepthMask(1);CHECKGLERROR
+ qglColorMask(1,1,1,1);CHECKGLERROR
+ qglClearColor(0,0,0,0);CHECKGLERROR
+ qglClear(GL_COLOR_BUFFER_BIT);CHECKGLERROR
if (r_timereport_active)
R_TimeReport("clear");
return;
// set up viewpoint
+ CHECKGLERROR
qglMatrixMode(GL_PROJECTION);CHECKGLERROR
qglLoadIdentity();CHECKGLERROR
// set view pyramid
qglFrustum(-frustumx * zNear, frustumx * zNear, -frustumy * zNear, frustumy * zNear, zNear, zFar);CHECKGLERROR
- qglGetDoublev(GL_PROJECTION_MATRIX, m);
+ qglGetDoublev(GL_PROJECTION_MATRIX, m);CHECKGLERROR
backend_projectmatrix.m[0][0] = m[0];
backend_projectmatrix.m[1][0] = m[1];
backend_projectmatrix.m[2][0] = m[2];
backend_projectmatrix.m[3][3] = m[15];
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
GL_SetupView_Orientation_Identity();
+ CHECKGLERROR
}
void GL_SetupView_Mode_PerspectiveInfiniteFarClip (double frustumx, double frustumy, double zNear)
return;
// set up viewpoint
+ CHECKGLERROR
qglMatrixMode(GL_PROJECTION);CHECKGLERROR
qglLoadIdentity();CHECKGLERROR
// set view pyramid
m[13] = 0;
m[14] = -2 * zNear * nudge;
m[15] = 0;
- qglLoadMatrixd(m);
+ qglLoadMatrixd(m);CHECKGLERROR
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
GL_SetupView_Orientation_Identity();
+ CHECKGLERROR
backend_projectmatrix.m[0][0] = m[0];
backend_projectmatrix.m[1][0] = m[1];
backend_projectmatrix.m[2][0] = m[2];
return;
// set up viewpoint
+ CHECKGLERROR
qglMatrixMode(GL_PROJECTION);CHECKGLERROR
qglLoadIdentity();CHECKGLERROR
- qglOrtho(x1, x2, y2, y1, zNear, zFar);
- qglGetDoublev(GL_PROJECTION_MATRIX, m);
+ qglOrtho(x1, x2, y2, y1, zNear, zFar);CHECKGLERROR
+ qglGetDoublev(GL_PROJECTION_MATRIX, m);CHECKGLERROR
backend_projectmatrix.m[0][0] = m[0];
backend_projectmatrix.m[1][0] = m[1];
backend_projectmatrix.m[2][0] = m[2];
backend_projectmatrix.m[3][3] = m[15];
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
GL_SetupView_Orientation_Identity();
+ CHECKGLERROR
}
typedef struct gltextureunit_s
{
qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
}
- qglMatrixMode(GL_TEXTURE);
- qglLoadIdentity();
- qglMatrixMode(GL_MODELVIEW);
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
+ qglLoadIdentity();CHECKGLERROR
+ qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
if (gl_combine.integer)
{
qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);CHECKGLERROR
{
qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);CHECKGLERROR
}
+ CHECKGLERROR
}
CHECKGLERROR
}
gl_state.unit = num;
if (qglActiveTexture)
{
+ CHECKGLERROR
qglActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
CHECKGLERROR
}
gl_state.clientunit = num;
if (qglActiveTexture)
{
+ CHECKGLERROR
qglClientActiveTexture(GL_TEXTURE0_ARB + gl_state.clientunit);
CHECKGLERROR
}
{
if (gl_state.blendfunc1 != blendfunc1 || gl_state.blendfunc2 != blendfunc2)
{
+ CHECKGLERROR
qglBlendFunc(gl_state.blendfunc1 = blendfunc1, gl_state.blendfunc2 = blendfunc2);CHECKGLERROR
if (gl_state.blendfunc2 == GL_ZERO)
{
{
if (gl_state.depthmask != state)
{
+ CHECKGLERROR
qglDepthMask(gl_state.depthmask = state);CHECKGLERROR
}
}
if (gl_state.depthtest != state)
{
gl_state.depthtest = state;
+ CHECKGLERROR
if (gl_state.depthtest)
{
qglEnable(GL_DEPTH_TEST);CHECKGLERROR
if (gl_state.alphatest != state)
{
gl_state.alphatest = state;
+ CHECKGLERROR
if (gl_state.alphatest)
{
qglEnable(GL_ALPHA_TEST);CHECKGLERROR
if (gl_state.colormask != state)
{
gl_state.colormask = state;
+ CHECKGLERROR
qglColorMask((GLboolean)r, (GLboolean)g, (GLboolean)b, (GLboolean)a);CHECKGLERROR
}
}
void GL_Clear(int mask)
{
+ CHECKGLERROR
qglClear(mask);CHECKGLERROR
}
{
BACKENDACTIVECHECK
CHECKGLERROR
+ if (gl_printcheckerror.integer && !gl_paranoid.integer)
+ {
+ Con_Printf("WARNING: gl_printcheckerror is on but gl_paranoid is off, turning it on...\n");
+ Cvar_SetValueQuick(&gl_paranoid, 1);
+ }
GL_Backend_ResetState();
}
char compilelog[MAX_INPUTLINE];
CHECKGLERROR
- programobject = qglCreateProgramObjectARB();
- CHECKGLERROR
+ programobject = qglCreateProgramObjectARB();CHECKGLERROR
if (!programobject)
return 0;
if (vertexstrings_count)
{
- CHECKGLERROR
- vertexshaderobject = qglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
+ vertexshaderobject = qglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);CHECKGLERROR
if (!vertexshaderobject)
{
qglDeleteObjectARB(programobject);
CHECKGLERROR
return 0;
}
- qglShaderSourceARB(vertexshaderobject, vertexstrings_count, vertexstrings_list, NULL);
- qglCompileShaderARB(vertexshaderobject);
- CHECKGLERROR
- qglGetObjectParameterivARB(vertexshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &vertexshadercompiled);
- qglGetInfoLogARB(vertexshaderobject, sizeof(compilelog), NULL, compilelog);
+ qglShaderSourceARB(vertexshaderobject, vertexstrings_count, vertexstrings_list, NULL);CHECKGLERROR
+ qglCompileShaderARB(vertexshaderobject);CHECKGLERROR
+ qglGetObjectParameterivARB(vertexshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &vertexshadercompiled);CHECKGLERROR
+ qglGetInfoLogARB(vertexshaderobject, sizeof(compilelog), NULL, compilelog);CHECKGLERROR
if (compilelog[0])
Con_DPrintf("vertex shader compile log:\n%s\n", compilelog);
if (!vertexshadercompiled)
{
- qglDeleteObjectARB(programobject);
- qglDeleteObjectARB(vertexshaderobject);
- CHECKGLERROR
+ qglDeleteObjectARB(programobject);CHECKGLERROR
+ qglDeleteObjectARB(vertexshaderobject);CHECKGLERROR
return 0;
}
- qglAttachObjectARB(programobject, vertexshaderobject);
- qglDeleteObjectARB(vertexshaderobject);
- CHECKGLERROR
+ qglAttachObjectARB(programobject, vertexshaderobject);CHECKGLERROR
+ qglDeleteObjectARB(vertexshaderobject);CHECKGLERROR
}
if (fragmentstrings_count)
{
- CHECKGLERROR
- fragmentshaderobject = qglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
+ fragmentshaderobject = qglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);CHECKGLERROR
if (!fragmentshaderobject)
{
- qglDeleteObjectARB(programobject);
- CHECKGLERROR
+ qglDeleteObjectARB(programobject);CHECKGLERROR
return 0;
}
- qglShaderSourceARB(fragmentshaderobject, fragmentstrings_count, fragmentstrings_list, NULL);
- qglCompileShaderARB(fragmentshaderobject);
- CHECKGLERROR
- qglGetObjectParameterivARB(fragmentshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &fragmentshadercompiled);
- qglGetInfoLogARB(fragmentshaderobject, sizeof(compilelog), NULL, compilelog);
+ qglShaderSourceARB(fragmentshaderobject, fragmentstrings_count, fragmentstrings_list, NULL);CHECKGLERROR
+ qglCompileShaderARB(fragmentshaderobject);CHECKGLERROR
+ qglGetObjectParameterivARB(fragmentshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &fragmentshadercompiled);CHECKGLERROR
+ qglGetInfoLogARB(fragmentshaderobject, sizeof(compilelog), NULL, compilelog);CHECKGLERROR
if (compilelog[0])
Con_DPrintf("fragment shader compile log:\n%s\n", compilelog);
if (!fragmentshadercompiled)
{
- qglDeleteObjectARB(programobject);
- qglDeleteObjectARB(fragmentshaderobject);
- CHECKGLERROR
+ qglDeleteObjectARB(programobject);CHECKGLERROR
+ qglDeleteObjectARB(fragmentshaderobject);CHECKGLERROR
return 0;
}
- qglAttachObjectARB(programobject, fragmentshaderobject);
- qglDeleteObjectARB(fragmentshaderobject);
- CHECKGLERROR
+ qglAttachObjectARB(programobject, fragmentshaderobject);CHECKGLERROR
+ qglDeleteObjectARB(fragmentshaderobject);CHECKGLERROR
}
- qglLinkProgramARB(programobject);
- CHECKGLERROR
- qglGetObjectParameterivARB(programobject, GL_OBJECT_LINK_STATUS_ARB, &programlinked);
- qglGetInfoLogARB(programobject, sizeof(compilelog), NULL, compilelog);
+ qglLinkProgramARB(programobject);CHECKGLERROR
+ qglGetObjectParameterivARB(programobject, GL_OBJECT_LINK_STATUS_ARB, &programlinked);CHECKGLERROR
+ qglGetInfoLogARB(programobject, sizeof(compilelog), NULL, compilelog);CHECKGLERROR
if (compilelog[0])
{
Con_DPrintf("program link log:\n%s\n", compilelog);
if (strstr(compilelog, "fragment shader will run in software"))
programlinked = false;
}
- CHECKGLERROR
if (!programlinked)
{
- qglDeleteObjectARB(programobject);
+ qglDeleteObjectARB(programobject);CHECKGLERROR
return 0;
}
CHECKGLERROR
Con_Printf("R_Mesh_Draw(%d, %d, %d, %08p);\n", firstvertex, numvertices, numtriangles, elements);
return;
}
- //CHECKGLERROR
+ CHECKGLERROR
renderstats.meshes++;
renderstats.meshes_elements += numelements;
if (gl_paranoid.integer)
const int *p;
if (!qglIsEnabled(GL_VERTEX_ARRAY))
Con_Print("R_Mesh_Draw: vertex array not enabled\n");
+ CHECKGLERROR
for (j = 0, size = numvertices * 3, p = (int *)((float *)gl_state.pointer_vertex + firstvertex * 3);j < size;j++, p++)
paranoidblah += *p;
if (gl_state.pointer_color)
{
if (!qglIsEnabled(GL_COLOR_ARRAY))
Con_Print("R_Mesh_Draw: color array set but not enabled\n");
+ CHECKGLERROR
for (j = 0, size = numvertices * 4, p = (int *)((float *)gl_state.pointer_color + firstvertex * 4);j < size;j++, p++)
paranoidblah += *p;
}
GL_ClientActiveTexture(i);
if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY))
Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n");
+ CHECKGLERROR
for (j = 0, size = numvertices * gl_state.units[i].arraycomponents, p = (int *)((float *)gl_state.units[i].pointer_texcoord + firstvertex * gl_state.units[i].arraycomponents);j < size;j++, p++)
paranoidblah += *p;
}
backend_modelmatrix = *matrix;
Matrix4x4_Concat(&backend_modelviewmatrix, &backend_viewmatrix, matrix);
Matrix4x4_Transpose(&backend_glmodelviewmatrix, &backend_modelviewmatrix);
- qglLoadMatrixf(&backend_glmodelviewmatrix.m[0][0]);
+ CHECKGLERROR
+ qglLoadMatrixf(&backend_glmodelviewmatrix.m[0][0]);CHECKGLERROR
}
}
CHECKGLERROR
if (!gl_state.pointer_color)
{
- qglEnableClientState(GL_COLOR_ARRAY);
- CHECKGLERROR
+ qglEnableClientState(GL_COLOR_ARRAY);CHECKGLERROR
}
else if (!color4f)
{
- qglDisableClientState(GL_COLOR_ARRAY);
- CHECKGLERROR
+ qglDisableClientState(GL_COLOR_ARRAY);CHECKGLERROR
// when color array is on the glColor gets trashed, set it again
- qglColor4f(gl_state.color4f[0], gl_state.color4f[1], gl_state.color4f[2], gl_state.color4f[3]);
- CHECKGLERROR
+ qglColor4f(gl_state.color4f[0], gl_state.color4f[1], gl_state.color4f[2], gl_state.color4f[3]);CHECKGLERROR
}
gl_state.pointer_color = color4f;
- qglColorPointer(4, GL_FLOAT, sizeof(float[4]), gl_state.pointer_color);
- CHECKGLERROR
+ qglColorPointer(4, GL_FLOAT, sizeof(float[4]), gl_state.pointer_color);CHECKGLERROR
}
}
{
gltextureunit_t *unit = gl_state.units + unitnum;
// update array settings
+ CHECKGLERROR
if (texcoord)
{
// texcoord array
unit->pointer_texcoord = texcoord;
unit->arraycomponents = numcomponents;
GL_ClientActiveTexture(unitnum);
- qglTexCoordPointer(unit->arraycomponents, GL_FLOAT, sizeof(float) * unit->arraycomponents, unit->pointer_texcoord);
- CHECKGLERROR
+ qglTexCoordPointer(unit->arraycomponents, GL_FLOAT, sizeof(float) * unit->arraycomponents, unit->pointer_texcoord);CHECKGLERROR
}
// texture array unit is enabled, enable the array
if (!unit->arrayenabled)
if (tex1d)
{
if (unit->t1d == 0)
- qglEnable(GL_TEXTURE_1D);
+ {
+ qglEnable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
else
{
if (unit->t1d)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
}
unit->t1d = tex1d;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d != tex2d)
if (tex2d)
{
if (unit->t2d == 0)
- qglEnable(GL_TEXTURE_2D);
+ {
+ qglEnable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
else
{
if (unit->t2d)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
}
unit->t2d = tex2d;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d != tex3d)
if (tex3d)
{
if (unit->t3d == 0)
- qglEnable(GL_TEXTURE_3D);
+ {
+ qglEnable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
else
{
if (unit->t3d)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
}
unit->t3d = tex3d;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap != texcubemap)
if (texcubemap)
{
if (unit->tcubemap == 0)
- qglEnable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglEnable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
else
{
if (unit->tcubemap)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
}
unit->tcubemap = texcubemap;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
if (texnum)
{
if (unit->t1d == 0)
- qglEnable(GL_TEXTURE_1D);
+ {
+ qglEnable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
else
{
if (unit->t1d)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
}
unit->t1d = texnum;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d)
if (unitnum < backendunits)
{
if (unit->t2d)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
unit->t2d = 0;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d)
if (unitnum < backendunits)
{
if (unit->t3d)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
unit->t3d = 0;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap)
if (unitnum < backendunits)
{
if (unit->tcubemap)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
unit->tcubemap = 0;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
if (unitnum < backendunits)
{
if (unit->t1d)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
unit->t1d = 0;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d != texnum)
if (texnum)
{
if (unit->t2d == 0)
- qglEnable(GL_TEXTURE_2D);
+ {
+ qglEnable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
else
{
if (unit->t2d)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
}
unit->t2d = texnum;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d)
if (unitnum < backendunits)
{
if (unit->t3d)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
unit->t3d = 0;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap != 0)
if (unitnum < backendunits)
{
if (unit->tcubemap)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
unit->tcubemap = 0;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
if (unitnum < backendunits)
{
if (unit->t1d)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
unit->t1d = 0;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d)
if (unitnum < backendunits)
{
if (unit->t2d)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
unit->t2d = 0;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d != texnum)
if (texnum)
{
if (unit->t3d == 0)
- qglEnable(GL_TEXTURE_3D);
+ {
+ qglEnable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
else
{
if (unit->t3d)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
}
unit->t3d = texnum;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap != 0)
if (unitnum < backendunits)
{
if (unit->tcubemap)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
unit->tcubemap = 0;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
if (unitnum < backendunits)
{
if (unit->t1d)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
}
unit->t1d = 0;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d)
if (unitnum < backendunits)
{
if (unit->t2d)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
}
unit->t2d = 0;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d)
if (unitnum < backendunits)
{
if (unit->t3d)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
}
unit->t3d = 0;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap != texnum)
if (texnum)
{
if (unit->tcubemap == 0)
- qglEnable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglEnable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
else
{
if (unit->tcubemap)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
}
}
unit->tcubemap = texnum;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
matrix4x4_t tempmatrix;
unit->texmatrixenabled = true;
unit->matrix = *matrix;
+ CHECKGLERROR
Matrix4x4_Transpose(&tempmatrix, &unit->matrix);
- qglMatrixMode(GL_TEXTURE);
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
GL_ActiveTexture(unitnum);
- qglLoadMatrixf(&tempmatrix.m[0][0]);
- qglMatrixMode(GL_MODELVIEW);
+ qglLoadMatrixf(&tempmatrix.m[0][0]);CHECKGLERROR
+ qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
}
else
if (unit->texmatrixenabled)
{
unit->texmatrixenabled = false;
- qglMatrixMode(GL_TEXTURE);
+ CHECKGLERROR
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
GL_ActiveTexture(unitnum);
- qglLoadIdentity();
- qglMatrixMode(GL_MODELVIEW);
+ qglLoadIdentity();CHECKGLERROR
+ qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
}
}
void R_Mesh_TexCombine(unsigned int unitnum, int combinergb, int combinealpha, int rgbscale, int alphascale)
{
gltextureunit_t *unit = gl_state.units + unitnum;
+ CHECKGLERROR
if (gl_combine.integer)
{
// GL_ARB_texture_env_combine
BACKENDACTIVECHECK
+ CHECKGLERROR
if (gl_backend_rebindtextures)
{
gl_backend_rebindtextures = false;
GL_SetupTextureState();
+ CHECKGLERROR
}
for (i = 0;i < backendimageunits;i++)
R_Mesh_TexMatrix(i, &m->texmatrix[i]);
R_Mesh_TexCombine(i, m->texcombinergb[i], m->texcombinealpha[i], m->texrgbscale[i], m->texalphascale[i]);
}
+ CHECKGLERROR
}
void R_Mesh_ResetTextureState(void)
BACKENDACTIVECHECK
+ CHECKGLERROR
if (gl_backend_rebindtextures)
{
gl_backend_rebindtextures = false;
GL_SetupTextureState();
+ CHECKGLERROR
}
for (unitnum = 0;unitnum < backendimageunits;unitnum++)
{
GL_ActiveTexture(unitnum);
if (unitnum < backendunits)
- qglDisable(GL_TEXTURE_1D);
+ {
+ qglDisable(GL_TEXTURE_1D);CHECKGLERROR
+ }
unit->t1d = 0;
- qglBindTexture(GL_TEXTURE_1D, unit->t1d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_1D, unit->t1d);CHECKGLERROR
}
// update 2d texture binding
if (unit->t2d)
{
GL_ActiveTexture(unitnum);
if (unitnum < backendunits)
- qglDisable(GL_TEXTURE_2D);
+ {
+ qglDisable(GL_TEXTURE_2D);CHECKGLERROR
+ }
unit->t2d = 0;
- qglBindTexture(GL_TEXTURE_2D, unit->t2d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_2D, unit->t2d);CHECKGLERROR
}
// update 3d texture binding
if (unit->t3d)
{
GL_ActiveTexture(unitnum);
if (unitnum < backendunits)
- qglDisable(GL_TEXTURE_3D);
+ {
+ qglDisable(GL_TEXTURE_3D);CHECKGLERROR
+ }
unit->t3d = 0;
- qglBindTexture(GL_TEXTURE_3D, unit->t3d);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_3D, unit->t3d);CHECKGLERROR
}
// update cubemap texture binding
if (unit->tcubemap)
{
GL_ActiveTexture(unitnum);
if (unitnum < backendunits)
- qglDisable(GL_TEXTURE_CUBE_MAP_ARB);
+ {
+ qglDisable(GL_TEXTURE_CUBE_MAP_ARB);CHECKGLERROR
+ }
unit->tcubemap = 0;
- qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);
- CHECKGLERROR
+ qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR
}
}
for (unitnum = 0;unitnum < backendarrayunits;unitnum++)
if (unit->texmatrixenabled)
{
unit->texmatrixenabled = false;
- qglMatrixMode(GL_TEXTURE);
+ CHECKGLERROR
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
GL_ActiveTexture(unitnum);
- qglLoadIdentity();
- qglMatrixMode(GL_MODELVIEW);
+ qglLoadIdentity();CHECKGLERROR
+ qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
if (gl_combine.integer)
{
void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, const int *elements)
{
+ CHECKGLERROR
qglBegin(GL_LINES);
for (;numtriangles;numtriangles--, elements += 3)
{
r_view_matrix = r_refdef.viewentitymatrix;
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
- qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ CHECKGLERROR
+ qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);CHECKGLERROR
GL_SetupView_Mode_Ortho(0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100);
- qglDepthFunc(GL_LEQUAL);
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
R_Mesh_Matrix(&identitymatrix);
GL_DepthMask(true);
if (!r_render.integer)
return;
+ CHECKGLERROR
if(flags == DRAWFLAG_ADDITIVE)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
else if(flags == DRAWFLAG_MODULATE)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_Color(1,1,1,1);
+ CHECKGLERROR
qglBegin(GL_LINE_LOOP);
for (num = 0;num < mesh->num_vertices;num++)
{
qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]);
}
qglEnd();
+ CHECKGLERROR
}
//LordHavoc: FIXME: this is nasty!
Con_Printf("DrawQ_LineWidth: not in 2d rendering stage!\n");
return;
}
- qglLineWidth(width);
+ CHECKGLERROR
+ qglLineWidth(width);CHECKGLERROR
}
//[515]: this is old, delete
if (!r_render.integer)
return;
+ CHECKGLERROR
if(width > 0)
DrawQ_LineWidth(width);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_Color(r,g,b,alpha);
+ CHECKGLERROR
qglBegin(GL_LINES);
qglVertex2f(x1, y1);
qglVertex2f(x2, y2);
qglEnd();
+ CHECKGLERROR
}
void DrawQ_SetClipArea(float x, float y, float width, float height)
if (p->program)
{
CHECKGLERROR
- qglUseProgramObjectARB(p->program);
+ qglUseProgramObjectARB(p->program);CHECKGLERROR
p->loc_Texture_Normal = qglGetUniformLocationARB(p->program, "Texture_Normal");
p->loc_Texture_Color = qglGetUniformLocationARB(p->program, "Texture_Color");
p->loc_Texture_Gloss = qglGetUniformLocationARB(p->program, "Texture_Gloss");
if (p->loc_Texture_Lightmap >= 0) qglUniform1iARB(p->loc_Texture_Lightmap, 7);
if (p->loc_Texture_Deluxemap >= 0) qglUniform1iARB(p->loc_Texture_Deluxemap, 8);
if (p->loc_Texture_Glow >= 0) qglUniform1iARB(p->loc_Texture_Glow, 9);
- qglUseProgramObjectARB(0);
CHECKGLERROR
+ qglUseProgramObjectARB(0);CHECKGLERROR
}
else
Con_Printf("permutation%s failed for shader %s, some features may not work properly!\n", permutationname, "glsl/default.glsl");
Con_DPrintf("\nengine extensions: %s\n", vm_sv_extensions );
// clear to black (loading plaque will be seen over this)
- qglClearColor(0,0,0,1);
- qglClear(GL_COLOR_BUFFER_BIT);
+ CHECKGLERROR
+ qglClearColor(0,0,0,1);CHECKGLERROR
+ qglClear(GL_COLOR_BUFFER_BIT);CHECKGLERROR
}
int R_CullBox(const vec3_t mins, const vec3_t maxs)
R_Mesh_TexBind(0, R_GetTexture(r_bloom_texture_screen));
// copy view into the full resolution screen image texture
GL_ActiveTexture(0);
- qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ CHECKGLERROR
+ qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);CHECKGLERROR
renderstats.bloom_copypixels += r_view_width * r_view_height;
// now scale it down to the bloom size and raise to a power of itself
// to darken it (this leaves the really bright stuff bright, and
// everything else becomes very dark)
// TODO: optimize with multitexture or GLSL
- qglViewport(r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
+ CHECKGLERROR
+ qglViewport(r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);CHECKGLERROR
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1, 1, 1, 1);
R_Mesh_Draw(0, 4, 2, polygonelements);
R_Mesh_TexBind(0, R_GetTexture(r_bloom_texture_bloom));
R_Mesh_TexCoordPointer(0, 2, texcoord2f[2]);
GL_ActiveTexture(0);
- qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
+ CHECKGLERROR
+ qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);CHECKGLERROR
renderstats.bloom_copypixels += bloomwidth * bloomheight;
// blend on at multiple vertical offsets to achieve a vertical blur
// TODO: do offset blends using GLSL
}
// copy the vertically blurred bloom view to a texture
GL_ActiveTexture(0);
- qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
+ CHECKGLERROR
+ qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);CHECKGLERROR
renderstats.bloom_copypixels += bloomwidth * bloomheight;
// blend the vertically blurred image at multiple offsets horizontally
// to finish the blur effect
}
// copy the blurred bloom view to a texture
GL_ActiveTexture(0);
- qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
+ CHECKGLERROR
+ qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);CHECKGLERROR
renderstats.bloom_copypixels += bloomwidth * bloomheight;
// go back to full view area
- qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);CHECKGLERROR
// put the original screen image back in place and blend the bloom
// texture on it
GL_Color(1,1,1,1);
}
// GL is weird because it's bottom to top, r_view_y is top to bottom
- qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ CHECKGLERROR
+ qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);CHECKGLERROR
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
GL_ScissorTest(true);
GL_DepthMask(true);
if (r_timereport_active)
R_TimeReport("setup");
- qglDepthFunc(GL_LEQUAL);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- qglEnable(GL_POLYGON_OFFSET_FILL);
+ CHECKGLERROR
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
R_RenderScene();
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- qglDisable(GL_POLYGON_OFFSET_FILL);
+ CHECKGLERROR
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ qglDisable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
R_BlendView();
if (r_timereport_active)
GL_Scissor(0, 0, vid.width, vid.height);
GL_ScissorTest(false);
+ CHECKGLERROR
}
//[515]: csqc
}
// GL is weird because it's bottom to top, r_view_y is top to bottom
- qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ CHECKGLERROR
+ qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);CHECKGLERROR
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
GL_ScissorTest(true);
GL_DepthMask(true);
R_UpdateFog();
if (r_timereport_active)
R_TimeReport("setup");
+ CHECKGLERROR
}
//[515]: csqc
void CSQC_R_RenderScene (void)
{
- qglDepthFunc(GL_LEQUAL);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- qglEnable(GL_POLYGON_OFFSET_FILL);
+ CHECKGLERROR
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
R_RenderScene();
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- qglDisable(GL_POLYGON_OFFSET_FILL);
+ CHECKGLERROR
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ qglDisable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
R_BlendView();
if (r_timereport_active)
GL_Scissor(0, 0, vid.width, vid.height);
GL_ScissorTest(false);
+ CHECKGLERROR
}
extern void R_DrawLightningBeams (void);
r_framecount++;
+ CHECKGLERROR
if (gl_support_fragment_shader)
- qglUseProgramObjectARB(0);
+ {
+ qglUseProgramObjectARB(0);CHECKGLERROR
+ }
R_MeshQueue_BeginScene();
if (r_refdef.extraupdate)
S_ExtraUpdate ();
+ CHECKGLERROR
if (gl_support_fragment_shader)
- qglUseProgramObjectARB(0);
+ {
+ qglUseProgramObjectARB(0);CHECKGLERROR
+ }
}
/*
void RSurf_CleanUp(void)
{
+ CHECKGLERROR
if (rsurface_mode == RSURFMODE_GLSL)
- qglUseProgramObjectARB(0);
+ {
+ qglUseProgramObjectARB(0);CHECKGLERROR
+ }
GL_AlphaTest(false);
rsurface_mode = RSURFMODE_NONE;
rsurface_lightmaptexture = NULL;
renderstats.entities_surfaces += texturenumsurfaces;
// FIXME: identify models using a better check than rsurface_model->brush.shadowmesh
lightmode = ((rsurface_entity->effects & EF_FULLBRIGHT) || rsurface_model->brush.shadowmesh) ? 0 : 2;
+ CHECKGLERROR
GL_DepthTest(!(rsurface_texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST));
if ((rsurface_texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (rsurface_entity->flags & RENDER_NOCULLFACE))
- qglDisable(GL_CULL_FACE);
+ {
+ qglDisable(GL_CULL_FACE);CHECKGLERROR
+ }
if (r_showsurfaces.integer)
{
if (rsurface_mode != RSURFMODE_SHOWSURFACES)
if (rsurface_mode != RSURFMODE_SKY)
{
if (rsurface_mode == RSURFMODE_GLSL)
- qglUseProgramObjectARB(0);
+ {
+ qglUseProgramObjectARB(0);CHECKGLERROR
+ }
rsurface_mode = RSURFMODE_SKY;
if (skyrendernow)
{
{
int layerindex;
const texturelayer_t *layer;
+ CHECKGLERROR
if (rsurface_mode != RSURFMODE_MULTIPASS)
{
if (rsurface_mode == RSURFMODE_GLSL)
- qglUseProgramObjectARB(0);
+ {
+ qglUseProgramObjectARB(0);CHECKGLERROR
+ }
rsurface_mode = RSURFMODE_MULTIPASS;
}
RSurf_PrepareVerticesForBatch(true, false, texturenumsurfaces, texturesurfacelist);
else
{
GL_AlphaTest(false);
- qglDepthFunc(GL_EQUAL);
+ qglDepthFunc(GL_EQUAL);CHECKGLERROR
}
}
GL_DepthMask(layer->depthmask);
GL_LockArrays(0, 0);
}
}
+ CHECKGLERROR
if (rsurface_texture->currentmaterialflags & MATERIALFLAG_ALPHATEST)
{
- qglDepthFunc(GL_LEQUAL);
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
GL_AlphaTest(false);
}
}
+ CHECKGLERROR
GL_LockArrays(0, 0);
if ((rsurface_texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (rsurface_entity->flags & RENDER_NOCULLFACE))
- qglEnable(GL_CULL_FACE);
+ {
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
+ }
}
static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, int surfacenumber, const rtlight_t *rtlight)
int i;
const msurface_t *surface;
q3mbrush_t *brush;
+ CHECKGLERROR
R_Mesh_Matrix(&ent->matrix);
R_Mesh_ColorPointer(NULL);
R_Mesh_ResetTextureState();
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(!r_showdisabledepthtest.integer);
- qglPolygonOffset(r_polygonfactor + r_showcollisionbrushes_polygonfactor.value, r_polygonoffset + r_showcollisionbrushes_polygonoffset.value);
+ qglPolygonOffset(r_polygonfactor + r_showcollisionbrushes_polygonfactor.value, r_polygonoffset + r_showcollisionbrushes_polygonoffset.value);CHECKGLERROR
for (i = 0, brush = model->brush.data_brushes + model->firstmodelbrush;i < model->nummodelbrushes;i++, brush++)
if (brush->colbrushf && brush->colbrushf->numtriangles)
R_DrawCollisionBrush(brush->colbrushf);
for (i = 0, surface = model->data_surfaces + model->firstmodelsurface;i < model->nummodelsurfaces;i++, surface++)
if (surface->num_collisiontriangles)
R_DrawCollisionSurface(ent, surface);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
}
if (r_showtris.integer || r_shownormals.integer)
msurface_t *surface;
const int *elements;
vec3_t v;
+ CHECKGLERROR
GL_DepthTest(true);
GL_DepthMask(true);
if (r_showdisabledepthtest.integer)
- qglDepthFunc(GL_ALWAYS);
+ {
+ qglDepthFunc(GL_ALWAYS);CHECKGLERROR
+ }
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Mesh_ColorPointer(NULL);
R_Mesh_ResetTextureState();
else
GL_Color(0, r_showtris.value, 0, 1);
elements = (ent->model->surfmesh.data_element3i + 3 * surface->num_firsttriangle);
+ CHECKGLERROR
qglBegin(GL_LINES);
for (k = 0;k < surface->num_triangles;k++, elements += 3)
{
qglArrayElement(elements[2]);qglArrayElement(elements[0]);
}
qglEnd();
+ CHECKGLERROR
}
if (r_shownormals.integer)
{
qglVertex3f(v[0], v[1], v[2]);
}
qglEnd();
+ CHECKGLERROR
GL_Color(0, 0, r_shownormals.value, 1);
qglBegin(GL_LINES);
for (k = 0, l = surface->num_firstvertex;k < surface->num_vertices;k++, l++)
qglVertex3f(v[0], v[1], v[2]);
}
qglEnd();
+ CHECKGLERROR
GL_Color(0, r_shownormals.value, 0, 1);
qglBegin(GL_LINES);
for (k = 0, l = surface->num_firstvertex;k < surface->num_vertices;k++, l++)
qglVertex3f(v[0], v[1], v[2]);
}
qglEnd();
+ CHECKGLERROR
}
}
}
rsurface_texture = NULL;
if (r_showdisabledepthtest.integer)
- qglDepthFunc(GL_LEQUAL);
+ {
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ }
}
}
int i, numpoints;
float *v;
float vertex3f[POLYGONELEMENTS_MAXPOINTS*3];
+ CHECKGLERROR
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(false);
GL_DepthTest(true);
- qglDisable(GL_CULL_FACE);
+ qglDisable(GL_CULL_FACE);CHECKGLERROR
R_Mesh_Matrix(&identitymatrix);
numpoints = min(portal->numpoints, POLYGONELEMENTS_MAXPOINTS);
for (i = 0, v = vertex3f;i < numpoints;i++, v += 3)
VectorCopy(portal->points[i].position, v);
R_Mesh_Draw(0, numpoints, numpoints - 2, polygonelements);
- qglEnable(GL_CULL_FACE);
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
}
// LordHavoc: this is just a nice debugging tool, very slow
msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
texture_t *tex;
qboolean skip;
+ CHECKGLERROR
RSurf_ActiveEntity(ent);
R_UpdateAllTextureInfo(ent);
tex = NULL;
rsurface_texture = NULL;
skip = false;
batchnumsurfaces = 0;
+ CHECKGLERROR
for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
{
if ((ent == r_refdef.worldentity && !r_worldsurfacevisible[surfacelist[surfacelistindex]]))
R_Shadow_RenderSurfacesLighting(batchnumsurfaces, batchsurfacelist);
batchnumsurfaces = 0;
}
- qglEnable(GL_CULL_FACE);
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
}
//Made by [515]
Host_Error("R_FreeTexture: texture \"%s\" not linked in pool", glt->identifier);
if (glt->texnum)
- qglDeleteTextures(1, (GLuint *)&glt->texnum);
+ {
+ CHECKGLERROR
+ qglDeleteTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
+ }
if (glt->inputtexels)
Mem_Free(glt->inputtexels);
// change all the existing mipmap texture objects
// FIXME: force renderer(/client/something?) restart instead?
+ CHECKGLERROR
for (pool = gltexturepoolchain;pool;pool = pool->next)
{
for (glt = pool->gltchain;glt;glt = glt->chain)
// only update already uploaded images
if (!(glt->flags & (GLTEXF_UPLOAD | TEXF_FORCENEAREST | TEXF_FORCELINEAR)))
{
- qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);
- qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);
+ qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);CHECKGLERROR
+ qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
if (glt->flags & TEXF_MIPMAP)
- qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MIN_FILTER, gl_filter_min);
+ {
+ qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MIN_FILTER, gl_filter_min);CHECKGLERROR
+ }
else
- qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MIN_FILTER, gl_filter_mag);
- qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MAG_FILTER, gl_filter_mag);
- qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);
+ {
+ qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MIN_FILTER, gl_filter_mag);CHECKGLERROR
+ }
+ qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MAG_FILTER, gl_filter_mag);CHECKGLERROR
+ qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);CHECKGLERROR
}
}
}
static void r_textures_start(void)
{
// LordHavoc: allow any alignment
- qglPixelStorei(GL_UNPACK_ALIGNMENT, 1);
CHECKGLERROR
+ qglPixelStorei(GL_UNPACK_ALIGNMENT, 1);CHECKGLERROR
texturemempool = Mem_AllocPool("texture management", 0, NULL);
Cvar_SetValueQuick(&gl_texture_anisotropy, old_aniso);
+ CHECKGLERROR
for (pool = gltexturepoolchain;pool;pool = pool->next)
{
for (glt = pool->gltchain;glt;glt = glt->chain)
// only update already uploaded images
if ((glt->flags & (GLTEXF_UPLOAD | TEXF_MIPMAP)) == TEXF_MIPMAP)
{
- qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);
+ qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);CHECKGLERROR
- qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);
+ qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MAX_ANISOTROPY_EXT, old_aniso);CHECKGLERROR
- qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);
+ qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);CHECKGLERROR
}
}
}
CHECKGLERROR
// we need to restore the texture binding after finishing the upload
- qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);
- qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);
- CHECKGLERROR
+ qglGetIntegerv(gltexturetypebindingenums[glt->texturetype], &oldbindtexnum);CHECKGLERROR
+ qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
// these are rounded up versions of the size to do better resampling
for (width = 1;width < glt->inputwidth ;width <<= 1);
switch(glt->texturetype)
{
case GLTEXTURETYPE_1D:
- qglTexSubImage1D(GL_TEXTURE_1D, 0, fragx, fragwidth, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexSubImage1D(GL_TEXTURE_1D, 0, fragx, fragwidth, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
break;
case GLTEXTURETYPE_2D:
- qglTexSubImage2D(GL_TEXTURE_2D, 0, fragx, fragy, fragwidth, fragheight, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexSubImage2D(GL_TEXTURE_2D, 0, fragx, fragy, fragwidth, fragheight, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
break;
case GLTEXTURETYPE_3D:
- qglTexSubImage3D(GL_TEXTURE_3D, 0, fragx, fragy, fragz, fragwidth, fragheight, fragdepth, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexSubImage3D(GL_TEXTURE_3D, 0, fragx, fragy, fragz, fragwidth, fragheight, fragdepth, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
break;
default:
Host_Error("R_Upload: partial update of type other than 1D, 2D, or 3D");
switch(glt->texturetype)
{
case GLTEXTURETYPE_1D:
- qglTexImage1D(GL_TEXTURE_1D, mip++, glt->glinternalformat, width, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage1D(GL_TEXTURE_1D, mip++, glt->glinternalformat, width, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
if (glt->flags & TEXF_MIPMAP)
{
while (width > 1 || height > 1 || depth > 1)
{
Image_MipReduce(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1, glt->bytesperpixel);
prevbuffer = resizebuffer;
- qglTexImage1D(GL_TEXTURE_1D, mip++, glt->glinternalformat, width, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage1D(GL_TEXTURE_1D, mip++, glt->glinternalformat, width, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
}
}
break;
case GLTEXTURETYPE_2D:
- qglTexImage2D(GL_TEXTURE_2D, mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage2D(GL_TEXTURE_2D, mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
if (glt->flags & TEXF_MIPMAP)
{
while (width > 1 || height > 1 || depth > 1)
{
Image_MipReduce(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1, glt->bytesperpixel);
prevbuffer = resizebuffer;
- qglTexImage2D(GL_TEXTURE_2D, mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage2D(GL_TEXTURE_2D, mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
}
}
break;
case GLTEXTURETYPE_3D:
- qglTexImage3D(GL_TEXTURE_3D, mip++, glt->glinternalformat, width, height, depth, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage3D(GL_TEXTURE_3D, mip++, glt->glinternalformat, width, height, depth, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
if (glt->flags & TEXF_MIPMAP)
{
while (width > 1 || height > 1 || depth > 1)
{
Image_MipReduce(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1, glt->bytesperpixel);
prevbuffer = resizebuffer;
- qglTexImage3D(GL_TEXTURE_3D, mip++, glt->glinternalformat, width, height, depth, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage3D(GL_TEXTURE_3D, mip++, glt->glinternalformat, width, height, depth, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
}
}
break;
prevbuffer = resizebuffer;
}
mip = 0;
- qglTexImage2D(cubemapside[i], mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage2D(cubemapside[i], mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
if (glt->flags & TEXF_MIPMAP)
{
while (width > 1 || height > 1 || depth > 1)
{
Image_MipReduce(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1, glt->bytesperpixel);
prevbuffer = resizebuffer;
- qglTexImage2D(cubemapside[i], mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);
- CHECKGLERROR
+ qglTexImage2D(cubemapside[i], mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
}
}
}
}
GL_SetupTextureParameters(glt->flags, glt->texturetype);
}
- qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);
+ qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);CHECKGLERROR
}
static void R_UploadTexture (gltexture_t *glt)
if (!(glt->flags & GLTEXF_UPLOAD))
return;
- qglGenTextures(1, (GLuint *)&glt->texnum);
+ CHECKGLERROR
+ qglGenTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
R_Upload(glt, glt->inputtexels, 0, 0, 0, glt->inputwidth, glt->inputheight, glt->inputdepth);
if (glt->inputtexels)
{
#define DEBUGGL
#ifdef DEBUGGL
-#define CHECKGLERROR {if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);if (gl_paranoid.integer && (errornumber = qglGetError())) GL_PrintError(errornumber, __FILE__, __LINE__);}
+#define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
extern int errornumber;
void GL_PrintError(int errornumber, char *filename, int linenumber);
#else
R_Mesh_TexBind(0, R_GetTexture(p->tex));
+ CHECKGLERROR
//[515]: is speed is max ?
if(p->flags & VM_POLYGON_FLLINES) //[515]: lines
{
- qglLineWidth(p->data[13]);
+ qglLineWidth(p->data[13]);CHECKGLERROR
qglBegin(GL_LINE_LOOP);
qglTexCoord1f (p->data[12]);
qglColor4f (p->data[20], p->data[21], p->data[22], p->data[23]);
}
}
qglEnd();
+ CHECKGLERROR
}
else
{
qglVertex3f (p->data[9] , p->data[10], p->data[11]);
}
qglEnd();
+ CHECKGLERROR
}
}
return;
}
renderstats.lights_shadowtriangles += numtriangles;
+ CHECKGLERROR
R_Mesh_VertexPointer(vertex3f);
GL_LockArrays(0, numvertices);
if (r_shadow_rendermode == R_SHADOW_RENDERMODE_STENCIL)
{
// decrement stencil if backface is behind depthbuffer
- qglCullFace(GL_BACK); // quake is backwards, this culls front faces
- qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
+ qglCullFace(GL_BACK);CHECKGLERROR // quake is backwards, this culls front faces
+ qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);CHECKGLERROR
R_Mesh_Draw(0, numvertices, numtriangles, element3i);
// increment stencil if frontface is behind depthbuffer
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);CHECKGLERROR
}
R_Mesh_Draw(0, numvertices, numtriangles, element3i);
GL_LockArrays(0, 0);
+ CHECKGLERROR
}
static void R_Shadow_MakeTextures(void)
|| r_shadow_lightattenuationscale.value != r_shadow_attenscale)
R_Shadow_MakeTextures();
+ CHECKGLERROR
R_Mesh_ColorPointer(NULL);
R_Mesh_ResetTextureState();
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(false);
GL_DepthTest(true);
GL_Color(0, 0, 0, 1);
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglEnable(GL_CULL_FACE);
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
r_shadow_rendermode = R_SHADOW_RENDERMODE_NONE;
void R_Shadow_RenderMode_Reset(void)
{
+ CHECKGLERROR
if (r_shadow_rendermode == R_SHADOW_RENDERMODE_LIGHT_GLSL)
{
- qglUseProgramObjectARB(0);
- // HACK HACK HACK: work around for bug in NVIDIAI 6xxx drivers that causes GL_OUT_OF_MEMORY and/or software rendering
- qglBegin(GL_TRIANGLES);
- qglEnd();
- CHECKGLERROR
+ qglUseProgramObjectARB(0);CHECKGLERROR
}
else if (r_shadow_rendermode == R_SHADOW_RENDERMODE_STENCILTWOSIDE)
- qglDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
+ {
+ qglDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);CHECKGLERROR
+ }
R_Mesh_ColorPointer(NULL);
R_Mesh_ResetTextureState();
}
void R_Shadow_RenderMode_StencilShadowVolumes(void)
{
+ CHECKGLERROR
R_Shadow_RenderMode_Reset();
GL_Color(1, 1, 1, 1);
GL_ColorMask(0, 0, 0, 0);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(false);
GL_DepthTest(true);
- qglPolygonOffset(r_shadowpolygonfactor, r_shadowpolygonoffset);
- qglDepthFunc(GL_LESS);
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglEnable(GL_STENCIL_TEST);
- qglStencilFunc(GL_ALWAYS, 128, ~0);
+ qglPolygonOffset(r_shadowpolygonfactor, r_shadowpolygonoffset);CHECKGLERROR
+ qglDepthFunc(GL_LESS);CHECKGLERROR
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglEnable(GL_STENCIL_TEST);CHECKGLERROR
+ qglStencilFunc(GL_ALWAYS, 128, ~0);CHECKGLERROR
r_shadow_rendermode = r_shadow_shadowingrendermode;
if (r_shadow_rendermode == R_SHADOW_RENDERMODE_STENCILTWOSIDE)
{
- qglDisable(GL_CULL_FACE);
- qglEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
- qglActiveStencilFaceEXT(GL_BACK); // quake is backwards, this is front faces
- qglStencilMask(~0);
- qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
- qglActiveStencilFaceEXT(GL_FRONT); // quake is backwards, this is back faces
- qglStencilMask(~0);
- qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
+ qglDisable(GL_CULL_FACE);CHECKGLERROR
+ qglEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);CHECKGLERROR
+ qglActiveStencilFaceEXT(GL_BACK);CHECKGLERROR // quake is backwards, this is front faces
+ qglStencilMask(~0);CHECKGLERROR
+ qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);CHECKGLERROR
+ qglActiveStencilFaceEXT(GL_FRONT);CHECKGLERROR // quake is backwards, this is back faces
+ qglStencilMask(~0);CHECKGLERROR
+ qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);CHECKGLERROR
}
else
{
- qglEnable(GL_CULL_FACE);
- qglStencilMask(~0);
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
+ qglStencilMask(~0);CHECKGLERROR
// this is changed by every shadow render so its value here is unimportant
- qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);CHECKGLERROR
}
GL_Clear(GL_STENCIL_BUFFER_BIT);
renderstats.lights_clears++;
void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent)
{
+ CHECKGLERROR
R_Shadow_RenderMode_Reset();
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- //qglDisable(GL_POLYGON_OFFSET_FILL);
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ //qglDisable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
GL_Color(1, 1, 1, 1);
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
if (transparent)
- qglDepthFunc(GL_LEQUAL);
+ {
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ }
else
- qglDepthFunc(GL_EQUAL);
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglEnable(GL_CULL_FACE);
+ {
+ qglDepthFunc(GL_EQUAL);CHECKGLERROR
+ }
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
if (stenciltest)
- qglEnable(GL_STENCIL_TEST);
+ {
+ qglEnable(GL_STENCIL_TEST);CHECKGLERROR
+ }
else
- qglDisable(GL_STENCIL_TEST);
- qglStencilMask(~0);
- qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ {
+ qglDisable(GL_STENCIL_TEST);CHECKGLERROR
+ }
+ qglStencilMask(~0);CHECKGLERROR
+ qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);CHECKGLERROR
// only draw light where this geometry was already rendered AND the
// stencil is 128 (values other than this mean shadow)
- qglStencilFunc(GL_EQUAL, 128, ~0);
+ qglStencilFunc(GL_EQUAL, 128, ~0);CHECKGLERROR
r_shadow_rendermode = r_shadow_lightingrendermode;
// do global setup needed for the chosen lighting mode
if (r_shadow_rendermode == R_SHADOW_RENDERMODE_LIGHT_GLSL)
void R_Shadow_RenderMode_VisibleShadowVolumes(void)
{
+ CHECKGLERROR
R_Shadow_RenderMode_Reset();
GL_BlendFunc(GL_ONE, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(!r_showdisabledepthtest.integer);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
GL_Color(0.0, 0.0125, 0.1, 1);
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
- qglDepthFunc(GL_GEQUAL);
- qglCullFace(GL_FRONT); // this culls back
- qglDisable(GL_CULL_FACE);
- qglDisable(GL_STENCIL_TEST);
+ qglDepthFunc(GL_GEQUAL);CHECKGLERROR
+ qglCullFace(GL_FRONT);CHECKGLERROR // this culls back
+ qglDisable(GL_CULL_FACE);CHECKGLERROR
+ qglDisable(GL_STENCIL_TEST);CHECKGLERROR
r_shadow_rendermode = R_SHADOW_RENDERMODE_VISIBLEVOLUMES;
}
void R_Shadow_RenderMode_VisibleLighting(qboolean stenciltest, qboolean transparent)
{
+ CHECKGLERROR
R_Shadow_RenderMode_Reset();
GL_BlendFunc(GL_ONE, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(!r_showdisabledepthtest.integer);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
GL_Color(0.1, 0.0125, 0, 1);
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
if (transparent)
- qglDepthFunc(GL_LEQUAL);
+ {
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ }
else
- qglDepthFunc(GL_EQUAL);
- qglCullFace(GL_FRONT); // this culls back
- qglEnable(GL_CULL_FACE);
+ {
+ qglDepthFunc(GL_EQUAL);CHECKGLERROR
+ }
+ qglCullFace(GL_FRONT);CHECKGLERROR // this culls back
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
if (stenciltest)
- qglEnable(GL_STENCIL_TEST);
+ {
+ qglEnable(GL_STENCIL_TEST);CHECKGLERROR
+ }
else
- qglDisable(GL_STENCIL_TEST);
+ {
+ qglDisable(GL_STENCIL_TEST);CHECKGLERROR
+ }
r_shadow_rendermode = R_SHADOW_RENDERMODE_VISIBLELIGHTING;
}
void R_Shadow_RenderMode_End(void)
{
+ CHECKGLERROR
R_Shadow_RenderMode_Reset();
R_Shadow_RenderMode_ActiveLight(NULL);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
- qglPolygonOffset(r_polygonfactor, r_polygonoffset);
- //qglDisable(GL_POLYGON_OFFSET_FILL);
+ qglPolygonOffset(r_polygonfactor, r_polygonoffset);CHECKGLERROR
+ //qglDisable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
GL_Color(1, 1, 1, 1);
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
- qglDepthFunc(GL_LEQUAL);
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglEnable(GL_CULL_FACE);
- qglDisable(GL_STENCIL_TEST);
- qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
+ qglDisable(GL_STENCIL_TEST);CHECKGLERROR
+ qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);CHECKGLERROR
if (gl_support_stenciltwoside)
- qglDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
- qglStencilMask(~0);
- qglStencilFunc(GL_ALWAYS, 128, ~0);
+ {
+ qglDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);CHECKGLERROR
+ }
+ qglStencilMask(~0);CHECKGLERROR
+ qglStencilFunc(GL_ALWAYS, 128, ~0);CHECKGLERROR
r_shadow_rendermode = R_SHADOW_RENDERMODE_NONE;
}
// the light area is visible, set up the scissor rectangle
GL_Scissor(ix1, vid.height - iy2, ix2 - ix1, iy2 - iy1);
- //qglScissor(ix1, iy1, ix2 - ix1, iy2 - iy1);
- //qglEnable(GL_SCISSOR_TEST);
+ //qglScissor(ix1, iy1, ix2 - ix1, iy2 - iy1);CHECKGLERROR
+ //qglEnable(GL_SCISSOR_TEST);CHECKGLERROR
renderstats.lights_scissored++;
return false;
}
R_Mesh_TexCoordPointer(2, 3, rsurface_tvector3f);
R_Mesh_TexCoordPointer(3, 3, rsurface_normal3f);
if (rsurface_texture->currentmaterialflags & MATERIALFLAG_ALPHATEST)
- qglDepthFunc(GL_EQUAL);
+ {
+ qglDepthFunc(GL_EQUAL);CHECKGLERROR
+ }
for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
{
const msurface_t *surface = surfacelist[surfacelistindex];
}
GL_LockArrays(0, 0);
if (rsurface_texture->currentmaterialflags & MATERIALFLAG_ALPHATEST)
- qglDepthFunc(GL_LEQUAL);
+ {
+ qglDepthFunc(GL_LEQUAL);CHECKGLERROR
+ }
}
static void R_Shadow_RenderSurfacesLighting_Light_Dot3_AmbientPass(const msurface_t *surface, const vec3_t lightcolorbase, rtexture_t *basetexture, float colorscale)
if ((r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * VectorLength2(lightcolorbase) + (r_shadow_rtlight->specularscale * rsurface_texture->specularscale) * VectorLength2(lightcolorbase) < (1.0f / 1048576.0f))
return;
if ((rsurface_texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (rsurface_entity->flags & RENDER_NOCULLFACE))
- qglDisable(GL_CULL_FACE);
+ {
+ qglDisable(GL_CULL_FACE);CHECKGLERROR
+ }
else
- qglEnable(GL_CULL_FACE);
+ {
+ qglEnable(GL_CULL_FACE);CHECKGLERROR
+ }
if (rsurface_texture->colormapping)
{
qboolean dopants = rsurface_texture->skin.pants != NULL && VectorLength2(rsurface_entity->colormap_pantscolor) >= (1.0f / 1048576.0f);
{
shadowmesh_t *mesh;
R_Mesh_Matrix(&ent->matrix);
+ CHECKGLERROR
for (mesh = r_shadow_rtlight->static_meshchain_shadow;mesh;mesh = mesh->next)
{
renderstats.lights_shadowtriangles += mesh->numtriangles;
if (r_shadow_rendermode == R_SHADOW_RENDERMODE_STENCIL)
{
// decrement stencil if backface is behind depthbuffer
- qglCullFace(GL_BACK); // quake is backwards, this culls front faces
- qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
+ qglCullFace(GL_BACK);CHECKGLERROR // quake is backwards, this culls front faces
+ qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);CHECKGLERROR
R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
// increment stencil if frontface is behind depthbuffer
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
+ qglCullFace(GL_FRONT);CHECKGLERROR // quake is backwards, this culls back faces
+ qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);CHECKGLERROR
}
R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
GL_LockArrays(0, 0);
}
+ CHECKGLERROR
}
else if (numsurfaces)
{
-d (Gleeb) feature darkplaces server: add sv_playerphysicsqc cvar to allow engine to ignore SV_PlayerPhysics function, this would also have to change the reported extensions (Gleeb)
-d (HellToupee) feature darkplaces client: add a dot crosshair texture (HellToupee)
-d (Joel Murdoch) change darkplaces client: add a swinging weapon motion to replace the removed forward/back movement of the weapon, should be controllable with cl_bob_* cvars (Joel Murdoch)
--d (Kedhrin) bug dpmod: air control doesn't seem to be working (Kedhrin)
-d (Kinn) bug darkplaces WGL client: default WGL input back to GDI, the DirectInput driver is malfunctioning, losing key release messages, stuttering mouse input, and lacks mouse wheel support (Wazat, Kinn)
-d (Mabus) bug darkplaces loading: test zlib support with entirely pk3'd id1 data (should crash because of zlib not being setup early enough - fix this) (Mabus)
-d (Mitchell) bug darkplaces renderer: fix fogging in realtime lighting mode, need to split the shaders into two stages, this will also fix decal bugs with fog (Mitchell)
-d (Morphed) bug darkplaces renderer: Morphed's colormapping experiments in nexuiz show a difference in gloss color with GLSL vs dot3 path, http://img494.imageshack.us/img494/8745/nexuiz0000258lf.jpg http://www.nexuiz.com/forums/index.php?showtopic=1531 - and apparently it looks right or wrong depending on view point, suddenly switching (Morphed)
-d (Mr Fribbles) feature darkplaces particles: reimplement quake effects for a cl_particles_quake mode (Mr Fribbles, metlslime)
-d (QuakeMatt) change darkplaces menu: remove gl_combine from menu as it's not saved to config and really shouldn't be changed except when debugging drivers (QuakeMatt)
+-d (Sajt) bug darkplaces collision: frikbots are falling through the map (Sajt)
-d (Speedy) feature darkplaces init: add -demolooponly option which makes escape key quit, and disables all other keys (Speedy)
-d (Spike) change darkplaces prvm: disable the unknown opcode error in progs loading so that fteqcc fastarrays progs will load (Spike)
--d (Supa, Wazat, SavageX, Vermeulen, Spike) feature darkplaces server: make a DP_SV_CUSTOMIZEENTITYFORCLIENT extension which calls a .float customizeentityforclient() function for each client that may see the entity, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc (Urre, Supa, Wazat, SavageX, Vermeulen, Spike)
+-d (Supa, Wazat, Spike) feature darkplaces server: make a DP_SV_CUSTOMIZEENTITYFORCLIENT extension which calls a .float customizeentityforclient() function for each client that may see the entity, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc (Urre, Supa, Wazat, SavageX, Vermeulen, Spike)
-d (Toddd) bug darkplaces client: fix gl_flashblend, it's still drawing rtdlights even when gl_flashblend is on (Toddd)
--d (Vermeulen) bug darkplaces physics: q3bsp collisions are still glitchy, particularly gunshots hitting thin air near brushes, even with mod_q3bsp_optimizedtraceline 0, test in dpdm2r by shooting down through gaps in the architecture around the top platform (Vermeulen)
--d (Vermeulen) bug darkplaces protocol: sometimes players are invisible in nexuiz, showing only their gun model, this may be related to svc_precache messages not being sent during signon (Vermeulen)
-d (Wazat) bug darkplaces renderer: make sure that unlit maps show up fullbright (Wazat)
--d (div0, SavageX) bug darkplaces server: sv_jumpstep should be defaulted to off because it makes it possible to reach places one should not be able to reach in quake, it can be turned on by particular games if desired (div0, SavageX, Kazashi)
-d (evilfrog) bug darkplaces server: error() qc builtin does not print error message, just Host_Error: Program error or something similar (evilfrog)
-d (flum) bug darkplaces client: corona on your own muzzleflash is annoying when looking down because it can be seen, disable corona on all muzzleflashes (flum)
-d (hyenur) change dpmod: make cells only 30 damage, they're too powerful now (hyenur)
-d (mashakos) bug darkplaces input: fix the mouse move when console is raised in glx, probably by ignoring the first move after console raise (mashakos)
-d (mrinsane) bug darkplaces renderer: r_wateralpha 1 water that has lightmapping is black in r_shadow_realtime_world 1 mode, but only if the map was loaded in r_shadow_realtime_world 1 mode, if started in 0 and then going to 1 it does not have black water, this is probably lightmap updates not occurring in rtworld mode (mrinsane)
-d (romi) bug darkplaces client: cl.sfx sounds aren't playing (romi)
+-d (steven a) bug darkplaces server: Blood Mage monsters are stuck in place apparently (steven a)
-d (yummyluv) feature darkplaces protocol: add EF_DOUBLESIDED for double sided entity rendering (disable cull face for this entity) (yummyluv)
-d (yummyluv) feature darkplaces protocol: add buttons 9-16 (yummyluv)
-f (James D) bug darkplaces server: losing runes on episode completion, completing episode 1 then 2 then 3 causes it to forget 1, then 4 causes it to forget 2 and 3, making it impossible to open the boss gate (James D)
-f (Wazat) bug darkplaces: client's slowmo detection (measuring packet times and comparing to game time changes) may be making the game unpleasant (Wazat)
0 bug darkplaces client: GAME_NEHAHRA: make sure cutscenes and movies work, got a report of seeing a black screen (NightFright)
0 bug darkplaces client: fix cl_bobmodel bug which momentarily jolts the gun when you pass through a trigger, pick up an item, etc, Sajt thinks this is related to console prints as well as centerprint (Sajt)
-0 bug darkplaces collision: frikbots are falling through the map (Sajt)
0 bug darkplaces csqc: after the drawqueue was eliminated, the CSQC probably can't draw 2D polygons the same way, so it may need fixing ([515])
0 bug darkplaces csqc: engine-based rocket entities have a trail but they don't glow if csqc is used
0 bug darkplaces loader: make rtlight entity loader support q3map/q3map2 lights properly, they use a spawnflag for LINEAR mode, by default they use 1/(x*x) falloff (Carni, motorsep)
0 bug darkplaces renderer: r_wateralpha 0.9 is invisible on r_glsl 0;gl_combine 0 path (Lardarse]
0 bug darkplaces renderer: r_wateralpha on maps that are not watervised shows sky, this is a known glquake bug but it is fixable in darkplaces at load time by marking opposite-content (water-empty, empty-water) leafs as visible in their pvs sets, this involves checking the portal flow... (knghtbrd)
0 bug darkplaces renderer: showfps values 2 and 3 are printing bogus numbers like -2 billion (Willis)
-0 bug darkplaces server: Blood Mage monsters are stuck in place apparently (steven a)
0 bug darkplaces server: SV_PushMove is ignoring model type in its angles_x handling, where as the renderer checks only model type to determine angles_x handling (Urre)
0 bug darkplaces server: SV_PushMove's call to SV_ClipMoveToEntity should do a trace, not just a point test, to support hollow pusher models (Urre)
+0 bug darkplaces server: if sv_fixedframeratesingleplayer is 0 and cl_maxfps is something like 10, the server still runs every frame, consuming massive amounts of cpu and resulting in very small frametime values
0 bug darkplaces server: the lava+func_trains room of r1m5 is leaving items floating in the air - r1m5 is Towers of Wrath, in episode of Dissolution of Eternity, aka rogue (maichal)
0 bug darkplaces video: generate 1024 color gamma ramps for glx on Quadro, right now hardware gamma is being disabled on these cards because they use 1024 color ramps, not 256 (div0)
0 bug darkplaces wgl client: during video mode setup, sometimes another application's window becomes permanently top most, not darkplaces' fullscreen window, why? (tZork)
0 change darkplaces networking: make darkplaces detect its *public* client port from master server and send that in nq connect messages (wallace)
0 change darkplaces protocol: PRYDON_CLIENTCURSOR should use a stat and .prydoncursor field instead of the cl_prydoncursor cvar, because stuffcmd is a bit icky (FrikaC)
0 change darkplaces protocol: use q3 print "print message" command packet instead of qw print 'nmessage' command packet? (div0, KadaverJack)
+0 change darkplaces prvm: prvm_globals should print values of globals like entity fields do, not just names
0 change darkplaces renderer: get rid of DSDT texture support in texture manager, it was only used for the geforce3 water shader which has been removed
0 change darkplaces renderer: remove GL_NV_texture_shader detection
0 change darkplaces renderer: rename r_drawportals to r_showportals, and move its declaration to gl_rmain.c
0 feature darkplaces website: add q1source.zip to downloads page and suggest that mingw/Dev-C++ users may need the dx headers from it (cpuforbrain)
0 feature darkplaces: .vis files - like .lit but replacement vis data, note this also requires .leaf files (knghtbrd)
0 feature dpmaster: don't filter by protocol version if query is for protocol version 0, this way server browsers can see multiple versions of a single game, should probably also add a 'any' gamename that disables gamename filtering (Angst, Elric)
+0 feature dpmaster: release an example /etc/init.d/dpdmasterd script based on the one LordHavoc is using
0 feature dpmod: add a g_spawnprotectiontime cvar which would default to 1 (invulnerable for 1 second after spawn) to prevent mining the spawn points
0 feature dpmod: add a summon command using KRIMZON_SV_PARSECLIENTCOMMAND which would summon the specified monster infront of you (Kedhrin)
0 feature dpmod: add higher quality replacement sbar images
2 feature hmap2: add .hlwad and .hlw support to hqbsp (convert to quake palette, and check for colormap.lmp to see how many fullbrights are involved, also add -fullbrights option to control this) (Todd, FrikaC)
2 optimization darkplaces collision: do trace against patch bbox before testing triangles
2 optimization darkplaces renderer: move skybox/skysphere render to after sky polygons, so that they can do a depth comparison to draw only on the sky polygons, using DepthRange(1,1) and DepthFunc(GL_GREATER), note though that portal renders will need half depth range (Mercury)
-3 bug darkplaces client: make "wait" command wait for next network frame somehow when connected, to make frikbot .way files load properly (Nexuiz, Transfusion, FrikaC)
3 bug darkplaces collision: add edge bevels in collision code, by trying all crossproduct combinations of an edge with planes from the other brush, and choosing only the ones which are valid
3 bug darkplaces compatibility: quakerally does not work, figure out why (Spike)
3 bug darkplaces compatibility: targetquake does not work, figure out why
d bug darkplaces client: do replay cl_movement queue each time a move is added, as this is called from the server packet parser, which can overwhelm the client with several packets in one frame, leading to a complete lockup until the level changes (Black)
d bug darkplaces client: figure out why multimap demos are skipping the later portions, it's probably related to the time seeking, probably not being reset (Urre)
d bug darkplaces client: finale text during episode-end intermissions shows briefly in its entirety and all as one line (going off the screen), then disappears and begins typing slowly as it should (Sajt)
+d bug darkplaces client: make "wait" command wait fornext network frame somehow when connected, to make frikbot .way files load properly (Transfusion, FrikaC)
d bug darkplaces client: make envmap command work with the corrected layout
d bug darkplaces client: make server queries use a queue to avoid flooding out queries too fast (Willis)
d bug darkplaces client: missing bolt/beam models should not produce warnings
d bug darkplaces model: ignore attempts to load "" (SavageX, Vermeulen)
d bug darkplaces particles: cl_particles_quality is affecting lifetime of decals, it should not
d bug darkplaces physics: corpses/gibs are not riding down e1m1 lift (scar3crow)
+d bug darkplaces physics: q3bsp collisions are still glitchy, particularly gunshots hitting thin air near brushes, even with mod_q3bsp_optimizedtraceline 0, test in dpdm2r by shooting down through gaps in the architecture around the top platform (Vermeulen)
d bug darkplaces physics: test TecnoX and find the frikbot crash in SV_Physics (KrimZon)
d bug darkplaces physics: the zombie lift in e3m2 before the gold key is not working (scar3crow)
d bug darkplaces protocol: fix cl_nodelta 1, it's halting updates after you move away from an area (Tomaz, sublim3)
d bug darkplaces protocol: it's possible to get a "received signon 1 when at 1" error in singleplayer when restarting level, perhaps this relates to very low framerate
d bug darkplaces protocol: models sometimes staying in nexuiz after a big battle, entities that don't exist on the server anymore (Spike)
d bug darkplaces protocol: something is causing things like tracers to sometimes stay indefinitely (Vermeulen)
+d bug darkplaces protocol: sometimes players are invisible in nexuiz, showing only their gun model, this may be related to svc_precache messages not being sent during signon (Vermeulen)
d bug darkplaces prvm: assignment to world is not producing an error after world spawn stage (Spike)
d bug darkplaces prvm: findchain/findchainfloat are corrupting things when trying to write to the .chain field (Kedhrin)
d bug darkplaces prvm: findflags/findchainflags are server-specific, these should be moved into the generic progs commands
d bug darkplaces server: running only one server frame per host frame is really bad in listen servers where the client may be too slow to keep up the server framerate
d bug darkplaces server: sending unused lightstyles in serverinfo packet is silly (Spike)
d bug darkplaces server: stepping while jumping is setting FL_GROUND (allowing the quake2 doublejump bug)
+d bug darkplaces server: sv_jumpstep should be defaulted to off because it makes it possible to reach places one should not be able to reach in quake, it can be turned on by particular games if desired (div0, SavageX, Kazashi)
d bug darkplaces server: when trying to load a map that is missing the model is still precached permanently, causing 'not found' warnings every time r_restart/vid_restart are used
d bug darkplaces sound: spatialization bug occurs in The Ascension of Vigil, making all player and monster sounds far to the right (RenegadeC)
+d bug dpmod: air control doesn't seem to be working (Kedhrin)
d bug dpmod: fix the 'shell casing spawning at wrong player' bug somehow
d bug dpmod: items aren't respawning in coop, they should
d bug dpmod: shouldn't get double kill for killing something and its corpse (Sajt)
if (r_render.integer)
{
+ CHECKGLERROR
if (r_speeds.integer || gl_finish.integer)
- qglFinish();
+ {
+ qglFinish();CHECKGLERROR
+ }
qaglSwapBuffers(context);
}
VID_UpdateGamma(false, GAMMA_TABLE_SIZE);
if (r_render.integer)
{
+ CHECKGLERROR
if (r_speeds.integer || gl_finish.integer)
- qglFinish();
- qglXSwapBuffers(vidx11_display, win);
+ {
+ qglFinish();CHECKGLERROR
+ }
+ qglXSwapBuffers(vidx11_display, win);CHECKGLERROR
}
if (vid_x11_hardwaregammasupported)
Uint8 appstate;
qboolean vid_usemouse;
+ CHECKGLERROR
if (r_speeds.integer || gl_finish.integer)
- qglFinish();
+ {
+ qglFinish();CHECKGLERROR
+ }
SDL_GL_SwapBuffers();
//react on appstate changes
Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions);
Con_Printf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+ CHECKGLERROR
qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max_texture_size);
Con_Print("Checking OpenGL extensions...\n");
if ((gl_support_shading_language_100 = GL_CheckExtension("GL_ARB_shading_language_100", NULL, "-noshadinglanguage100", false)))
if ((gl_support_vertex_shader = GL_CheckExtension("GL_ARB_vertex_shader", vertexshaderfuncs, "-novertexshader", false)))
gl_support_fragment_shader = GL_CheckExtension("GL_ARB_fragment_shader", NULL, "-nofragmentshader", false);
+ CHECKGLERROR
}
void Force_CenterView_f (void)
if (r_render.integer && !vid_hidden)
{
+ CHECKGLERROR
if (r_speeds.integer || gl_finish.integer)
- qglFinish();
+ {
+ qglFinish();CHECKGLERROR
+ }
SwapBuffers(baseDC);
}