#include "r_local.h"
#include "r_program.h"
#include "r_sphere.h"
#include "r_draw.h"
#include "r_font.h"
#include "r_light.h"
#include "r_lightmap.h"
#include "r_main.h"
#include "r_geoscape.h"
#include "r_misc.h"
#include "r_error.h"
#include "../../common/tracing.h"
#include "../ui/ui_windows.h"
#include "../../ports/system.h"
Go to the source code of this file.
Definition in file r_main.c.
#define INTEL_TEXTURE_RESOLUTION 1024 |
Definition at line 940 of file r_main.c.
Referenced by R_VerifyDriver().
void R_BeginFrame | ( | void | ) |
Definition at line 202 of file r_main.c.
References Com_IsRenderModified(), Com_Printf(), Com_SetRenderModified(), Cvar_PendingCvars(), CVAR_R_CONTEXT, CVAR_R_PROGRAMS, Cvar_SetValue(), cvar_s::integer, rconfig_t::maxAnisotropic, cvar_s::modified, Q_strcasecmp, qfalse, R_CheckError, R_Clear(), R_InitThreads(), R_RestartPrograms_f(), R_SetMode(), R_Setup2D(), R_ShutdownThreads(), R_TextureAlphaMode(), R_TextureMode(), R_TextureSolidMode(), cvar_s::string, vid_fullscreen, vid_mode, VID_Restart_f(), and vid_strech.
Referenced by SCR_DrawPrecacheScreen(), SCR_TimeRefresh_f(), and SCR_UpdateScreen().
static void R_Clear | ( | void | ) | [inline, static] |
Clears the screens color and depth buffer.
Definition at line 178 of file r_main.c.
References f, and R_CheckError.
Referenced by R_BeginFrame().
static void R_ClearScene | ( | void | ) | [inline, static] |
Definition at line 192 of file r_main.c.
References rendererData_t::numCoronas, rendererData_t::numEntities, and rendererData_t::numLights.
Referenced by R_EndFrame().
Definition at line 409 of file r_main.c.
References Cvar_AssertValue(), Cvar_SetValue(), cvar_s::integer, rconfig_t::maxLights, cvar_s::name, qfalse, and qtrue.
Referenced by R_InitExtensions().
Definition at line 401 of file r_main.c.
References Cvar_AssertValue(), Cvar_SetValue(), cvar_s::integer, and qtrue.
Referenced by R_RegisterSystemVars().
Definition at line 384 of file r_main.c.
References Com_Printf(), Cvar_AssertValue(), Cvar_SetValue(), cvar_s::integer, LIGHTMAP_BLOCK_WIDTH, rconfig_t::maxTextureSize, cvar_s::name, Q_IsPowerOfTwo(), qfalse, and qtrue.
Referenced by R_RegisterSystemVars().
Definition at line 430 of file r_main.c.
References Cvar_AssertValue(), Cvar_SetValue(), rconfig_t::drawBuffers, rconfig_t::frameBufferObject, cvar_s::integer, cvar_s::name, and qtrue.
Referenced by R_InitExtensions().
Definition at line 418 of file r_main.c.
References Cvar_AssertValue(), Cvar_SetValue(), rconfig_t::drawBuffers, cvar_s::integer, cvar_s::name, and qtrue.
Referenced by R_InitExtensions().
void R_EndFrame | ( | void | ) |
Definition at line 358 of file r_main.c.
References cvar_s::integer, cvar_s::modified, qfalse, R_ClearScene(), cvar_s::value, vid_gamma, and vid_ignoregamma.
Referenced by SCR_DrawPrecacheScreen(), SCR_TimeRefresh_f(), and SCR_UpdateScreen().
static void R_EnforceVersion | ( | void | ) | [inline, static] |
We need at least opengl version 1.2.1.
Definition at line 906 of file r_main.c.
References Com_Error(), ERR_FATAL, and rconfig_t::versionString.
Referenced by R_Init().
qboolean R_Init | ( | void | ) |
Definition at line 977 of file r_main.c.
References Cvar_ClearVars(), CVAR_R_MASK, rconfig_t::extensionsString, rconfig_t::gl_alpha_format, rconfig_t::gl_filter_max, rconfig_t::gl_filter_min, rconfig_t::gl_solid_format, rconfig_t::maxTextureSize, qfalse, qtrue, R_CheckError, R_DrawInitLocal(), R_EnforceVersion(), R_FontInit(), R_InitExtensions(), R_InitFBObjects(), R_InitImages(), R_InitMiscTexture(), R_InitPrograms(), R_RegisterImageVars(), R_RegisterSystemVars(), R_SetDefaultState(), R_SphereInit(), R_Strings_f(), R_VerifyDriver(), rconfig_t::rendererString, Rimp_Init(), rconfig_t::vendorString, and rconfig_t::versionString.
Referenced by VID_Init(), and VID_Restart_f().
static qboolean R_InitExtensions | ( | void | ) | [static] |
Check and load all needed and supported opengl extensions.
Definition at line 609 of file r_main.c.
References rconfig_t::anisotropic, Com_Error(), Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), CVAR_R_PROGRAMS, Cvar_SetCheckFunction(), Cvar_SetValue(), rconfig_t::drawBuffers, ERR_FATAL, rconfig_t::extensionsString, rconfig_t::frameBufferObject, GAME_TITLE, rconfig_t::gl_compressed_alpha_format, rconfig_t::gl_compressed_solid_format, GLenum, cvar_s::integer, rconfig_t::lod_bias, rconfig_t::lodDir, rconfig_t::maxAnisotropic, rconfig_t::maxColorAttachments, rconfig_t::maxDrawBuffers, rconfig_t::maxLights, rconfig_t::maxRenderbufferSize, rconfig_t::maxTextureCoords, rconfig_t::maxTextureSize, rconfig_t::maxTextureUnits, rconfig_t::maxVertexAttribs, rconfig_t::maxVertexTextureImageUnits, cvar_s::modified, rconfig_t::nonPowerOfTwo, Q_strncpyz(), qfalse, qtrue, R_CheckError, R_CvarCheckDynamicLights(), R_CvarPostProcess(), R_CvarPrograms(), R_ImageExists(), R_TranslateError(), rconfig_t::shadingLanguageVersion, and va().
Referenced by R_Init().
static void R_PrintInfo | ( | const char * | pre, | |
const char * | msg | |||
) | [static] |
Definition at line 101 of file r_main.c.
References Com_Printf(), i, and Q_strncpyz().
Referenced by R_Strings_f().
static void R_RegisterImageVars | ( | void | ) | [static] |
Definition at line 502 of file r_main.c.
References CVAR_ARCHIVE, Cvar_Get(), CVAR_R_IMAGES, GLHW_NVIDIA, and rconfig_t::hardwareType.
Referenced by R_Init().
static void R_RegisterSystemVars | ( | void | ) | [static] |
Definition at line 439 of file r_main.c.
References Cmd_AddCommand(), CVAR_ARCHIVE, Cvar_Get(), CVAR_LATCH, CVAR_R_CONTEXT, CVAR_R_IMAGES, CVAR_R_PROGRAMS, Cvar_SetCheckFunction(), cmdList_s::description, cmdList_s::function, cvar_s::modified, cmdList_s::name, qfalse, R_CvarCheckLights(), and R_CvarCheckMaxLightmap().
Referenced by R_Init().
void R_RenderFrame | ( | void | ) |
Definition at line 278 of file r_main.c.
References cvar_s::integer, qfalse, qtrue, R_CheckError, R_DrawAlphaTestSurfaces(), R_DrawBlendSurfaces(), R_DrawBlendWarpSurfaces(), R_DrawBloom(), R_DrawBspNormals(), R_DrawCoronas(), R_DrawEntities(), R_DrawFlareSurfaces(), R_DrawMaterialSurfaces(), R_DrawOpaqueSurfaces(), R_DrawOpaqueWarpSurfaces(), R_DrawParticles(), R_EnableBlend(), R_EnableFog(), R_EnableLights(), R_GetLevelSurfaceLists(), r_mapTiles, r_numMapTiles, R_ResetArrayState(), R_Setup2D(), R_Setup3D(), R_SetupFrustum(), r_threadstate, RDF_NOWORLDMODEL, rendererData_t::rendererFlags, renderer_threadstate_s::state, Sys_Sleep(), THREAD_CLIENT, and THREAD_RENDERER.
Referenced by CL_SequenceRender(), CL_ViewRender(), and SCR_TimeRefresh_f().
static qboolean R_SearchForVendor | ( | const char * | vendor | ) | [static] |
Searches vendor and renderer GL strings for the given vendor id.
Definition at line 934 of file r_main.c.
References Q_stristr(), rconfig_t::rendererString, and rconfig_t::vendorString.
Referenced by R_VerifyDriver().
qboolean R_SetMode | ( | void | ) |
Definition at line 544 of file r_main.c.
References Com_Printf(), Cvar_SetValue(), viddef_t::fullscreen, vidmode_s::height, viddef_t::height, cvar_s::integer, viddef_t::mode, qfalse, qtrue, R_InitFBObjects(), R_InitGraphics(), R_ShutdownFBObjects(), R_UpdateVidDef(), viddef_t::strech, UI_InvalidateStack(), vid_fullscreen, VID_GetModeInfo(), vid_mode, vid_strech, viddef, vidmode_s::width, and viddef_t::width.
Referenced by R_BeginFrame(), and Rimp_Init().
void R_SetupFrustum | ( | void | ) |
Definition at line 127 of file r_main.c.
References AngleVectors(), cBspPlane_s::dist, DotProduct, rendererData_t::fieldOfViewX, rendererData_t::fieldOfViewY, rlocals_s::forward, rlocals_s::frustum, viddef_t::height, i, cvar_s::integer, cBspPlane_s::normal, PLANE_ANYZ, R_CheckError, RDF_NOWORLDMODEL, rendererData_t::rendererFlags, rlocals_s::right, RotatePointAroundVector(), cBspPlane_s::type, rlocals_s::up, VectorScale, viddef, rendererData_t::viewAngles, viddef_t::viewHeight, rendererData_t::viewOrigin, viddef_t::viewWidth, viddef_t::x, and viddef_t::y.
Referenced by R_RenderFrame(), and R_RunThread().
void R_Shutdown | ( | void | ) |
Definition at line 1030 of file r_main.c.
References Cmd_RemoveCommand(), cmdList_s::name, qtrue, R_FontShutdown(), R_ShutdownFBObjects(), R_ShutdownImages(), R_ShutdownModels(), R_ShutdownPrograms(), R_ShutdownThreads(), and Rimp_Shutdown().
Referenced by CL_Shutdown(), and VID_Restart_f().
static void R_Strings_f | ( | void | ) | [static] |
Prints some OpenGL strings.
Definition at line 119 of file r_main.c.
References rconfig_t::extensionsString, R_PrintInfo(), rconfig_t::rendererString, rconfig_t::vendorString, and rconfig_t::versionString.
Referenced by R_Init().
static void R_UpdateVidDef | ( | const vidmode_t * | vidmode | ) | [static] |
Definition at line 514 of file r_main.c.
References vidmode_s::height, viddef_t::height, viddef_t::rx, viddef_t::ry, viddef_t::strech, VID_NORM_HEIGHT, VID_NORM_WIDTH, viddef, viddef_t::virtualHeight, viddef_t::virtualWidth, vidmode_s::width, and viddef_t::width.
Referenced by R_SetMode().
static void R_VerifyDriver | ( | void | ) | [inline, static] |
Checks whether we have hardware acceleration.
Definition at line 945 of file r_main.c.
References Com_Error(), Com_Printf(), Cvar_Set(), Cvar_SetValue(), ERR_FATAL, GLHW_ATI, GLHW_GENERIC, GLHW_INTEL, GLHW_MESA, GLHW_NVIDIA, rconfig_t::hardwareType, cvar_s::integer, INTEL_TEXTURE_RESOLUTION, cvar_s::modified, Q_strcasecmp, qfalse, and R_SearchForVendor().
Referenced by R_Init().
Definition at line 51 of file r_main.c.
Referenced by R_FilterTexture().
Definition at line 93 of file r_main.c.
Referenced by R_ArraysMask(), R_EnableBumpmap(), R_ResetArrayState(), R_SetSurfaceBumpMappingParameters(), R_SetVertexArrayState(), R_SetVertexBufferState(), and R_UseMaterial().
Definition at line 74 of file r_main.c.
Referenced by R_CheckErrorDebug().
const cmdList_t r_commands[] [static] |
{ {"r_listimages", R_ImageList_f, "Show all loaded images on game console"}, {"r_listfontcache", R_FontListCache_f, "Show information about font cache"}, {"r_screenshot", R_ScreenShot_f, "Take a screenshot"}, {"r_listmodels", R_ModModellist_f, "Show all loaded models on game console"}, {"r_strings", R_Strings_f, "Print openGL vendor and other strings"}, {"r_restartprograms", R_RestartPrograms_f, "Reloads the shaders"}, {NULL, NULL, NULL} }
Definition at line 42 of file r_main.c.
Referenced by R_BindColorAttachments(), R_CreateFramebuffer(), R_Draw3DGlobe(), R_DrawBloom(), R_EnableRenderbuffer(), R_FontGenerateTexture(), R_GetScaledTextureSize(), R_InitFBObjects(), R_InitializeShader(), R_SelectTexture(), R_SetDefaultState(), R_TextureAlphaMode(), R_TextureMode(), R_TextureSolidMode(), R_UploadAlpha(), R_UploadData(), R_UploadLightmapBlock(), R_UploadTexture(), R_UseFramebuffer(), R_UseViewport(), and Rimp_Init().
Definition at line 52 of file r_main.c.
Referenced by R_FilterTexture().
Definition at line 99 of file r_main.c.
Referenced by R_AddCorona(), and R_DrawCoronas().
cvar_t* r_deluxemap [static] |
Definition at line 54 of file r_main.c.
Referenced by R_DrawEntities().
Definition at line 55 of file r_main.c.
Referenced by R_GetLevelSurfaceLists().
Definition at line 76 of file r_main.c.
Referenced by Rimp_Init().
Definition at line 88 of file r_main.c.
Referenced by R_ClearActiveLights(), and R_EnableDynamicLights().
cvar_t* r_ext_nonpoweroftwo [static] |
cvar_t* r_ext_s3tc_compression [static] |
Definition at line 66 of file r_main.c.
Referenced by R_InitGraphics().
Definition at line 98 of file r_main.c.
Referenced by R_DrawFlareSurfaces().
Definition at line 97 of file r_main.c.
Referenced by R_EnableFog().
Definition at line 95 of file r_main.c.
Referenced by R_UseMaterial().
cvar_t* r_intel_hack [static] |
Definition at line 57 of file r_main.c.
Referenced by MYgluPerspective(), and R_RecursiveWorldNode().
Definition at line 62 of file r_main.c.
Referenced by R_EnableTexture().
Definition at line 87 of file r_main.c.
Referenced by R_AddLight(), R_AddSustainedLight(), R_EnableLighting(), and R_SphereShadeGLSL().
Definition at line 44 of file r_main.c.
Referenced by R_CullBox(), R_CullMeshModel(), R_CullSphere(), R_DrawBspModelSurfaces(), R_DrawBspNormals(), R_DrawCoronas(), R_DrawFlareSurfaces(), R_DrawMaterialSurfaces(), R_DrawSurfaces(), R_GetLevelSurfaceLists(), R_GetSpriteVectors(), R_RecursiveWorldNode(), R_Setup3D(), and R_Trace().
Definition at line 73 of file r_main.c.
Referenced by R_DrawMaterialSurfaces().
Definition at line 91 of file r_main.c.
Referenced by R_BeginBuildingLightmaps().
cvar_t* r_maxtexres [static] |
Definition at line 79 of file r_main.c.
Referenced by R_FilterTexture().
Definition at line 81 of file r_main.c.
Referenced by R_InitGraphics().
Definition at line 56 of file r_main.c.
Referenced by R_CullBox(), R_CullEntity(), and R_CullSphere().
Definition at line 96 of file r_main.c.
Referenced by R_UseMaterial().
Definition at line 90 of file r_main.c.
Referenced by R_BindColorAttachments(), R_Draw3DGlobe(), R_DrawBloom(), R_EnableBlur(), R_EnableDrawAsGlow(), R_EnableGlowMap(), R_EnableRenderbuffer(), R_InitWarpProgram(), R_InitWorldProgram(), R_SphereShadeGLSL(), R_UseFramebuffer(), and R_UseViewport().
Definition at line 89 of file r_main.c.
Referenced by R_BindColorAttachments(), R_Draw3DGlobe(), R_DrawBloom(), R_EnableAnimation(), R_EnableBlur(), R_EnableLighting(), R_EnableRenderbuffer(), R_EnableWarp(), R_InitFBObjects(), R_InitPrograms(), R_ShutdownPrograms(), R_SphereCheckGLSL(), R_UseFramebuffer(), and R_UseViewport().
Definition at line 53 of file r_main.c.
Referenced by R_FilterTexture().
Definition at line 60 of file r_main.c.
Referenced by R_ScreenShot().
Definition at line 61 of file r_main.c.
Referenced by R_ScreenShot().
Definition at line 77 of file r_main.c.
Referenced by R_DrawEntityEffects().
Definition at line 83 of file r_main.c.
Referenced by R_DrawBrushModel(), R_DrawModelDirect(), R_DrawModelParticle(), and R_DrawSurface().
Definition at line 92 of file r_main.c.
Referenced by R_DrawBspNormals().
Definition at line 78 of file r_main.c.
Referenced by R_BuildLightmap().
Definition at line 94 of file r_main.c.
Referenced by R_UseMaterial().
Definition at line 43 of file r_main.c.
Referenced by R_AddLightsource(), R_ArraysMask(), R_BindColorAttachments(), R_BindDefaultArray(), R_BindTexture_(), R_BlendFunc(), R_Blur(), R_BlurStack(), R_ClearActiveLights(), R_CreateFramebuffer(), R_Draw2DArray(), R_Draw3DGlobe(), R_DrawAliasStatic(), R_DrawAlphaTestSurfaces(), R_DrawBlendMeshEntities(), R_DrawBlendSurfaces(), R_DrawBlendWarpSurfaces(), R_DrawBloom(), R_DrawBspNormals(), R_DrawCoronas(), R_DrawFlareSurfaces(), R_DrawMaterialSurfaces(), R_DrawOpaqueMeshEntities(), R_DrawOpaqueSurfaces(), R_DrawOpaqueWarpSurfaces(), R_DrawSurfaces(), R_DrawSurfaceStage(), R_EnableAlphaTest(), R_EnableAnimation(), R_EnableBlend(), R_EnableBlur(), R_EnableBumpmap(), R_EnableColorArray(), R_EnableDrawAsGlow(), R_EnableDynamicLights(), R_EnableFog(), R_EnableGlowMap(), R_EnableLighting(), R_EnableRenderbuffer(), R_EnableRoughnessMap(), R_EnableShell(), R_EnableSpecularMap(), R_EnableWarp(), R_FillArrayData(), R_FontDrawTexture(), R_InitFBObjects(), R_InitPrograms(), R_LoadProgram(), R_LoadShader(), R_ProgramVariable(), R_RenderbufferEnabled(), R_ResetArrayState(), R_SelectTexture(), R_SetDefaultState(), R_SetSurfaceBumpMappingParameters(), R_SetSurfaceStageState(), R_SetSurfaceState(), R_SetVertexArrayState(), R_SetVertexBufferState(), R_ShutdownFBObjects(), R_ShutdownPrograms(), R_SortLightList_qsort(), R_StageGlow(), R_StageLighting(), R_TexEnv(), R_UpdateLightList(), R_UseFramebuffer(), R_UseMaterial(), R_UseProgram(), and R_UseViewport().
Definition at line 80 of file r_main.c.
Referenced by R_InitGraphics().
Definition at line 59 of file r_main.c.
Referenced by R_UploadTexture().
cvar_t* r_texturealphamode [static] |
cvar_t* r_texturemode [static] |
cvar_t* r_texturesolidmode [static] |
Definition at line 84 of file r_main.c.
Referenced by R_RunThread().
Definition at line 85 of file r_main.c.
Referenced by R_BindBuffer(), and R_SetArrayState().
Definition at line 86 of file r_main.c.
Referenced by R_EnableWarp().
Definition at line 47 of file r_main.c.
Referenced by R_EnableWarp(), and R_InitMiscTexture().
Definition at line 82 of file r_main.c.
Referenced by R_DrawMaterialSurfaces().
Definition at line 40 of file r_main.c.
Referenced by CL_ActorDoShoot(), CL_ActorMouseTrace(), CL_ClearState(), CL_DoEndRound(), CL_ParseConfigString(), CL_ParseServerData(), CL_SequenceRender(), CL_SetClientState(), CL_ViewCalcFieldOfViewX(), CL_ViewCalcFieldOfViewY(), CL_ViewLoadMedia(), CL_ViewRender(), CL_ViewUpdateRenderData(), CP_StartMissionMap(), MYgluPerspective(), R_AddCorona(), R_AddEntity(), R_AddLight(), R_AddSustainedLight(), R_AddSustainedLights(), R_CullEntity(), R_DrawBlendMeshEntities(), R_DrawBrushModel(), R_DrawCoronas(), R_DrawEntities(), R_DrawEntityEffects(), R_DrawFlareSurfaces(), R_DrawModelDirect(), R_DrawModelParticle(), R_DrawOpaqueMeshEntities(), R_DrawParticles(), R_DrawSurface(), R_EnableFog(), R_EnableLights(), R_EnableShell(), R_GetEntity(), R_GetFreeEntity(), R_GetLevelOfDetailForModel(), R_GetLevelSurfaceLists(), R_ModLoadTexinfo(), R_RecursiveWorldNode(), R_RunThread(), R_Setup3D(), R_SphereRender(), R_SpriteTexcoords(), R_StageTexCoord(), R_Trace(), R_UpdateMaterial(), R_UseWarpProgram(), SCR_TimeRefresh_f(), SCR_UpdateScreen(), and VID_Restart_f().