29 #include "../idlib/precompiled.h"
36 #include "../sys/win32/win_local.h"
45 const char *
r_rendererArgs[] = {
"best",
"arb",
"arb2",
"Cg",
"exp",
"nv10",
"nv20",
"r200",
NULL };
119 idCVar r_useLightCulling(
"r_useLightCulling",
"3",
CVAR_RENDERER |
CVAR_INTEGER,
"0 = none, 1 = box, 2 = exact clip of polyhedron faces, 3 = also areas", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
136 idCVar r_skipGuiShaders(
"r_skipGuiShaders",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"1 = skip all gui elements on surfaces, 2 = skip drawing but still handle events, 3 = draw but skip events", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
179 idCVar r_showLights(
"r_showLights",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"1 = just print volumes numbers, highlighting ones covering the view, 2 = also draw planes of each volume, 3 = also draw edges of each volume", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
181 idCVar r_showShadowCount(
"r_showShadowCount",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"colors screen based on shadow volume depth complexity, >= 2 = print overdraw count based on stencil index values, 3 = only show turboshadows, 4 = only show static shadows", 0, 4, idCmdSystem::ArgCompletion_Integer<0,4> );
186 idCVar r_showLightCount(
"r_showLightCount",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"1 = colors surfaces based on light count, 2 = also count everything through walls, 3 = also print overdraw", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
188 idCVar r_showTris(
"r_showTris",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"enables wireframe rendering of the world, 1 = only draw visible ones, 2 = draw all front facing, 3 = draw all", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
199 idCVar r_showTangentSpace(
"r_showTangentSpace",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"shade triangles by tangent space, 1 = use 1st tangent vector, 2 = use 2nd tangent vector, 3 = use normal vector", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
203 idCVar r_showOverDraw(
"r_showOverDraw",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"1 = geometry overdraw, 2 = light interaction overdraw, 3 = geometry and light interaction overdraw", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> );
208 idCVar r_showSkel(
"r_showSkel",
"0",
CVAR_RENDERER |
CVAR_INTEGER,
"draw the skeleton when model animates, 1 = draw model with skeleton, 2 = draw skeleton only", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> );
247 #ifdef GLX_VERSION_1_1
248 #define Q_ALLOCATE_MEMORY_NV "glXAllocateMemoryNV"
249 #define Q_FREE_MEMORY_NV "glXFreeMemoryNV"
251 #define Q_ALLOCATE_MEMORY_NV "wglAllocateMemoryNV"
252 #define Q_FREE_MEMORY_NV "wglFreeMemoryNV"
334 static void R_CheckPortableExtensions(
void ) {
393 common->
Printf(
"...using %s\n",
"GL_1.4_texture_lod_bias" );
396 common->
Printf(
"X..%s not found\n",
"GL_1.4_texture_lod_bias" );
557 {
"Mode 0: 320x240", 320, 240 },
558 {
"Mode 1: 400x300", 400, 300 },
559 {
"Mode 2: 512x384", 512, 384 },
560 {
"Mode 3: 640x480", 640, 480 },
561 {
"Mode 4: 800x600", 800, 600 },
562 {
"Mode 5: 1024x768", 1024, 768 },
563 {
"Mode 6: 1152x864", 1152, 864 },
564 {
"Mode 7: 1280x1024", 1280, 1024 },
565 {
"Mode 8: 1600x1200", 1600, 1200 },
567 static int s_numVidModes = (
sizeof(
r_vidModes ) /
sizeof( r_vidModes[0] ) );
572 static bool R_GetModeInfo(
int *width,
int *height,
int mode ) {
579 if ( mode >= s_numVidModes ) {
589 vm = &r_vidModes[
mode];
636 for ( i = 0 ; i < 2 ; i++ ) {
686 R_CheckPortableExtensions();
712 static bool glCheck =
false;
720 int ret = MessageBox(
NULL,
"Please install OpenGL drivers from your graphics hardware vendor to run " GAME_NAME ".\nYour OpenGL functionality is limited.",
721 "Insufficient OpenGL capabilities", MB_OKCANCEL | MB_ICONWARNING | MB_TASKMODAL );
722 if ( ret == IDCANCEL ) {
745 for ( i = 0 ; i < 10 ; i++ ) {
747 if ( err == GL_NO_ERROR ) {
751 case GL_INVALID_ENUM:
752 strcpy( s,
"GL_INVALID_ENUM" );
754 case GL_INVALID_VALUE:
755 strcpy( s,
"GL_INVALID_VALUE" );
757 case GL_INVALID_OPERATION:
758 strcpy( s,
"GL_INVALID_OPERATION" );
760 case GL_STACK_OVERFLOW:
761 strcpy( s,
"GL_STACK_OVERFLOW" );
763 case GL_STACK_UNDERFLOW:
764 strcpy( s,
"GL_STACK_UNDERFLOW" );
766 case GL_OUT_OF_MEMORY:
767 strcpy( s,
"GL_OUT_OF_MEMORY" );
787 static void R_ReloadSurface_f(
const idCmdArgs &args ) {
814 static void R_ListModes_f(
const idCmdArgs &args ) {
818 for ( i = 0; i < s_numVidModes; i++ ) {
844 if ( args.
Argc() != 2 ) {
849 imageNum = atoi( args.
Argv(1) );
850 if ( imageNum >= 0 && imageNum < globalImages->images.Num() ) {
872 if ( args.
Argc() < 2 ) {
892 common->
Printf(
"%5.1f seconds of video\n", len * 0.001 );
899 wavString = wavString +
".wav";
903 static int R_QsortSurfaceAreas(
const void *
a,
const void *
b ) {
943 list = (
idMaterial **)_alloca( count *
sizeof( *list ) );
945 for ( i = 0 ; i <
count ; i++ ) {
949 qsort( list, count,
sizeof( list[0] ), R_QsortSurfaceAreas );
952 for ( i = 0 ; i <
count ; i++ ) {
953 if ( list[i]->GetSurfaceArea() > 0 ) {
958 for ( ; i <
count ; i++ ) {
961 common->
Printf(
"%7i %s\n", blocks, list[i]->GetName() );
1002 for ( j = 0 ; j <
i ; j++ ) {
1034 if ( w2 != w1 || h2 != h1 ) {
1039 if ( memcmp( data1, data2, w1*h1*4 ) ) {
1070 static float R_RenderingFPS(
const renderView_t *renderView ) {
1074 static const int SAMPLE_MSEC = 1000;
1086 if ( end - start > SAMPLE_MSEC ) {
1091 float fps = count * 1000.0 / ( end -
start );
1113 fps = R_RenderingFPS( &view );
1115 msec = 1000.0 / fps;
1116 common->
Printf(
"kpix: %4i msec:%5.1f fps:%5.1f\n", kpix, msec, fps );
1121 fps = R_RenderingFPS( &view );
1122 msec = 1000.0 / fps;
1123 common->
Printf(
"single tri msec:%5.1f fps:%5.1f\n", msec, fps );
1129 fps = R_RenderingFPS( &view );
1130 msec = 1000.0 / fps;
1131 common->
Printf(
"no context msec:%5.1f fps:%5.1f\n", msec, fps );
1167 for (
int xo = 0 ; xo <
width ; xo += oldWidth ) {
1168 for (
int yo = 0 ; yo <
height ; yo += oldHeight ) {
1181 if ( xo + w > width ) {
1185 if ( yo + h > height ) {
1190 qglReadPixels( 0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, temp );
1192 int row = ( w * 3 + 3 ) & ~3;
1194 for (
int y = 0 ;
y < h ;
y++ ) {
1195 memcpy( buffer + ( ( yo +
y )* width + xo ) * 3,
1196 temp +
y * row, w * 3 );
1232 int pix = width *
height;
1235 memset (buffer, 0, 18);
1237 if ( blends <= 1 ) {
1240 unsigned short *shortBuffer = (
unsigned short *)
R_StaticAlloc(pix*2*3);
1241 memset (shortBuffer, 0, pix*2*3);
1246 for ( i = 0 ; i < blends ; i++ ) {
1249 for ( j = 0 ; j < pix*3 ; j++ ) {
1250 shortBuffer[
j] += buffer[18+
j];
1255 for ( i = 0 ; i < pix*3 ; i++ ) {
1256 buffer[18+
i] = shortBuffer[
i] / blends;
1265 buffer[12] = width & 255;
1266 buffer[13] = width >> 8;
1267 buffer[14] = height & 255;
1268 buffer[15] = height >> 8;
1272 c = 18 + width * height * 3;
1273 for (i=18 ; i<
c ; i+=3) {
1275 buffer[
i] = buffer[i+2];
1280 if ( strstr( fileName,
"viewnote" ) ) {
1310 if ( lastNumber > 99999 ) {
1313 for ( ; lastNumber < 99999 ; lastNumber++ ) {
1314 int frac = lastNumber;
1326 sprintf( fileName,
"%s%i%i%i%i%i.tga", base, a, b, c, d, e );
1327 if ( lastNumber == 99999 ) {
1349 #define MAX_BLENDS 256 // to keep the accumulation in shorts
1351 static int lastNumber = 0;
1360 switch ( args.
Argc() ) {
1371 checkname = args.
Argv( 1 );
1374 width = atoi( args.
Argv( 1 ) );
1375 height = atoi( args.
Argv( 2 ) );
1380 width = atoi( args.
Argv( 1 ) );
1381 height = atoi( args.
Argv( 2 ) );
1382 blends = atoi( args.
Argv( 3 ) );
1392 common->
Printf(
"usage: screenshot\n screenshot <filename>\n screenshot <width> <height>\n screenshot <width> <height> <blends>\n" );
1417 int pix = width *
height;
1421 memset (buffer, 0, 18);
1425 qglReadPixels( 0, 0, width, height, GL_STENCIL_INDEX , GL_UNSIGNED_BYTE, byteBuffer );
1427 for ( i = 0 ; i < pix ; i++ ) {
1431 buffer[18+i*3+2] = byteBuffer[
i];
1436 buffer[12] = width & 255;
1437 buffer[13] = width >> 8;
1438 buffer[14] = height & 255;
1439 buffer[15] = height >> 8;
1459 const char *baseName;
1465 char *extensions[6] = {
"_px.tga",
"_nx.tga",
"_py.tga",
"_ny.tga",
1466 "_pz.tga",
"_nz.tga" };
1469 if ( args.
Argc() != 2 && args.
Argc() != 3 && args.
Argc() != 4 ) {
1470 common->
Printf(
"USAGE: envshot <basename> [size] [blends]\n" );
1473 baseName = args.
Argv( 1 );
1476 if ( args.
Argc() == 4 ) {
1477 size = atoi( args.
Argv( 2 ) );
1478 blends = atoi( args.
Argv( 3 ) );
1479 }
else if ( args.
Argc() == 3 ) {
1480 size = atoi( args.
Argv( 2 ) );
1494 memset( &axis, 0,
sizeof( axis ) );
1519 for ( i = 0 ; i < 6 ; i++ ) {
1526 sprintf( fullname,
"env/%s%s", baseName, extensions[i] );
1535 static idMat3 cubeAxis[6];
1547 adir[0] = fabs(dir[0]);
1548 adir[1] = fabs(dir[1]);
1549 adir[2] = fabs(dir[2]);
1551 if ( dir[0] >= adir[1] && dir[0] >= adir[2] ) {
1553 }
else if ( -dir[0] >= adir[1] && -dir[0] >= adir[2] ) {
1555 }
else if ( dir[1] >= adir[0] && dir[1] >= adir[2] ) {
1557 }
else if ( -dir[1] >= adir[0] && -dir[1] >= adir[2] ) {
1559 }
else if ( dir[2] >= adir[1] && dir[2] >= adir[2] ) {
1565 float fx = (dir * cubeAxis[axis][1]) / (dir * cubeAxis[axis][0]);
1566 float fy = (dir * cubeAxis[axis][2]) / (dir * cubeAxis[axis][0]);
1570 x = size * 0.5 * (fx + 1);
1571 y = size * 0.5 * (fy + 1);
1574 }
else if ( x >= size ) {
1579 }
else if ( y >= size ) {
1583 result[0] = buffers[axis][(y*size+
x)*4+0];
1584 result[1] = buffers[axis][(y*size+
x)*4+1];
1585 result[2] = buffers[axis][(y*size+
x)*4+2];
1586 result[3] = buffers[axis][(y*size+
x)*4+3];
1600 const char *baseName;
1605 char *extensions[6] = {
"_px.tga",
"_nx.tga",
"_py.tga",
"_ny.tga",
1606 "_pz.tga",
"_nz.tga" };
1611 if ( args.
Argc() != 2 && args.
Argc() != 3 ) {
1612 common->
Printf(
"USAGE: ambientshot <basename> [size]\n" );
1615 baseName = args.
Argv( 1 );
1618 if ( args.
Argc() == 3 ) {
1619 outSize = atoi( args.
Argv( 2 ) );
1624 memset( &cubeAxis, 0,
sizeof( cubeAxis ) );
1625 cubeAxis[0][0][0] = 1;
1626 cubeAxis[0][1][2] = 1;
1627 cubeAxis[0][2][1] = 1;
1629 cubeAxis[1][0][0] = -1;
1630 cubeAxis[1][1][2] = -1;
1631 cubeAxis[1][2][1] = 1;
1633 cubeAxis[2][0][1] = 1;
1634 cubeAxis[2][1][0] = -1;
1635 cubeAxis[2][2][2] = -1;
1637 cubeAxis[3][0][1] = -1;
1638 cubeAxis[3][1][0] = -1;
1639 cubeAxis[3][2][2] = 1;
1641 cubeAxis[4][0][2] = 1;
1642 cubeAxis[4][1][0] = -1;
1643 cubeAxis[4][2][1] = 1;
1645 cubeAxis[5][0][2] = -1;
1646 cubeAxis[5][1][0] = 1;
1647 cubeAxis[5][2][1] = 1;
1650 for ( i = 0 ; i < 6 ; i++ ) {
1651 sprintf( fullname,
"env/%s%s", baseName, extensions[i] );
1655 if ( !buffers[i] ) {
1657 for ( i-- ; i >= 0 ; i-- ) {
1667 byte *outBuffer = (
byte *)_alloca( outSize * outSize * 4 );
1669 for (
int map = 0 ; map < 2 ; map++ ) {
1670 for ( i = 0 ; i < 6 ; i++ ) {
1671 for (
int x = 0 ;
x < outSize ;
x++ ) {
1672 for (
int y = 0 ;
y < outSize ;
y++ ) {
1676 dir = cubeAxis[
i][0] + -( -1 + 2.0*
x/(outSize-1) ) * cubeAxis[
i][1] + -( -1 + 2.0*
y/(outSize-1) ) * cubeAxis[
i][2];
1678 total[0] = total[1] = total[2] = 0;
1680 float limit = map ? 0.95 : 0.25;
1682 for (
int s = 0 ;
s < samples ;
s++ ) {
1687 for (
int j = 0 ;
j < 3 ;
j++ ) {
1688 test[
j] = -1 + 2 * (rand()&0x7fff)/(
float)0x7fff;
1690 if ( test.
Length() > 1.0 ) {
1694 if ( test * dir > limit ) {
1701 total[0] += result[0];
1702 total[1] += result[1];
1703 total[2] += result[2];
1705 outBuffer[(
y*outSize+
x)*4+0] = total[0] / samples;
1706 outBuffer[(
y*outSize+
x)*4+1] = total[1] / samples;
1707 outBuffer[(
y*outSize+
x)*4+2] = total[2] / samples;
1708 outBuffer[(
y*outSize+
x)*4+3] = 255;
1713 sprintf( fullname,
"env/%s_amb%s", baseName, extensions[i] );
1715 sprintf( fullname,
"env/%s_spec%s", baseName, extensions[i] );
1719 R_WriteTGA( fullname, outBuffer, outSize, outSize );
1723 for ( i = 0 ; i < 6 ; i++ ) {
1746 for ( i = 0; i < 256; i++ ) {
1755 inf = 0xffff * pow ( j/255.0
f, 1.0
f / g ) + 0.5f;
1777 const char *fsstrings[] =
1804 const char *active[2] = {
"",
" (ACTIVE)" };
1843 typedef BOOL (
WINAPI * PFNWGLSWAPINTERVALEXTPROC) (
int interval);
1856 common->
Printf(
"Two sided stencil available but disabled\n" );
1857 }
else if ( !tss ) {
1884 bool forceWindow =
false;
1885 for (
int i = 1 ; i < args.
Argc() ; i++ ) {
1925 if ( forceWindow ) {
1955 if ( err != GL_NO_ERROR ) {
1989 static void R_SizeUp_f(
const idCmdArgs &args ) {
2005 static void R_SizeDown_f(
const idCmdArgs &args ) {
2022 const char *gui = args.
Argv( 1 );
2103 memset( &
pc, 0,
sizeof(
pc ) );
2125 common->
Printf(
"------- Initializing renderSystem --------\n" );
2172 common->
Printf(
"--------------------------------------\n" );
2197 fprintf(
logFile,
"*** CLOSING LOG ***\n" );
2258 if ( err != GL_NO_ERROR ) {
idCVar r_customHeight("r_customHeight","486", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"custom screen height. set r_mode to -1 to activate")
idCVar r_showSmp("r_showSmp","0", CVAR_RENDERER|CVAR_BOOL,"show which end (front or back) is blocking")
void R_InitFrameData(void)
idCVar r_showImages("r_showImages","0", CVAR_RENDERER|CVAR_INTEGER,"1 = show all images instead of rendering, 2 = show in proportional size", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
PFNGLGETBUFFERSUBDATAARBPROC qglGetBufferSubDataARB
idCVar r_skipParticles("r_skipParticles","0", CVAR_RENDERER|CVAR_INTEGER,"1 = skip all particle systems", 0, 1, idCmdSystem::ArgCompletion_Integer< 0, 1 >)
idCVar r_useEntityScissors("r_useEntityScissors","0", CVAR_RENDERER|CVAR_BOOL,"1 = use custom scissor rectangle for each entity")
idCVar r_skipOverlays("r_skipOverlays","0", CVAR_RENDERER|CVAR_BOOL,"skip overlay surfaces")
static void ShutdownCinematic(void)
static int snPrintf(char *dest, int size, const char *fmt,...) id_attribute((format(printf
void R_ShutdownFrameData(void)
void R_ReportSurfaceAreas_f(const idCmdArgs &args)
virtual void EndFrame(int *frontEndMsec, int *backEndMsec)=0
GLenum GLenum GLenum GLenum GLenum GLenum GLboolean GLboolean cdDotProduct
GLvoid *APIENTRYP PFNGLMAPBUFFERARBPROC(GLenum target, GLenum access)
static void InitCinematic(void)
idCVar r_useShadowCulling("r_useShadowCulling","1", CVAR_RENDERER|CVAR_BOOL,"try to cull shadows from partially visible lights")
idCVar r_glDriver("r_glDriver","", CVAR_RENDERER,"\"opengl32\", etc.")
idCVar r_frontBuffer("r_frontBuffer","0", CVAR_RENDERER|CVAR_BOOL,"draw to front buffer for debugging")
PFNGLPROGRAMENVPARAMETER4FVARBPROC qglProgramEnvParameter4fvARB
idCVarSystem * cvarSystem
void R_TestVideo_f(const idCmdArgs &args)
idCVar r_gamma("r_gamma","1", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_FLOAT,"changes gamma tables", 0.5f, 3.0f)
PFNGLPROGRAMSTRINGARBPROC qglProgramStringARB
void GL_CheckErrors(void)
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
idCVar r_swapInterval("r_swapInterval","0", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"changes wglSwapIntarval")
idCVar r_useIndexBuffers("r_useIndexBuffers","0", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"use ARB_vertex_buffer_object for indexes", 0, 1, idCmdSystem::ArgCompletion_Integer< 0, 1 >)
idCVar r_showEntityScissors("r_showEntityScissors","0", CVAR_RENDERER|CVAR_BOOL,"show entity scissor rectangles")
idCVar r_showInteractionFrustums("r_showInteractionFrustums","0", CVAR_RENDERER|CVAR_INTEGER,"1 = show a frustum for each interaction, 2 = also draw lines to light origin, 3 = also draw entity bbox", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
PFNGLISBUFFERARBPROC qglIsBufferARB
virtual int AnimationLength()
float GetFloat(void) const
idCVar r_showPortals("r_showPortals","0", CVAR_RENDERER|CVAR_BOOL,"draw portal outlines in color based on passed / not passed")
class idGuiModel * guiModel
idCVar r_useStateCaching("r_useStateCaching","1", CVAR_RENDERER|CVAR_BOOL,"avoid redundant state changes in GL_*() calls")
idCVar r_skipDynamicTextures("r_skipDynamicTextures","0", CVAR_RENDERER|CVAR_BOOL,"don't dynamically create textures")
idCVar r_useInteractionScissors("r_useInteractionScissors","2", CVAR_RENDERER|CVAR_INTEGER,"1 = use a custom scissor rectangle for each shadow interaction, 2 = also crop using portal scissors",-2, 2, idCmdSystem::ArgCompletion_Integer<-2, 2 >)
idCVar r_singleTriangle("r_singleTriangle","0", CVAR_RENDERER|CVAR_BOOL,"only draw a single triangle per primitive")
idCVar r_testARBProgram("r_testARBProgram","0", CVAR_RENDERER|CVAR_BOOL,"experiment with vertex/fragment programs")
bool R_GetModeInfo(int *width, int *height, int mode)
virtual void BeginLevelLoad()=0
idCVar r_useVertexBuffers("r_useVertexBuffers","1", CVAR_RENDERER|CVAR_INTEGER,"use ARB_vertex_buffer_object for vertexes", 0, 1, idCmdSystem::ArgCompletion_Integer< 0, 1 >)
idCVar r_skipTranslucent("r_skipTranslucent","0", CVAR_RENDERER|CVAR_BOOL,"skip the translucent interaction rendering")
idCVar r_finish("r_finish","0", CVAR_RENDERER|CVAR_BOOL,"force a call to glFinish() every frame")
idCVar r_useTwoSidedStencil("r_useTwoSidedStencil","1", CVAR_RENDERER|CVAR_BOOL,"do stencil shadows in one pass with different ops on each side")
idCVar r_useShadowVertexProgram("r_useShadowVertexProgram","1", CVAR_RENDERER|CVAR_BOOL,"do the shadow projection in the vertex program on capable cards")
bool anisotropicAvailable
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
PFNGLGENBUFFERSARBPROC qglGenBuffersARB
bool textureEnvCombineAvailable
idCVar r_debugRenderToTexture("r_debugRenderToTexture","0", CVAR_RENDERER|CVAR_INTEGER,"")
bool textureLODBiasAvailable
void Sys_ShutdownInput(void)
bool R_CheckExtension(char *name)
virtual bool InitHW(void)=0
idCVar r_showTris("r_showTris","0", CVAR_RENDERER|CVAR_INTEGER,"enables wireframe rendering of the world, 1 = only draw visible ones, 2 = draw all front facing, 3 = draw all", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
void *APIENTRY * qAllocateMemoryNV(GLsizei size, float readFrequency, float writeFrequency, float priority)
idCVar r_brightness("r_brightness","1", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_FLOAT,"changes gamma tables", 0.5f, 2.0f)
virtual void PlayShaderDirectly(const char *name, int channel=-1)=0
idCVar r_showTextureVectors("r_showTextureVectors","0", CVAR_RENDERER|CVAR_FLOAT," if > 0 draw each triangles texture (tangent) vectors")
const idMaterial * material
idCVar r_shadowPolygonFactor("r_shadowPolygonFactor","0", CVAR_RENDERER|CVAR_FLOAT,"scale value for stencil shadow drawing")
idCVar r_useEntityCallbacks("r_useEntityCallbacks","1", CVAR_RENDERER|CVAR_BOOL,"if 0, issue the callback immediately at update time, rather than defering")
drawSurfsCommand_t lockSurfacesCmd
bool EverReferenced(void) const
idRenderSystem * renderSystem
idCVar r_showSilhouette("r_showSilhouette","0", CVAR_RENDERER|CVAR_BOOL,"highlight edges that are casting shadow planes")
int Sys_Milliseconds(void)
idCVar r_forceLoadImages("r_forceLoadImages","0", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_BOOL,"draw all images to screen after registration")
idCVar r_shadowPolygonOffset("r_shadowPolygonOffset","-1", CVAR_RENDERER|CVAR_FLOAT,"bias value added to depth test for stencil shadow drawing")
virtual void RenderScene(const renderView_t *renderView)
idCVar r_skipSpecular("r_skipSpecular","0", CVAR_RENDERER|CVAR_BOOL|CVAR_CHEAT|CVAR_ARCHIVE,"use black for specular1")
idCVar r_showVertexColor("r_showVertexColor","0", CVAR_RENDERER|CVAR_BOOL,"draws all triangles with the solid vertex color")
idCVar r_checkBounds("r_checkBounds","0", CVAR_RENDERER|CVAR_BOOL,"compare all surface bounds with precalculated ones")
idFileSystem * fileSystem
PFNGLMAPBUFFERARBPROC qglMapBufferARB
void R_LoadImage(const char *name, byte **pic, int *width, int *height, ID_TIME_T *timestamp, bool makePowerOf2)
bool depthBoundsTestAvailable
idCVar r_screenFraction("r_screenFraction","100", CVAR_RENDERER|CVAR_INTEGER,"for testing fill rate, the resolution of the entire screen can be changed")
OSVERSIONINFOEX osversion
idCVar r_useNodeCommonChildren("r_useNodeCommonChildren","1", CVAR_RENDERER|CVAR_BOOL,"stop pushing reference bounds early when possible")
void R_TestImage_f(const idCmdArgs &args)
struct vidmode_s vidmode_t
#define GL_MAX_TEXTURE_COORDS_ARB
const char * GetName(void) const
idCVar r_useShadowSurfaceScissor("r_useShadowSurfaceScissor","1", CVAR_RENDERER|CVAR_BOOL,"scissor shadows by the scissor rect of the interaction surfaces")
GLExtension_t GLimp_ExtensionPointer(const char *name)
idCVar r_renderer("r_renderer","best", CVAR_RENDERER|CVAR_ARCHIVE,"hardware specific renderer path to use", r_rendererArgs, idCmdSystem::ArgCompletion_String< r_rendererArgs >)
virtual void ExecuteCommandBuffer(void)=0
static idCinematic * Alloc()
GLenum GLenum GLenum GLenum sumOutput
idCVar r_useExternalShadows("r_useExternalShadows","1", CVAR_RENDERER|CVAR_INTEGER,"1 = skip drawing caps when outside the light volume, 2 = force to no caps for testing", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
idCVar r_orderIndexes("r_orderIndexes","1", CVAR_RENDERER|CVAR_BOOL,"perform index reorganization to optimize vertex use")
PFNGLSETFRAGMENTSHADERCONSTANTATIPROC qglSetFragmentShaderConstantATI
idCVar r_shadows("r_shadows","1", CVAR_RENDERER|CVAR_BOOL|CVAR_ARCHIVE,"enable shadows")
idRenderWorldLocal * primaryWorld
idCVar r_useShadowProjectedCull("r_useShadowProjectedCull","1", CVAR_RENDERER|CVAR_BOOL,"discard triangles outside light volume before shadowing")
idCVar r_fullscreen("r_fullscreen","1", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_BOOL,"0 = windowed, 1 = full screen")
idCVar r_useNV20MonoLights("r_useNV20MonoLights","1", CVAR_RENDERER|CVAR_INTEGER,"use pass optimization for mono lights")
unsigned short gammaTable[256]
idCVar r_showSkel("r_showSkel","0", CVAR_RENDERER|CVAR_INTEGER,"draw the skeleton when model animates, 1 = draw model with skeleton, 2 = draw skeleton only", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
void R_MakeAmbientMap_f(const idCmdArgs &args)
void R_ListGuis_f(const idCmdArgs &args)
void SetBackEndRenderer()
void R_RegenerateWorld_f(const idCmdArgs &args)
PFNGLGETBUFFERPOINTERVARBPROC qglGetBufferPointervARB
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void R_DoneFreeType(void)
void ReloadImages(bool force) const
class idGuiModel * demoGuiModel
idCVar r_singleSurface("r_singleSurface","-1", CVAR_RENDERER|CVAR_INTEGER,"suppress all but one surface on each entity")
idCVar r_lockSurfaces("r_lockSurfaces","0", CVAR_RENDERER|CVAR_BOOL,"allow moving the view point without changing the composition of the scene, including culling")
idList< idRenderWorldLocal * > worlds
PFNGLACTIVESTENCILFACEEXTPROC qglActiveStencilFaceEXT
idCVar r_useInteractionCulling("r_useInteractionCulling","1", CVAR_RENDERER|CVAR_BOOL,"1 = cull interactions")
idCVar r_showOverDraw("r_showOverDraw","0", CVAR_RENDERER|CVAR_INTEGER,"1 = geometry overdraw, 2 = light interaction overdraw, 3 = geometry and light interaction overdraw", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
GLenum GLenum GLenum cdOutput
PFNGLBINDPROGRAMARBPROC qglBindProgramARB
idUserInterfaceManager * uiManager
PFNGLDELETEFRAGMENTSHADERATIPROC qglDeleteFragmentShaderATI
void R_LoadImageProgram(const char *name, byte **pic, int *width, int *height, ID_TIME_T *timestamp, textureDepth_t *depth=NULL)
virtual void BeginFrame(int windowWidth, int windowHeight)=0
virtual bool Trace(modelTrace_t &trace, const idVec3 &start, const idVec3 &end, const float radius, bool skipDynamic=true, bool skipPlayer=false) const
idCVar r_useClippedLightScissors("r_useClippedLightScissors","1", CVAR_RENDERER|CVAR_INTEGER,"0 = full screen when near clipped, 1 = exact when near clipped, 2 = exact always", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
idCVar r_skipUpdates("r_skipUpdates","0", CVAR_RENDERER|CVAR_BOOL,"1 = don't accept any entity or light updates, making everything static")
bool sharedTexturePaletteAvailable
const int MAX_MULTITEXTURE_UNITS
idCVar r_showUnsmoothedTangents("r_showUnsmoothedTangents","0", CVAR_RENDERER|CVAR_BOOL,"if 1, put all nvidia register combiner programming in display lists")
idCVar r_skipBackEnd("r_skipBackEnd","0", CVAR_RENDERER|CVAR_BOOL,"don't draw anything")
int Icmp(const char *text) const
virtual int WriteFile(const char *relativePath, const void *buffer, int size, const char *basePath="fs_savepath")=0
virtual bool InitFromFile(const char *qpath, bool looping)
static void MakeMegaTexture_f(const idCmdArgs &args)
idCVar r_showSurfaceInfo("r_showSurfaceInfo","0", CVAR_RENDERER|CVAR_BOOL,"show surface material name under crosshair")
idCVar r_skipSuppress("r_skipSuppress","0", CVAR_RENDERER|CVAR_BOOL,"ignore the per-view suppressions")
idCVar r_showShadowCount("r_showShadowCount","0", CVAR_RENDERER|CVAR_INTEGER,"colors screen based on shadow volume depth complexity, >= 2 = print overdraw count based on stencil index values, 3 = only show turboshadows, 4 = only show static shadows", 0, 4, idCmdSystem::ArgCompletion_Integer< 0, 4 >)
PFNGLALPHAFRAGMENTOP2ATIPROC qglAlphaFragmentOp2ATI
virtual bool IsFullScreen(void) const
idCVar r_multiSamples("r_multiSamples","0", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"number of antialiasing samples")
bool GLimp_SetScreenParms(glimpParms_t parms)
idCVar r_showDemo("r_showDemo","0", CVAR_RENDERER|CVAR_BOOL,"report reads and writes to the demo file")
idCVar r_showAlloc("r_showAlloc","0", CVAR_RENDERER|CVAR_BOOL,"report alloc/free counts")
PFNGLPROGRAMLOCALPARAMETER4FVARBPROC qglProgramLocalParameter4fvARB
backEndName_t backEndRenderer
const char * wgl_extensions_string
idCVar r_ignore("r_ignore","0", CVAR_RENDERER,"used for random debugging without defining new vars")
idCVar r_debugArrowStep("r_debugArrowStep","120", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"step size of arrow cone line rotation in degrees", 0, 120)
idCVar r_skipNewAmbient("r_skipNewAmbient","0", CVAR_RENDERER|CVAR_BOOL|CVAR_ARCHIVE,"bypasses all vertex/fragment program ambient drawing")
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
idCVar r_skipROQ("r_skipROQ","0", CVAR_RENDERER|CVAR_BOOL,"skip ROQ decoding")
void R_EnvShot_f(const idCmdArgs &args)
idCVar r_showLights("r_showLights","0", CVAR_RENDERER|CVAR_INTEGER,"1 = just print volumes numbers, highlighting ones covering the view, 2 = also draw planes of each volume, 3 = also draw edges of each volume", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
idCVar r_showTrace("r_showTrace","0", CVAR_RENDERER|CVAR_INTEGER,"show the intersection of an eye trace with the world", idCmdSystem::ArgCompletion_Integer< 0, 2 >)
bool atiTwoSidedStencilAvailable
virtual void BeginFrame(int windowWidth, int windowHeight)
idCVar r_useDeferredTangents("r_useDeferredTangents","1", CVAR_RENDERER|CVAR_BOOL,"defer tangents calculations after deform")
bool backEndRendererHasVertexPrograms
GLuint GLuint GLsizei count
typedef GLboolean(APIENTRYP PFNGLISQUERYPROC)(GLuint id)
void R_SampleCubeMap(const idVec3 &dir, int size, byte *buffers[6], byte result[4])
float maxTextureAnisotropy
void R_InitTriSurfData(void)
void R_SetColorMappings(void)
idCVar r_useSilRemap("r_useSilRemap","1", CVAR_RENDERER|CVAR_BOOL,"consider verts with the same XYZ, but different ST the same for shadows")
virtual void Shutdown(void)
GLenum GLenum GLenum input
GLenum GLenum GLenum GLenum GLenum GLenum GLboolean abDotProduct
idCVar r_testStepGamma("r_testStepGamma","0", CVAR_RENDERER|CVAR_FLOAT,"if > 0 draw a grid pattern to test gamma levels")
GLubyte GLubyte GLubyte GLubyte w
virtual void TakeScreenshot(int width, int height, const char *fileName, int downSample, renderView_t *ref)
idImage * ambientCubeImage
GLenum GLenum GLenum GLenum GLenum scale
idStr & StripFileExtension(void)
void R_ReadTiledPixels(int width, int height, byte *buffer, renderView_t *ref=NULL)
PFNGLBINDBUFFERARBPROC qglBindBufferARB
idCVar r_skipBump("r_skipBump","0", CVAR_RENDERER|CVAR_BOOL|CVAR_ARCHIVE,"uses a flat surface instead of the bump map")
GLenum GLenum GLenum GLenum GLenum GLenum GLboolean GLboolean GLboolean muxSum
bool ARBVertexBufferObjectAvailable
idCVar r_lightSourceRadius("r_lightSourceRadius","0", CVAR_RENDERER|CVAR_FLOAT,"for soft-shadow sampling")
idCVar r_useDepthBoundsTest("r_useDepthBoundsTest","1", CVAR_RENDERER|CVAR_BOOL,"use depth bounds test to reduce shadow fill")
idCVar r_useConstantMaterials("r_useConstantMaterials","1", CVAR_RENDERER|CVAR_BOOL,"use pre-calculated material registers if possible")
idCVar r_showUpdates("r_showUpdates","0", CVAR_RENDERER|CVAR_BOOL,"report entity and light updates and ref counts")
viewEntity_t identitySpace
idCVar r_showNormals("r_showNormals","0", CVAR_RENDERER|CVAR_FLOAT,"draws wireframe normals")
idCVar r_testGammaBias("r_testGammaBias","0", CVAR_RENDERER|CVAR_FLOAT,"if > 0 draw a grid pattern to test gamma levels")
idCVar r_skipGuiShaders("r_skipGuiShaders","0", CVAR_RENDERER|CVAR_INTEGER,"1 = skip all gui elements on surfaces, 2 = skip drawing but still handle events, 3 = draw but skip events", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
idCVar r_skipRender("r_skipRender","0", CVAR_RENDERER|CVAR_BOOL,"skip 3D rendering, but pass 2D")
idCVar r_showViewEntitys("r_showViewEntitys","0", CVAR_RENDERER|CVAR_INTEGER,"1 = displays the bounding boxes of all view models, 2 = print index numbers")
idCVar r_showCull("r_showCull","0", CVAR_RENDERER|CVAR_BOOL,"report sphere and box culling stats")
idCVar r_debugLineDepthTest("r_debugLineDepthTest","0", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_BOOL,"perform depth test on debug lines")
const char * vendor_string
idCVar r_subviewOnly("r_subviewOnly","0", CVAR_RENDERER|CVAR_BOOL,"1 = don't render main view, allowing subviews to be debugged")
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT
virtual int GetScreenHeight(void) const
idCVar r_useLightCulling("r_useLightCulling","3", CVAR_RENDERER|CVAR_INTEGER,"0 = none, 1 = box, 2 = exact clip of polyhedron faces, 3 = also areas", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
idCVar r_showTangentSpace("r_showTangentSpace","0", CVAR_RENDERER|CVAR_INTEGER,"shade triangles by tangent space, 1 = use 1st tangent vector, 2 = use 2nd tangent vector, 3 = use normal vector", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
virtual int GetScreenWidth(void) const
idCVar r_useTripleTextureARB("r_useTripleTextureARB","1", CVAR_RENDERER|CVAR_BOOL,"cards with 3+ texture units do a two pass instead of three pass")
PFNGLVERTEXATTRIBPOINTERARBPROC qglVertexAttribPointerARB
bool multitextureAvailable
void SetInteger(const int value)
idCVar r_cgFragmentProfile("r_cgFragmentProfile","best", CVAR_RENDERER|CVAR_ARCHIVE,"arbfp1, fp30")
idCVar r_jitter("r_jitter","0", CVAR_RENDERER|CVAR_BOOL,"randomly subpixel jitter the projection matrix")
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
idCVar r_inhibitFragmentProgram("r_inhibitFragmentProgram","0", CVAR_RENDERER|CVAR_BOOL,"ignore the fragment program extension")
int GetInteger(void) const
static void ArgCompletion_ImageName(const idCmdArgs &args, void(*callback)(const char *s))
idCVar r_flareSize("r_flareSize","1", CVAR_RENDERER|CVAR_FLOAT,"scale the flare deforms from the material def")
idCVar r_debugPolygonFilled("r_debugPolygonFilled","1", CVAR_RENDERER|CVAR_BOOL,"draw a filled polygon")
idImageManager * globalImages
bool ARBVertexProgramAvailable
virtual void virtual void FatalError(const char *fmt,...) id_attribute((format(printf
bool twoSidedStencilAvailable
PFNGLBEGINFRAGMENTSHADERATIPROC qglBeginFragmentShaderATI
idCVar r_logFile("r_logFile","0", CVAR_RENDERER|CVAR_INTEGER,"number of frames to emit GL logs")
PFNGLGENPROGRAMSARBPROC qglGenProgramsARB
PFNGLENDFRAGMENTSHADERATIPROC qglEndFragmentShaderATI
static int FindText(const char *str, const char *text, bool casesensitive=true, int start=0, int end=-1)
PFNGLENABLEVERTEXATTRIBARRAYARBPROC qglEnableVertexAttribArrayARB
idCVar r_showShadows("r_showShadows","0", CVAR_RENDERER|CVAR_INTEGER,"1 = visualize the stencil shadow volumes, 2 = draw filled in", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
PFNGLUNMAPBUFFERARBPROC qglUnmapBufferARB
virtual void EndFrame(int *frontEndMsec, int *backEndMsec)
const char * GetString(const char *str) const
idCVar r_skipInteractions("r_skipInteractions","0", CVAR_RENDERER|CVAR_BOOL,"skip all light/surface interaction drawing")
idCVar r_usePortals("r_usePortals","1", CVAR_RENDERER|CVAR_BOOL," 1 = use portals to perform area culling, otherwise draw everything")
void R_WriteTGA(const char *filename, const byte *data, int width, int height, bool flipVertical=false)
idCVar r_useLightScissors("r_useLightScissors","1", CVAR_RENDERER|CVAR_BOOL,"1 = use custom scissor rectangle for each light")
idCVar r_showLightScissors("r_showLightScissors","0", CVAR_RENDERER|CVAR_BOOL,"show light scissor rectangles")
idCVar r_singleEntity("r_singleEntity","-1", CVAR_RENDERER|CVAR_INTEGER,"suppress all but one entity")
float backEndRendererMaxLight
bool registerCombinersAvailable
idCVar r_lightScale("r_lightScale","2", CVAR_RENDERER|CVAR_FLOAT,"all light intensities are multiplied by this")
const char * extensions_string
idCVar r_skipPostProcess("r_skipPostProcess","0", CVAR_RENDERER|CVAR_BOOL,"skip all post-process renderings")
virtual void GetCardCaps(bool &oldCard, bool &nv10or20)
bool atiFragmentShaderAvailable
PFNGLGETBUFFERPARAMETERIVARBPROC qglGetBufferParameterivARB
GLenum GLenum GLenum GLenum mapping
PFNGLCOLORFRAGMENTOP2ATIPROC qglColorFragmentOp2ATI
void R_ModulateLights_f(const idCmdArgs &args)
virtual void Close(void)=0
GLubyte GLubyte GLubyte a
const GLvoid const void *PFNGLGENFRAGMENTSHADERSATIPROC qglGenFragmentShadersATI
virtual void UpdateScreen(bool outOfSequence=true)=0
virtual void Printf(const char *fmt,...) id_attribute((format(printf
idCVar r_znear("r_znear","3", CVAR_RENDERER|CVAR_FLOAT,"near Z clip plane distance", 0.001f, 200.0f)
idCVar r_singleLight("r_singleLight","-1", CVAR_RENDERER|CVAR_INTEGER,"suppress all but one light")
idCVar r_ignoreGLErrors("r_ignoreGLErrors","1", CVAR_RENDERER|CVAR_BOOL,"ignore GL errors")
PFNGLGETCOMPRESSEDTEXIMAGEARBPROC qglGetCompressedTexImageARB
idCVar r_useInteractionTable("r_useInteractionTable","1", CVAR_RENDERER|CVAR_BOOL,"create a full entityDefs * lightDefs table to make finding interactions faster")
idCVar r_showDefs("r_showDefs","0", CVAR_RENDERER|CVAR_BOOL,"report the number of modeDefs and lightDefs in view")
void R_ListRenderLightDefs_f(const idCmdArgs &args)
PFNGLDELETEBUFFERSARBPROC qglDeleteBuffersARB
void R_InitMaterials(void)
GLenum GLsizei GLsizei height
idCVar r_showInteractionScissors("r_showInteractionScissors","0", CVAR_RENDERER|CVAR_INTEGER,"1 = show screen rectangle which contains the interaction frustum, 2 = also draw construction lines", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
const char * renderer_string
PFNGLSAMPLEMAPATIPROC qglSampleMapATI
idDeclManager * declManager
idCVar r_skipRenderContext("r_skipRenderContext","0", CVAR_RENDERER|CVAR_BOOL,"NULL the rendering context during backend 3D rendering")
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB
idCVar r_offsetUnits("r_offsetunits","-600", CVAR_RENDERER|CVAR_FLOAT,"polygon offset parameter")
idImage * ImageFromFile(const char *name, textureFilter_t filter, bool allowDownSize, textureRepeat_t repeat, textureDepth_t depth, cubeFiles_t cubeMap=CF_2D)
renderCrop_t renderCrops[MAX_RENDER_CROPS]
PFNGLBUFFERDATAARBPROC qglBufferDataARB
void R_ListRenderEntityDefs_f(const idCmdArgs &args)
idCVar r_cgVertexProfile("r_cgVertexProfile","best", CVAR_RENDERER|CVAR_ARCHIVE,"arbvp1, vp20, vp30")
virtual int GetNumDecls(declType_t type)=0
idCVar r_testGamma("r_testGamma","0", CVAR_RENDERER|CVAR_FLOAT,"if > 0 draw a grid pattern to test gamma levels", 0, 195)
idCVar r_useInfiniteFarZ("r_useInfiniteFarZ","1", CVAR_RENDERER|CVAR_BOOL,"use the no-far-clip-plane trick")
idCVar r_showDominantTri("r_showDominantTri","0", CVAR_RENDERER|CVAR_BOOL,"draw lines from vertexes to center of dominant triangles")
idCVar r_useTurboShadow("r_useTurboShadow","1", CVAR_RENDERER|CVAR_BOOL,"use the infinite projection with W technique for dynamic shadows")
idCVar r_skipFrontEnd("r_skipFrontEnd","0", CVAR_RENDERER|CVAR_BOOL,"bypasses all front end work, but 2D gui rendering still draws")
virtual void EndLevelLoad()=0
bool IsNumeric(void) const
void(* generatorFunction)(idImage *image)
void R_ShutdownTriSurfData(void)
virtual void SetMute(bool mute)=0
idCVar r_useCachedDynamicModels("r_useCachedDynamicModels","1", CVAR_RENDERER|CVAR_BOOL,"cache snapshots of dynamic models")
idCVar r_useCulling("r_useCulling","2", CVAR_RENDERER|CVAR_INTEGER,"0 = none, 1 = sphere, 2 = sphere + box", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
const char * r_rendererArgs[]
const char * Sys_GetProcessorString(void)
void R_FreeDerivedData(void)
idRenderModelManager * renderModelManager
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void R_ScreenshotFilename(int &lastNumber, const char *base, idStr &fileName)
bool textureCompressionAvailable
virtual void Reload(void)=0
idList< idImage * > images
GLenum GLenum GLvoid * row
idCVar r_clear("r_clear","2", CVAR_RENDERER,"force screen clear every frame, 1 = purple, 2 = black, 'r g b' = custom")
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
idCVar r_ignore2("r_ignore2","0", CVAR_RENDERER,"used for random debugging without defining new vars")
idCVar r_showLightCount("r_showLightCount","0", CVAR_RENDERER|CVAR_INTEGER,"1 = colors surfaces based on light count, 2 = also count everything through walls, 3 = also print overdraw", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
const char * version_string
virtual void Touch(const char *name)=0
idCVar r_skipAmbient("r_skipAmbient","0", CVAR_RENDERER|CVAR_BOOL,"bypasses all non-interaction drawing")
idCVar r_showIntensity("r_showIntensity","0", CVAR_RENDERER|CVAR_BOOL,"draw the screen colors based on intensity, red = 0, green = 128, blue = 255")
bool textureEnvAddAvailable
void R_ReloadARBPrograms_f(const idCmdArgs &args)
bool GLimp_Init(glimpParms_t parms)
void * R_StaticAlloc(int bytes)
void R_VidRestart_f(const idCmdArgs &args)
PFNGLDEPTHBOUNDSEXTPROC qglDepthBoundsEXT
PFNGLALPHAFRAGMENTOP1ATIPROC qglAlphaFragmentOp1ATI
void R_ReportImageDuplication_f(const idCmdArgs &args)
PFNGLSTENCILFUNCSEPARATEATIPROC qglStencilFuncSeparateATI
idSoundSystem * soundSystem
idCVar r_mode("r_mode","3", CVAR_ARCHIVE|CVAR_RENDERER|CVAR_INTEGER,"video mode number")
idCVar r_showInteractions("r_showInteractions","0", CVAR_RENDERER|CVAR_BOOL,"report interaction generation activity")
void GLimp_Shutdown(void)
void R_Benchmark_f(const idCmdArgs &args)
idCVar r_skipDeforms("r_skipDeforms","0", CVAR_RENDERER|CVAR_BOOL,"leave all deform materials in their original state")
virtual bool ShutdownHW(void)=0
GLsizei const GLcharARB const GLint * length
idCVar r_displayRefresh("r_displayRefresh","0", CVAR_RENDERER|CVAR_INTEGER|CVAR_NOCHEAT,"optional display refresh rate option for vid mode", 0.0f, 200.0f)
idCVar r_jointNameScale("r_jointNameScale","0.02", CVAR_RENDERER|CVAR_FLOAT,"size of joint names when r_showskel is set to 1")
const char * c_str(void) const
float GetSurfaceArea(void) const
void R_ShowInteractionMemory_f(const idCmdArgs &args)
idVertexCache vertexCache
PFNGLCOMPRESSEDTEXIMAGE2DARBPROC qglCompressedTexImage2DARB
idCVar r_showPrimitives("r_showPrimitives","0", CVAR_RENDERER|CVAR_INTEGER,"report drawsurf/index/vertex counts")
idCVar r_showMemory("r_showMemory","0", CVAR_RENDERER|CVAR_BOOL,"print frame memory utilization")
idCVar r_customWidth("r_customWidth","720", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_INTEGER,"custom screen width. set r_mode to -1 to activate")
PFNGLBINDFRAGMENTSHADERATIPROC qglBindFragmentShaderATI
idCVar r_showDepth("r_showDepth","0", CVAR_RENDERER|CVAR_BOOL,"display the contents of the depth buffer and the depth range")
virtual bool GetCVarBool(const char *name) const =0
PFNGLALPHAFRAGMENTOP3ATIPROC qglAlphaFragmentOp3ATI
void SetBool(const bool value)
PFNGLBUFFERSUBDATAARBPROC qglBufferSubDataARB
#define GL_MAX_TEXTURE_UNITS_ARB
idCVar r_showTexturePolarity("r_showTexturePolarity","0", CVAR_RENDERER|CVAR_BOOL,"shade triangles by texture area polarity")
const char * Argv(int arg) const
idCVar r_useCombinerDisplayLists("r_useCombinerDisplayLists","1", CVAR_RENDERER|CVAR_BOOL|CVAR_NOCHEAT,"put all nvidia register combiner programming in display lists")
idCVar r_usePreciseTriangleInteractions("r_usePreciseTriangleInteractions","0", CVAR_RENDERER|CVAR_BOOL,"1 = do winding clipping to determine if each ambiguous tri should be lit")
idCVar r_debugLineWidth("r_debugLineWidth","1", CVAR_RENDERER|CVAR_ARCHIVE|CVAR_BOOL,"width of debug lines")
void * Mem_Alloc(const int size)
void R_ReloadGuis_f(const idCmdArgs &args)
idCVar r_showEdges("r_showEdges","0", CVAR_RENDERER|CVAR_BOOL,"draw the sil edges")
PFNGLDISABLEVERTEXATTRIBARRAYARBPROC qglDisableVertexAttribArrayARB
virtual bool IsOpenGLRunning(void) const
idCVar r_showLightScale("r_showLightScale","0", CVAR_RENDERER|CVAR_BOOL,"report the scale factor applied to drawing for overbrights")
PFNGLSTENCILOPSEPARATEATIPROC qglStencilOpSeparateATI
void R_ScreenShot_f(const idCmdArgs &args)
idCVar r_useScissor("r_useScissor","1", CVAR_RENDERER|CVAR_BOOL,"scissor clip as portals and lights are processed")
virtual void FreeModelVertexCaches()=0
virtual cinData_t ImageForTime(int milliseconds)
static void ArgCompletion_VideoName(const idCmdArgs &args, void(*callback)(const char *s))
virtual void InitOpenGL(void)
void R_InitCommands(void)
bool textureNonPowerOfTwoAvailable
void R_StaticFree(void *data)
virtual void BeginLevelLoad(void)
idCVar r_skipDiffuse("r_skipDiffuse","0", CVAR_RENDERER|CVAR_BOOL,"use black for diffuse")
void R_ToggleSmpFrame(void)
virtual void Error(const char *fmt,...) id_attribute((format(printf
idCVar r_skipSubviews("r_skipSubviews","0", CVAR_RENDERER|CVAR_INTEGER,"1 = don't render any gui elements on surfaces")
idCVar r_offsetFactor("r_offsetfactor","0", CVAR_RENDERER|CVAR_FLOAT,"polygon offset parameter")
PFNGLPASSTEXCOORDATIPROC qglPassTexCoordATI
idCVar r_jointNameOffset("r_jointNameOffset","0.5", CVAR_RENDERER|CVAR_FLOAT,"offset of joint names when r_showskel is set to 1")
virtual void EndLevelLoad(void)
idVec4 ambientLightVector
idCVar r_showSurfaces("r_showSurfaces","0", CVAR_RENDERER|CVAR_BOOL,"report surface/light/shadow counts")
idCVar r_useOptimizedShadows("r_useOptimizedShadows","1", CVAR_RENDERER|CVAR_BOOL,"use the dmap generated static shadow volumes")
void R_ShowTriSurfMemory_f(const idCmdArgs &args)
bool ARBFragmentProgramAvailable
GLenum GLenum GLenum GLenum GLenum componentUsage
idCVar r_skipFogLights("r_skipFogLights","0", CVAR_RENDERER|CVAR_BOOL,"skip all fog lights")
idCVar r_singleArea("r_singleArea","0", CVAR_RENDERER|CVAR_BOOL,"only draw the portal area the view is actually in")
virtual void ShutdownOpenGL(void)
PFNGLCOLORFRAGMENTOP3ATIPROC qglColorFragmentOp3ATI
idCVar r_showDynamic("r_showDynamic","0", CVAR_RENDERER|CVAR_BOOL,"report stats on dynamic surface generation")
PFNGLCOLORFRAGMENTOP1ATIPROC qglColorFragmentOp1ATI
GLenum GLenum GLenum GLenum GLenum GLenum bias
void GfxInfo_f(const idCmdArgs &args)
idCVar r_lightAllBackFaces("r_lightAllBackFaces","0", CVAR_RENDERER|CVAR_BOOL,"light all the back faces, even when they would be shadowed")
idCVar r_useLightPortalFlow("r_useLightPortalFlow","1", CVAR_RENDERER|CVAR_BOOL,"use a more precise area reference determination")
idCVar r_materialOverride("r_materialOverride","", CVAR_RENDERER,"overrides all materials", idCmdSystem::ArgCompletion_Decl< DECL_MATERIAL >)
int sprintf(idStr &string, const char *fmt,...)
idCVar r_skipLightScale("r_skipLightScale","0", CVAR_RENDERER|CVAR_BOOL,"don't do any post-interaction light scaling, makes things dim on low-dynamic range cards")
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
renderView_t primaryRenderView
idCVar r_skipBlendLights("r_skipBlendLights","0", CVAR_RENDERER|CVAR_BOOL,"skip all blend lights")
void(APIENTRY *qglMultiTexCoord2fARB)(GLenum texture
idCVar r_demonstrateBug("r_demonstrateBug","0", CVAR_RENDERER|CVAR_BOOL,"used during development to show IHV's their problems")
const idMaterial * defaultMaterial
virtual void AddCommand(const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion=NULL)=0
void RB_ShutdownDebugTools(void)
void R_TouchGui_f(const idCmdArgs &args)
idCVar r_useEntityCulling("r_useEntityCulling","1", CVAR_RENDERER|CVAR_BOOL,"0 = none, 1 = box")
void GLimp_SetGamma(unsigned short red[256], unsigned short green[256], unsigned short blue[256])
idCVar r_useFrustumFarDistance("r_useFrustumFarDistance","0", CVAR_RENDERER|CVAR_FLOAT,"if != 0 force the view frustum far distance to this distance")
virtual void Shutdown()=0
idCVar r_skipCopyTexture("r_skipCopyTexture","0", CVAR_RENDERER|CVAR_BOOL,"do all rendering, but don't actually copyTexSubImage2D")
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
void Sys_GrabMouseCursor(bool)