Go to the documentation of this file.
28 extern char *strlwr (
char *
s);
158 for (
i=0 ;
i<4 ;
i++)
169 qglRotatef (e->
angles[1], 0, 0, 1);
170 qglRotatef (-e->
angles[0], 0, 1, 0);
171 qglRotatef (-e->
angles[2], 1, 0, 0);
214 if (psprite->type == SPR_ORIENTED)
216 vec3_t v_forward, v_right, v_up;
233 qglEnable( GL_BLEND );
235 qglColor4f( 1, 1, 1,
alpha );
242 qglEnable (GL_ALPHA_TEST);
244 qglDisable( GL_ALPHA_TEST );
248 qglTexCoord2f (0, 1);
251 qglVertex3fv (point);
253 qglTexCoord2f (0, 0);
256 qglVertex3fv (point);
258 qglTexCoord2f (1, 0);
261 qglVertex3fv (point);
263 qglTexCoord2f (1, 1);
266 qglVertex3fv (point);
270 qglDisable (GL_ALPHA_TEST);
274 qglDisable( GL_BLEND );
276 qglColor4f( 1, 1, 1, 1 );
299 qglDisable (GL_TEXTURE_2D);
302 qglBegin (GL_TRIANGLE_FAN);
303 qglVertex3f (0, 0, -16);
304 for (
i=0 ;
i<=4 ;
i++)
305 qglVertex3f (16*cos(
i*
M_PI/2), 16*sin(
i*
M_PI/2), 0);
308 qglBegin (GL_TRIANGLE_FAN);
309 qglVertex3f (0, 0, 16);
310 for (
i=4 ;
i>=0 ;
i--)
311 qglVertex3f (16*cos(
i*
M_PI/2), 16*sin(
i*
M_PI/2), 0);
316 qglEnable (GL_TEXTURE_2D);
424 qglDepthMask( GL_FALSE );
425 qglEnable( GL_BLEND );
427 qglBegin( GL_TRIANGLES );
442 scale = 1 + scale * 0.004;
444 *(
int *)color = colortable[p->
color];
445 color[3] = p->
alpha*255;
447 qglColor4ubv( color );
449 qglTexCoord2f( 0.0625, 0.0625 );
450 qglVertex3fv( p->
origin );
452 qglTexCoord2f( 1.0625, 0.0625 );
453 qglVertex3f( p->
origin[0] +
up[0]*scale,
457 qglTexCoord2f( 0.0625, 1.0625 );
464 qglDisable( GL_BLEND );
465 qglColor4f( 1,1,1,1 );
480 unsigned char color[4];
483 qglDepthMask( GL_FALSE );
484 qglEnable( GL_BLEND );
485 qglDisable( GL_TEXTURE_2D );
489 qglBegin( GL_POINTS );
493 color[3] = p->
alpha*255;
495 qglColor4ubv( color );
497 qglVertex3fv( p->
origin );
501 qglDisable( GL_BLEND );
502 qglColor4f( 1.0
F, 1.0
F, 1.0
F, 1.0
F );
503 qglDepthMask( GL_TRUE );
504 qglEnable( GL_TEXTURE_2D );
525 qglDisable (GL_ALPHA_TEST);
526 qglEnable (GL_BLEND);
527 qglDisable (GL_DEPTH_TEST);
528 qglDisable (GL_TEXTURE_2D);
533 qglRotatef (-90, 1, 0, 0);
534 qglRotatef (90, 0, 0, 1);
540 qglVertex3f (10, 100, 100);
541 qglVertex3f (10, -100, 100);
542 qglVertex3f (10, -100, -100);
543 qglVertex3f (10, 100, -100);
546 qglDisable (GL_BLEND);
547 qglEnable (GL_TEXTURE_2D);
548 qglEnable (GL_ALPHA_TEST);
562 for (
j=0 ;
j<3 ;
j++)
603 for (
i=0 ;
i<4 ;
i++)
663 for (
i=0 ;
i<4 ;
i++)
672 qglEnable( GL_SCISSOR_TEST );
673 qglClearColor( 0.3, 0.3, 0.3, 1 );
675 qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
676 qglClearColor( 1, 0, 0.5, 0.5 );
677 qglDisable( GL_SCISSOR_TEST );
685 GLdouble xmin, xmax, ymin, ymax;
687 ymax =
zNear * tan( fovy *
M_PI / 360.0 );
690 xmin = ymin * aspect;
691 xmax = ymax * aspect;
696 qglFrustum( xmin, xmax, ymin, ymax,
zNear,
zFar );
722 qglViewport (
x,
y2,
w, h);
729 qglMatrixMode(GL_PROJECTION);
733 qglCullFace(GL_FRONT);
735 qglMatrixMode(GL_MODELVIEW);
738 qglRotatef (-90, 1, 0, 0);
739 qglRotatef (90, 0, 0, 1);
754 qglEnable(GL_CULL_FACE);
756 qglDisable(GL_CULL_FACE);
758 qglDisable(GL_BLEND);
759 qglDisable(GL_ALPHA_TEST);
760 qglEnable(GL_DEPTH_TEST);
772 static int trickframe;
775 qglClear (GL_COLOR_BUFFER_BIT);
782 qglDepthFunc (GL_LEQUAL);
788 qglDepthFunc (GL_GEQUAL);
794 qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
796 qglClear (GL_DEPTH_BUFFER_BIT);
799 qglDepthFunc (GL_LEQUAL);
874 qglMatrixMode(GL_PROJECTION);
877 qglMatrixMode(GL_MODELVIEW);
879 qglDisable (GL_DEPTH_TEST);
880 qglDisable (GL_CULL_FACE);
881 qglDisable (GL_BLEND);
882 qglEnable (GL_ALPHA_TEST);
883 qglColor4f (1,1,1,1);
888 qglColor3f(
r, g, b );
891 qglColor3f( 0, 0, 0 );
892 qglVertex2f( 0,
y + 1 );
908 qglDrawBuffer( GL_BACK_LEFT );
910 for (
i = 0;
i < 20;
i++ )
912 qglBegin( GL_LINES );
1118 char renderer_buffer[1000];
1119 char vendor_buffer[1000];
1124 for (
j = 0;
j < 256;
j++ )
1176 strlwr( renderer_buffer );
1179 strlwr( vendor_buffer );
1181 if ( strstr( renderer_buffer,
"voodoo" ) )
1183 if ( !strstr( renderer_buffer,
"rush" ) )
1188 else if ( strstr( vendor_buffer,
"sgi" ) )
1190 else if ( strstr( renderer_buffer,
"permedia" ) )
1192 else if ( strstr( renderer_buffer,
"glint" ) )
1194 else if ( strstr( renderer_buffer,
"glzicd" ) )
1196 else if ( strstr( renderer_buffer,
"gdi" ) )
1198 else if ( strstr( renderer_buffer,
"pcx2" ) )
1200 else if ( strstr( renderer_buffer,
"verite" ) )
1267 qglLockArraysEXT = (
void * ) qwglGetProcAddress(
"glLockArraysEXT" );
1268 qglUnlockArraysEXT = (
void * ) qwglGetProcAddress(
"glUnlockArraysEXT" );
1278 qwglSwapIntervalEXT = (
BOOL (WINAPI *)(
int)) qwglGetProcAddress(
"wglSwapIntervalEXT" );
1292 qglPointParameterfvEXT = (
void (
APIENTRY *)(
GLenum,
const GLfloat * ) ) qwglGetProcAddress(
"glPointParameterfvEXT" );
1311 qgl3DfxSetPaletteEXT = (
void (
APIENTRY * ) (
GLuint *) )qwglGetProcAddress(
"gl3DfxSetPaletteEXT" );
1312 qglColorTableEXT = Fake_glColorTableEXT;
1325 if ( !qglColorTableEXT &&
1349 qglMTexCoord2fSGIS = (
void * ) qwglGetProcAddress(
"glMultiTexCoord2fARB" );
1350 qglActiveTextureARB = (
void * ) qwglGetProcAddress(
"glActiveTextureARB" );
1351 qglClientActiveTextureARB = (
void * ) qwglGetProcAddress(
"glClientActiveTextureARB" );
1367 if ( qglActiveTextureARB )
1374 qglMTexCoord2fSGIS = (
void * ) qwglGetProcAddress(
"glMTexCoord2fSGIS" );
1375 qglSelectTextureSGIS = (
void * ) qwglGetProcAddress(
"glSelectTextureSGIS" );
1394 #if 0 // commented out until H3D pays us the money they owe us
1403 err = qglGetError();
1404 if ( err != GL_NO_ERROR )
1457 ref->modified =
true;
1481 char envbuffer[1024];
1485 Com_sprintf( envbuffer,
sizeof(envbuffer),
"SSTV2_GAMMA=%f", g );
1486 putenv( envbuffer );
1487 Com_sprintf( envbuffer,
sizeof(envbuffer),
"SST_GAMMA=%f", g );
1488 putenv( envbuffer );
1498 qglMatrixMode(GL_PROJECTION);
1501 qglMatrixMode(GL_MODELVIEW);
1503 qglDisable (GL_DEPTH_TEST);
1504 qglDisable (GL_CULL_FACE);
1505 qglDisable (GL_BLEND);
1506 qglEnable (GL_ALPHA_TEST);
1507 qglColor4f (1,1,1,1);
1519 qglDrawBuffer( GL_FRONT );
1521 qglDrawBuffer( GL_BACK );
1582 for (
i = 0;
i < 256;
i++ )
1584 rp[
i*4+0] = palette[
i*3+0];
1585 rp[
i*4+1] = palette[
i*3+1];
1586 rp[
i*4+2] = palette[
i*3+2];
1592 for (
i = 0;
i < 256;
i++ )
1602 qglClearColor (0,0,0,0);
1603 qglClear (GL_COLOR_BUFFER_BIT);
1604 qglClearColor (1,0, 0.5 , 0.5);
1612 #define NUM_BEAM_SEGS 6
1618 vec3_t direction, normalized_direction;
1620 vec3_t oldorigin, origin;
1626 origin[0] = e->
origin[0];
1627 origin[1] = e->
origin[1];
1628 origin[2] = e->
origin[2];
1630 normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1631 normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1632 normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1640 for (
i = 0;
i < 6;
i++ )
1643 VectorAdd( start_points[
i], origin, start_points[
i] );
1644 VectorAdd( start_points[
i], direction, end_points[
i] );
1647 qglDisable( GL_TEXTURE_2D );
1648 qglEnable( GL_BLEND );
1649 qglDepthMask( GL_FALSE );
1659 qglColor4f(
r, g, b, e->
alpha );
1661 qglBegin( GL_TRIANGLE_STRIP );
1664 qglVertex3fv( start_points[
i] );
1665 qglVertex3fv( end_points[
i] );
1671 qglEnable( GL_TEXTURE_2D );
1672 qglDisable( GL_BLEND );
1673 qglDepthMask( GL_TRUE );
1744 #ifndef REF_HARD_LINKED
1751 va_start (argptr,
error);
1752 vsnprintf (text, 1024,
error, argptr);
1763 va_start (argptr, fmt);
1764 vsnprintf (text, 1024, fmt, argptr);
#define GL_RENDERER_VOODOO
void Draw_Char(int x, int y, int c)
cvar_t * gl_particle_min_size
void GLimp_Shutdown(void)
struct image_s *(* RegisterSkin)(char *name)
#define GL_RENDERER_INTERGRAPH
void(* Cmd_RemoveCommand)(char *name)
GLdouble GLdouble GLdouble y2
cvar_t * gl_particle_att_a
void R_BeginFrame(float camera_separation)
cvar_t * gl_saturatelighting
image_t * r_particletexture
CONST PIXELFORMATDESCRIPTOR int
#define VectorSubtract(a, b, c)
cvar_t * gl_ext_swapinterval
void R_RenderFrame(refdef_t *fd)
void Draw_Pic(int x, int y, char *name)
#define BOX_ON_PLANE_SIDE(emins, emaxs, p)
void R_PushDlights(model_t *model)
void R_DrawBeam(entity_t *e)
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
void GL_TextureAlphaMode(char *string)
const char * extensions_string
void(* DrawStretchRaw)(int x, int y, int w, int h, int cols, int rows, byte *data)
GLdouble GLdouble GLdouble GLdouble zNear
void GL_TextureMode(char *string)
const GLubyte *APIENTRY * qglGetString(GLenum name)
struct image_s *(* RegisterPic)(char *name)
void(* DrawFill)(int x, int y, int w, int h, int c)
mleaf_t * Mod_PointInLeaf(vec3_t p, model_t *model)
void R_LightPoint(vec3_t p, vec3_t color)
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
void Sys_Error(char *error,...)
cvar_t * gl_vertex_arrays
refexport_t GetRefAPI(refimport_t rimp)
#define GL_RENDERER_POWERVR
void GLimp_AppActivate(qboolean active)
struct image_s * Draw_FindPic(char *name)
void R_DrawSpriteModel(entity_t *e)
cvar_t * gl_ext_palettedtexture
cvar_t *(* Cvar_Set)(char *name, char *value)
void R_BeginRegistration(char *map)
#define GL_RENDERER_RENDITION
void(* AppActivate)(qboolean activate)
void GL_TextureSolidMode(char *string)
void GL_ImageList_f(void)
void GLimp_EnableLogging(qboolean enable)
void(* EndRegistration)(void)
void R_EndRegistration(void)
cvar_t * gl_3dlabs_broken
void GLimp_LogNewFrame(void)
#define GL_RENDERER_GLINT_MX
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void(* Con_Printf)(int print_level, char *str,...)
void(* DrawFadeScreen)(void)
cvar_t * gl_allow_software
void R_SetPalette(const unsigned char *palette)
void GLimp_BeginFrame(float camera_separation)
void Draw_InitLocal(void)
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
void Draw_FadeScreen(void)
CONST COLORREF COLORREF BOOL
void PerpendicularVector(vec3_t dst, const vec3_t src)
cvar_t * gl_texturealphamode
GLuint(APIENTRY *qglGenLists)(GLsizei range)
cvar_t * gl_texturesolidmode
void Com_Printf(char *fmt,...)
void(* Sys_Error)(int err_level, char *str,...)
#define GL_RENDERER_VOODOO_RUSH
struct image_s * R_RegisterSkin(char *name)
float r_base_world_matrix[16]
#define GL_RENDERER_PERMEDIA2
rserr_t GLimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
static int error(vorb *f, enum STBVorbisError e)
vec_t VectorNormalize(vec3_t v)
void(* DrawGetPicSize)(int *w, int *h, char *name)
void(* CinematicSetPalette)(const unsigned char *palette)
void GL_SetTexturePalette(unsigned palette[256])
void R_RotateForEntity(entity_t *e)
void(* DrawPic)(int x, int y, char *name)
cvar_t * gl_particle_max_size
GLfloat GLfloat GLfloat alpha
struct model_s *(* RegisterModel)(char *name)
void MYgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
int Q_stricmp(char *s1, char *s2)
int SignbitsForPlane(cplane_t *out)
void Draw_GetPalette(void)
void(* BeginRegistration)(char *map)
#define GL_RENDERER_OTHER
#define VectorAdd(a, b, c)
const char * renderer_string
qboolean R_Init(void *hinstance, void *hWnd)
#define GL_RENDERER_REALIZM
void(* BeginFrame)(float camera_separation)
qboolean GLimp_Init(void *hinstance, void *wndproc)
void R_SetSky(char *name, float rotate, vec3_t axis)
image_t * skins[MAX_MD2SKINS]
void(* EndWorldRenderpass)(void)
unsigned d_8to24table[256]
void R_DrawNullModel(void)
void R_RenderDlights(void)
void(* SetSky)(char *name, float rotate, vec3_t axis)
static void GL_DrawColoredStereoLinePair(float r, float g, float b, float y)
void R_DrawBrushModel(entity_t *e)
void(* Vid_MenuInit)(void)
void GL_ScreenShot_f(void)
void Draw_GetPicSize(int *w, int *h, char *pic)
void GL_ShutdownImages(void)
void GL_TexEnv(GLenum mode)
void R_RenderView(refdef_t *fd)
void GL_UpdateSwapInterval(void)
cvar_t * gl_ext_pointparameters
void R_SetLightLevel(void)
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
unsigned r_rawpalette[256]
const char * vendor_string
void(* DrawStretchPic)(int x, int y, int w, int h, char *name)
#define GL_RENDERER_3DLABS
static void GL_DrawStereoPattern(void)
void R_DrawEntitiesOnList(void)
cvar_t * gl_ext_compiled_vertex_array
cvar_t * gl_particle_att_b
void Draw_TileClear(int x, int y, int w, int h, char *name)
void GLimp_EndFrame(void)
void(* DrawTileClear)(int x, int y, int w, int h, char *name)
void(* DrawChar)(int x, int y, int c)
void R_DrawAlphaSurfaces(void)
void R_DrawParticles(void)
struct model_s * R_RegisterModel(char *name)
GLdouble GLdouble GLdouble w
cvar_t * gl_particle_size
void(* Cvar_SetValue)(char *name, float value)
cparticle_t particles[MAX_PARTICLES]
void R_InitParticleTexture(void)
void Draw_Fill(int x, int y, int w, int h, int c)
void Draw_StretchPic(int x, int y, int w, int h, char *name)
qboolean(* Init)(void *hinstance, void *wndproc)
void Mod_Modellist_f(void)
cvar_t * gl_ext_multitexture
void GL_SetDefaultState(void)
@ rserr_invalid_fullscreen
const char * version_string
void Com_sprintf(char *dest, int size, char *fmt,...)
void(* RenderFrame)(refdef_t *fd)
cvar_t * gl_particle_att_c
void(APIENTRY *qglAccum)(GLenum op
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
void GL_DrawParticles(int num_particles, const particle_t particles[], const unsigned colortable[768])
qboolean QGL_Init(const char *dllname)
qboolean R_CullBox(vec3_t mins, vec3_t maxs)
void R_EndWorldRenderpass(void)
void R_DrawAliasModel(entity_t *e)