43 if (gl_nobind->integer && !tmu) {
110 qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
112 qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
121 float scaled, scroll;
124 scaled =
glr.
fd.time * 0.5f;
127 scaled =
glr.
fd.time / 40;
128 scroll = -64 * (scaled - (
int)scaled);
148 #ifdef GL_ARB_fragment_program
155 param[0] =
glr.
fd.time;
156 param[1] =
glr.
fd.time;
157 param[2] = param[3] = 0;
230 void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
237 depth = zfar - znear;
239 matrix[0] = 2 /
width;
242 matrix[12] = -(xmax + xmin) /
width;
247 matrix[13] = -(ymax + ymin) /
height;
251 matrix[10] = -2 / depth;
252 matrix[14] = -(zfar + znear) / depth;
284 GLfloat xmin, xmax, ymin, ymax, zfar, znear;
290 if (
glr.
fd.rdflags & RDF_NOWORLDMODEL)
295 ymax = znear * tan(
glr.
fd.fov_y * M_PI / 360.0);
298 xmax = znear * tan(
glr.
fd.fov_x * M_PI / 360.0);
303 depth = zfar - znear;
305 matrix[0] = 2 * znear /
width;
307 matrix[8] = (xmax + xmin) /
width;
311 matrix[5] = 2 * znear /
height;
312 matrix[9] = (ymax + ymin) /
height;
317 matrix[10] = -(zfar + znear) / depth;
318 matrix[14] = -2 * zfar * znear / depth;
423 memset(&
gls, 0,
sizeof(
gls));
435 pixels = FS_AllocTempMem(pitch *
r_config.height);
438 GL_RGB, GL_UNSIGNED_BYTE, pixels);
440 int ideal_pitch =
r_config.width * 3;
441 if (pitch > ideal_pitch)
443 for (
int row = 1; row <
r_config.height; row++)
445 byte* src = pixels + row * pitch;
446 byte* dst = pixels + row * ideal_pitch;
447 memcpy(dst, src, ideal_pitch);
479 #ifdef GL_ARB_fragment_program
484 Com_Printf(
"...enabling GL_ARB_fragment_program\n");
488 Com_Printf(
"...ignoring GL_ARB_fragment_program\n");
491 Com_Printf(
"GL_ARB_fragment_program not found\n");
492 Cvar_Set(
"gl_fragment_program",
"0");
507 if (
GL_ShowErrors(
"Failed to initialize fragment program")) {
520 #ifdef GL_ARB_fragment_program