icculus quake2 doxygen
1.0 dev
|
|
Go to the documentation of this file.
153 for (
i=0 ;
i<4 ;
i++)
164 qglRotatef (e->
angles[1], 0, 0, 1);
165 qglRotatef (-e->
angles[0], 0, 1, 0);
166 qglRotatef (-e->
angles[2], 1, 0, 0);
209 if (psprite->type == SPR_ORIENTED)
211 vec3_t v_forward, v_right, v_up;
228 qglEnable( GL_BLEND );
230 qglColor4f( 1, 1, 1,
alpha );
237 qglEnable (GL_ALPHA_TEST);
239 qglDisable( GL_ALPHA_TEST );
243 qglTexCoord2f (0, 1);
246 qglVertex3fv (point);
248 qglTexCoord2f (0, 0);
251 qglVertex3fv (point);
253 qglTexCoord2f (1, 0);
256 qglVertex3fv (point);
258 qglTexCoord2f (1, 1);
261 qglVertex3fv (point);
265 qglDisable (GL_ALPHA_TEST);
269 qglDisable( GL_BLEND );
271 qglColor4f( 1, 1, 1, 1 );
294 qglDisable (GL_TEXTURE_2D);
297 qglBegin (GL_TRIANGLE_FAN);
298 qglVertex3f (0, 0, -16);
299 for (
i=0 ;
i<=4 ;
i++)
300 qglVertex3f (16*cos(
i*
M_PI/2), 16*sin(
i*
M_PI/2), 0);
303 qglBegin (GL_TRIANGLE_FAN);
304 qglVertex3f (0, 0, 16);
305 for (
i=4 ;
i>=0 ;
i--)
306 qglVertex3f (16*cos(
i*
M_PI/2), 16*sin(
i*
M_PI/2), 0);
311 qglEnable (GL_TEXTURE_2D);
419 qglDepthMask( GL_FALSE );
420 qglEnable( GL_BLEND );
422 qglBegin( GL_TRIANGLES );
437 scale = 1 + scale * 0.004;
439 *(
int *)color = colortable[p->
color];
440 color[3] = p->
alpha*255;
442 qglColor4ubv( color );
444 qglTexCoord2f( 0.0625, 0.0625 );
445 qglVertex3fv( p->
origin );
447 qglTexCoord2f( 1.0625, 0.0625 );
448 qglVertex3f( p->
origin[0] +
up[0]*scale,
452 qglTexCoord2f( 0.0625, 1.0625 );
459 qglDisable( GL_BLEND );
460 qglColor4f( 1,1,1,1 );
475 unsigned char color[4];
478 qglDepthMask( GL_FALSE );
479 qglEnable( GL_BLEND );
480 qglDisable( GL_TEXTURE_2D );
484 qglBegin( GL_POINTS );
488 color[3] = p->
alpha*255;
490 qglColor4ubv( color );
492 qglVertex3fv( p->
origin );
496 qglDisable( GL_BLEND );
497 qglColor4f( 1.0
F, 1.0
F, 1.0
F, 1.0
F );
498 qglDepthMask( GL_TRUE );
499 qglEnable( GL_TEXTURE_2D );
520 qglDisable (GL_ALPHA_TEST);
521 qglEnable (GL_BLEND);
522 qglDisable (GL_DEPTH_TEST);
523 qglDisable (GL_TEXTURE_2D);
528 qglRotatef (-90, 1, 0, 0);
529 qglRotatef (90, 0, 0, 1);
535 qglVertex3f (10, 100, 100);
536 qglVertex3f (10, -100, 100);
537 qglVertex3f (10, -100, -100);
538 qglVertex3f (10, 100, -100);
541 qglDisable (GL_BLEND);
542 qglEnable (GL_TEXTURE_2D);
543 qglEnable (GL_ALPHA_TEST);
557 for (
j=0 ;
j<3 ;
j++)
598 for (
i=0 ;
i<4 ;
i++)
658 for (
i=0 ;
i<4 ;
i++)
667 qglEnable( GL_SCISSOR_TEST );
668 qglClearColor( 0.3, 0.3, 0.3, 1 );
670 qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
671 qglClearColor( 1, 0, 0.5, 0.5 );
672 qglDisable( GL_SCISSOR_TEST );
680 GLdouble xmin, xmax, ymin, ymax;
682 ymax =
zNear * tan( fovy *
M_PI / 360.0 );
685 xmin = ymin * aspect;
686 xmax = ymax * aspect;
691 qglFrustum( xmin, xmax, ymin, ymax,
zNear,
zFar );
717 qglViewport (
x,
y2,
w, h);
724 qglMatrixMode(GL_PROJECTION);
728 qglCullFace(GL_FRONT);
730 qglMatrixMode(GL_MODELVIEW);
733 qglRotatef (-90, 1, 0, 0);
734 qglRotatef (90, 0, 0, 1);
749 qglEnable(GL_CULL_FACE);
751 qglDisable(GL_CULL_FACE);
753 qglDisable(GL_BLEND);
754 qglDisable(GL_ALPHA_TEST);
755 qglEnable(GL_DEPTH_TEST);
769 static int trickframe;
772 qglClear (GL_COLOR_BUFFER_BIT);
779 qglDepthFunc (GL_LEQUAL);
785 qglDepthFunc (GL_GEQUAL);
791 qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
793 qglClear (GL_DEPTH_BUFFER_BIT);
796 qglDepthFunc (GL_LEQUAL);
804 qglClear(GL_STENCIL_BUFFER_BIT);
876 qglMatrixMode(GL_PROJECTION);
879 qglMatrixMode(GL_MODELVIEW);
881 qglDisable (GL_DEPTH_TEST);
882 qglDisable (GL_CULL_FACE);
883 qglDisable (GL_BLEND);
884 qglEnable (GL_ALPHA_TEST);
885 qglColor4f (1,1,1,1);
889 static void GL_DrawColoredStereoLinePair(
float r,
float g,
float b,
float y )
891 qglColor3f(
r, g, b );
894 qglColor3f( 0, 0, 0 );
895 qglVertex2f( 0,
y + 1 );
899 static void GL_DrawStereoPattern(
void )
911 qglDrawBuffer( GL_BACK_LEFT );
913 for (
i = 0;
i < 20;
i++ )
915 qglBegin( GL_LINES );
916 GL_DrawColoredStereoLinePair( 1, 0, 0, 0 );
917 GL_DrawColoredStereoLinePair( 1, 0, 0, 2 );
918 GL_DrawColoredStereoLinePair( 1, 0, 0, 4 );
919 GL_DrawColoredStereoLinePair( 1, 0, 0, 6 );
920 GL_DrawColoredStereoLinePair( 0, 1, 0, 8 );
921 GL_DrawColoredStereoLinePair( 1, 1, 0, 10);
922 GL_DrawColoredStereoLinePair( 1, 1, 0, 12);
923 GL_DrawColoredStereoLinePair( 0, 1, 0, 14);
1122 char renderer_buffer[1000];
1123 char vendor_buffer[1000];
1128 for (
j = 0;
j < 256;
j++ )
1180 renderer_buffer[
sizeof(renderer_buffer)-1] = 0;
1181 strlwr( renderer_buffer );
1184 vendor_buffer[
sizeof(vendor_buffer)-1] = 0;
1185 strlwr( vendor_buffer );
1187 if ( strstr( renderer_buffer,
"voodoo" ) )
1189 if ( !strstr( renderer_buffer,
"rush" ) )
1194 else if ( strstr( vendor_buffer,
"sgi" ) )
1196 else if ( strstr( renderer_buffer,
"permedia" ) )
1198 else if ( strstr( renderer_buffer,
"glint" ) )
1200 else if ( strstr( renderer_buffer,
"glzicd" ) )
1202 else if ( strstr( renderer_buffer,
"gdi" ) )
1204 else if ( strstr( renderer_buffer,
"pcx2" ) )
1206 else if ( strstr( renderer_buffer,
"verite" ) )
1239 #if 0 && defined(__linux__)
1274 qglLockArraysEXT = (
void * ) qwglGetProcAddress(
"glLockArraysEXT" );
1275 qglUnlockArraysEXT = (
void * ) qwglGetProcAddress(
"glUnlockArraysEXT" );
1285 qwglSwapIntervalEXT = (
BOOL (WINAPI *)(
int)) qwglGetProcAddress(
"wglSwapIntervalEXT" );
1299 qglPointParameterfvEXT = (
void (
APIENTRY *)(
GLenum,
const GLfloat * ) ) qwglGetProcAddress(
"glPointParameterfvEXT" );
1318 qgl3DfxSetPaletteEXT = (
void (
APIENTRY * ) (
GLuint *) )qwglGetProcAddress(
"gl3DfxSetPaletteEXT" );
1319 qglColorTableEXT = Fake_glColorTableEXT;
1332 if ( !qglColorTableEXT &&
1356 qglMTexCoord2fSGIS = (
void * ) qwglGetProcAddress(
"glMultiTexCoord2fARB" );
1357 qglActiveTextureARB = (
void * ) qwglGetProcAddress(
"glActiveTextureARB" );
1358 qglClientActiveTextureARB = (
void * ) qwglGetProcAddress(
"glClientActiveTextureARB" );
1374 if ( qglActiveTextureARB )
1381 qglMTexCoord2fSGIS = (
void * ) qwglGetProcAddress(
"glMTexCoord2fSGIS" );
1382 qglSelectTextureSGIS = (
void * ) qwglGetProcAddress(
"glSelectTextureSGIS" );
1401 #if 0 // commented out until H3D pays us the money they owe us
1402 GL_DrawStereoPattern();
1410 err = qglGetError();
1411 if ( err != GL_NO_ERROR )
1466 ref->modified =
true;
1492 char envbuffer[1024];
1496 Com_sprintf( envbuffer,
sizeof(envbuffer),
"SSTV2_GAMMA=%f", g );
1497 putenv( envbuffer );
1498 Com_sprintf( envbuffer,
sizeof(envbuffer),
"SST_GAMMA=%f", g );
1499 putenv( envbuffer );
1509 qglMatrixMode(GL_PROJECTION);
1512 qglMatrixMode(GL_MODELVIEW);
1514 qglDisable (GL_DEPTH_TEST);
1515 qglDisable (GL_CULL_FACE);
1516 qglDisable (GL_BLEND);
1517 qglEnable (GL_ALPHA_TEST);
1518 qglColor4f (1,1,1,1);
1530 qglDrawBuffer( GL_FRONT );
1532 qglDrawBuffer( GL_BACK );
1583 for (
i = 0;
i < 256;
i++ )
1585 rp[
i*4+0] = palette[
i*3+0];
1586 rp[
i*4+1] = palette[
i*3+1];
1587 rp[
i*4+2] = palette[
i*3+2];
1593 for (
i = 0;
i < 256;
i++ )
1603 qglClearColor (0,0,0,0);
1604 qglClear (GL_COLOR_BUFFER_BIT);
1605 qglClearColor (1,0, 0.5 , 0.5);
1613 #define NUM_BEAM_SEGS 6
1619 vec3_t direction, normalized_direction;
1621 vec3_t oldorigin, origin;
1627 origin[0] = e->
origin[0];
1628 origin[1] = e->
origin[1];
1629 origin[2] = e->
origin[2];
1631 normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1632 normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1633 normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1641 for (
i = 0;
i < 6;
i++ )
1644 VectorAdd( start_points[
i], origin, start_points[
i] );
1645 VectorAdd( start_points[
i], direction, end_points[
i] );
1648 qglDisable( GL_TEXTURE_2D );
1649 qglEnable( GL_BLEND );
1650 qglDepthMask( GL_FALSE );
1660 qglColor4f(
r, g, b, e->
alpha );
1662 qglBegin( GL_TRIANGLE_STRIP );
1665 qglVertex3fv( start_points[
i] );
1666 qglVertex3fv( end_points[
i] );
1672 qglEnable( GL_TEXTURE_2D );
1673 qglDisable( GL_BLEND );
1674 qglDepthMask( GL_TRUE );
1744 #ifndef REF_HARD_LINKED
1751 va_start (argptr, error);
1752 vsprintf (text, error, argptr);
1763 va_start (argptr, fmt);
1764 vsprintf (text, 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)
cvar_t * gl_stencilshadow
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 UpdateHardwareGamma()
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
int(* Init)(void *hinstance, void *wndproc)
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)
int R_Init(void *hinstance, void *hWnd)
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)
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
#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]
unsigned d_8to24table[256]
void R_DrawNullModel(void)
void R_RenderDlights(void)
void(* SetSky)(char *name, float rotate, vec3_t axis)
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
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)
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_DrawAliasModel(entity_t *e)