local graphics definitions More...
#include "../../common/common.h"
#include "../cl_renderer.h"
#include "../cl_video.h"
#include "r_gl.h"
#include "r_state.h"
#include "r_array.h"
#include "r_material.h"
#include "r_image.h"
#include "r_model.h"
#include "r_thread.h"
#include "r_framebuffer.h"
#include "r_lightmap.h"
#include "r_corona.h"
#include "r_flare.h"
Go to the source code of this file.
Data Structures | |
struct | rlocals_s |
struct | rconfig_t |
GL config stuff. More... | |
Typedefs | |
typedef struct rlocals_s | rlocals_t |
Enumerations | |
enum | hardwareType_t { GLHW_GENERIC, GLHW_MESA, GLHW_INTEL, GLHW_ATI, GLHW_NVIDIA } |
Functions | |
void | R_DrawBlendSurfaces (const mBspSurfaces_t *list) |
Draw the surface chain with multitexture enabled and blend enabled. | |
void | R_DrawOpaqueSurfaces (const mBspSurfaces_t *surfs) |
Draw the surface chain with multitexture enabled and light enabled. | |
void | R_DrawOpaqueWarpSurfaces (mBspSurfaces_t *surfs) |
Draw the surfaces via warp shader. | |
void | R_DrawBlendWarpSurfaces (mBspSurfaces_t *surfs) |
Draw the alpha surfaces via warp shader and with blend enabled. | |
void | R_DrawAlphaTestSurfaces (mBspSurfaces_t *surfs) |
void | R_DrawMaterialSurfaces (mBspSurfaces_t *surfs) |
Iterates the specified surfaces list, updating materials as they are encountered, and rendering all visible stages. State is lazily managed throughout the iteration, so there is a concerted effort to restore the state after all surface stages have been rendered. | |
void | R_SetSurfaceBumpMappingParameters (const mBspSurface_t *surf, const image_t *normalMap) |
qboolean | R_CullMeshModel (entity_t *e) |
void | R_DrawModelParticle (modelInfo_t *mi) |
void | R_DrawBrushModel (const entity_t *e) |
Draws a brush model. | |
void | R_DrawBspNormals (int tile) |
Developer tool for viewing BSP vertex normals. Only Phong interpolated surfaces show their normals when r_shownormals > 1. | |
qboolean | R_CullBspModel (const entity_t *e) |
Returns true if the specified entity is completely culled by the view frustum, false otherwise. | |
qboolean | R_CullSphere (const vec3_t centre, const float radius, const unsigned int clipflags) |
Performs a spherical frustum check. | |
void | R_GetLevelSurfaceLists (void) |
Fills the surface chains for the current worldlevel and hide other levels. | |
void | R_DrawEntities (void) |
Primary entry point for drawing all entities. | |
void | R_DrawInitLocal (void) |
Loads some textures and init the 3d globe. | |
void | R_DrawParticles (void) |
void | R_SetupFrustum (void) |
qboolean | Rimp_Init (void) |
void | Rimp_Shutdown (void) |
qboolean | R_InitGraphics (qboolean fullscreen, int width, int height) |
Init the SDL window. | |
Variables | |
cvar_t * | r_brightness |
cvar_t * | r_contrast |
cvar_t * | r_saturation |
cvar_t * | r_drawworld |
cvar_t * | r_drawentities |
cvar_t * | r_nocull |
cvar_t * | r_isometric |
cvar_t * | r_anisotropic |
cvar_t * | r_texture_lod |
cvar_t * | r_materials |
cvar_t * | r_screenshot_format |
cvar_t * | r_screenshot_jpeg_quality |
cvar_t * | r_lightmap |
cvar_t * | r_debug_normals |
cvar_t * | r_debug_tangents |
cvar_t * | r_ext_texture_compression |
cvar_t * | r_checkerror |
cvar_t * | r_showbox |
cvar_t * | r_shadows |
cvar_t * | r_soften |
cvar_t * | r_modulate |
cvar_t * | r_drawbuffer |
cvar_t * | r_driver |
cvar_t * | r_swapinterval |
cvar_t * | r_multisample |
cvar_t * | r_threads |
cvar_t * | r_wire |
cvar_t * | r_vertexbuffers |
cvar_t * | r_maxlightmap |
cvar_t * | r_warp |
cvar_t * | r_lights |
cvar_t * | r_programs |
cvar_t * | r_postprocess |
cvar_t * | r_shownormals |
cvar_t * | r_bumpmap |
cvar_t * | r_specular |
cvar_t * | r_hardness |
cvar_t * | r_parallax |
cvar_t * | r_fog |
cvar_t * | r_flares |
cvar_t * | r_coronas |
cvar_t * | r_dynamic_lights |
rlocals_t | r_locals |
rconfig_t | r_config |
local graphics definitions
Definition in file r_local.h.
enum hardwareType_t |
Returns true if the specified entity is completely culled by the view frustum, false otherwise.
[in] | e | The entity to check |
Definition at line 93 of file r_bsp.c.
References i, qtrue, R_CullBox(), R_EntityGetOrigin(), VectorAdd, and VectorCopy.
Referenced by R_CullEntity().
Definition at line 324 of file r_mesh.c.
References AngleVectors(), cBspPlane_s::dist, DotProduct, f, rlocals_s::frustum, i, lengthof, cBspPlane_s::normal, entity_t::origin, qfalse, qtrue, r_locals, VectorAdd, VectorCopy, and YAW.
Referenced by R_CullEntity().
Performs a spherical frustum check.
[in] | centre | The world coordinate that is the center of the sphere |
[in] | radius | The radius of the sphere to check the frustum for |
[in] | clipflags | Can be used to skip sides of the frustum planes |
true
if the sphere is completely outside the frustum, false
otherwise Definition at line 68 of file r_bsp.c.
References cBspPlane_s::dist, DotProduct, rlocals_s::frustum, i, cvar_s::integer, lengthof, cBspPlane_s::normal, qfalse, qtrue, r_locals, and r_nocull.
void R_DrawAlphaTestSurfaces | ( | mBspSurfaces_t * | surfs | ) |
Definition at line 207 of file r_surface.c.
References mBspSurfaces_s::count, qfalse, qtrue, R_DrawSurfaces(), R_EnableAlphaTest(), R_EnableLighting(), r_state, and rstate_t::world_program.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawBlendSurfaces | ( | const mBspSurfaces_t * | surfs | ) |
Draw the surface chain with multitexture enabled and blend enabled.
Definition at line 223 of file r_surface.c.
References rstate_t::blend_enabled, mBspSurfaces_s::count, qfalse, qtrue, R_DrawSurfaces(), R_EnableTexture(), r_state, and texunit_lightmap.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawBlendWarpSurfaces | ( | mBspSurfaces_t * | surfs | ) |
Draw the alpha surfaces via warp shader and with blend enabled.
Definition at line 238 of file r_surface.c.
References rstate_t::blend_enabled, mBspSurfaces_s::count, qfalse, qtrue, R_DrawSurfaces(), R_EnableWarp(), r_state, and rstate_t::warp_program.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawBrushModel | ( | const entity_t * | e | ) |
Draws a brush model.
[in] | e | The inline bsp model entity |
Definition at line 181 of file r_bsp.c.
References cvar_s::integer, PITCH, R_DrawBoundingBox(), R_DrawBspModelSurfaces(), R_EntityGetOrigin(), R_ShiftLights(), r_showbox, refdef, ROLL, vec3_origin, VectorCopy, VectorCreateRotationMatrix(), VectorNotEmpty, VectorRotatePoint(), VectorSubtract, rendererData_t::viewOrigin, and YAW.
Referenced by R_DrawBspEntities().
void R_DrawBspNormals | ( | int | tile | ) |
Developer tool for viewing BSP vertex normals. Only Phong interpolated surfaces show their normals when r_shownormals > 1.
Definition at line 227 of file r_bsp.c.
References model_s::bsp, Com_Error(), ERR_DROP, mBspTexInfo_s::flags, rlocals_s::frame, mBspSurface_s::frame, i, mBspSurface_s::index, cvar_s::integer, MAX_GL_ARRAY_LENGTH, mBspModel_s::normals, mBspSurface_s::numedges, mBspModel_s::numsurfaces, qfalse, qtrue, R_Color(), R_EnableTexture(), r_locals, r_mapTiles, R_ResetArrayState(), r_shownormals, r_state, SURF_PHONG, SURF_WARP, mBspModel_s::surfaces, mBspSurface_s::texinfo, texunit_diffuse, VectorMA(), rstate_t::vertex_array_3d, and mBspModel_s::verts.
Referenced by R_RenderFrame().
void R_DrawEntities | ( | void | ) |
Primary entry point for drawing all entities.
Definition at line 534 of file r_entity.c.
References Com_Error(), ERR_DROP, image_s::has_alpha, i, cvar_s::integer, mod_alias_dpm, mod_alias_md2, mod_alias_md3, mod_bsp_submodel, mod_obj, rendererData_t::numEntities, R_AliasModelState(), R_CalcTransform(), R_Color(), R_CullEntity(), R_DrawBlendMeshEntities(), R_DrawBspEntities(), r_drawentities, R_DrawEntityEffects(), R_DrawNullEntities(), R_DrawOpaqueMeshEntities(), R_DrawSpecialEntities(), refdef, RF_ARROW, RF_BOX, RF_PATH, RF_TRANSLUCENT, and image_s::texnum.
Referenced by R_RenderFrame().
void R_DrawInitLocal | ( | void | ) |
Loads some textures and init the 3d globe.
Definition at line 43 of file r_draw.c.
References Com_Error(), Com_Printf(), ERR_FATAL, it_chars, it_effect, R_FindImage(), and r_noTexture.
Referenced by R_Init().
void R_DrawMaterialSurfaces | ( | mBspSurfaces_t * | surfs | ) |
Iterates the specified surfaces list, updating materials as they are encountered, and rendering all visible stages. State is lazily managed throughout the iteration, so there is a concerted effort to restore the state after all surface stages have been rendered.
Definition at line 372 of file r_material.c.
References rstate_t::blend_enabled, mBspSurfaces_s::count, f, materialStage_s::flags, rlocals_s::frame, mBspSurface_s::frame, i, mBspTexInfo_s::image, cvar_s::integer, m, image_s::material, materialStage_s::next, qfalse, qtrue, R_BlendFunc(), R_Color(), R_DrawSurfaceStage(), R_EnableBumpmap(), R_EnableColorArray(), R_EnableDynamicLights(), R_EnableFog(), R_EnableGlowMap(), R_EnableLighting(), R_EnableTexture(), r_locals, r_materials, R_ResetArrayState(), R_SetSurfaceStageState(), r_state, R_UpdateMaterial(), r_wire, STAGE_RENDER, material_s::stages, mBspSurfaces_s::surfaces, mBspSurface_s::texinfo, texunit_lightmap, and rstate_t::world_program.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawModelParticle | ( | modelInfo_t * | mi | ) |
Definition at line 279 of file r_mesh.c.
References model_s::alias, rendererData_t::aliasCount, modelInfo_t::angles, modelInfo_t::backlerp, modelInfo_t::color, Com_Printf(), modelInfo_t::frame, mAliasModel_s::frames, cvar_s::integer, mAliasFrame_s::maxs, modelInfo_t::mesh, mAliasModel_s::meshes, mAliasFrame_s::mins, modelInfo_t::model, modelInfo_t::name, mAliasModel_s::num_frames, mAliasMesh_s::num_tris, modelInfo_t::oldframe, modelInfo_t::origin, PITCH, R_AliasModelState(), R_BindTexture, R_Color(), R_DrawAliasFrameLerp(), R_DrawAliasStatic(), R_DrawBoundingBox(), r_showbox, refdef, ROLL, modelInfo_t::skin, image_s::texnum, vec4_origin, and YAW.
Referenced by R_DrawParticleModel().
void R_DrawOpaqueSurfaces | ( | const mBspSurfaces_t * | surfs | ) |
Draw the surface chain with multitexture enabled and light enabled.
Definition at line 179 of file r_surface.c.
References mBspSurfaces_s::count, qfalse, qtrue, R_DrawSurfaces(), R_EnableLighting(), R_EnableTexture(), r_state, texunit_lightmap, and rstate_t::world_program.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawOpaqueWarpSurfaces | ( | mBspSurfaces_t * | surfs | ) |
Draw the surfaces via warp shader.
Definition at line 197 of file r_surface.c.
References mBspSurfaces_s::count, qfalse, qtrue, R_DrawSurfaces(), R_EnableWarp(), r_state, and rstate_t::warp_program.
Referenced by R_DrawBspModelSurfaces(), and R_RenderFrame().
void R_DrawParticles | ( | void | ) |
Definition at line 292 of file r_particle.c.
References ptl_s::blend, i, ptl_s::inuse, ptl_s::invis, ptl_s::levelFlags, ptl_s::model, ptl_s::pic, ptl_s::program, R_BlendFunc(), R_Color(), R_DrawParticleModel(), R_DrawPtlCircle(), R_DrawPtlLine(), R_DrawSprite(), r_numParticles, R_SetBlendMode(), R_TexEnv(), R_UseProgram(), refdef, ptl_s::style, STYLE_CIRCLE, STYLE_LINE, and rendererData_t::worldlevel.
Referenced by R_RenderFrame().
void R_GetLevelSurfaceLists | ( | void | ) |
Fills the surface chains for the current worldlevel and hide other levels.
Definition at line 366 of file r_bsp.c.
References model_s::bsp, rlocals_s::frame, mBspHeader_s::headnode, i, cvar_s::integer, LEVEL_LASTVISIBLE, r_drawworld, r_locals, r_mapTiles, r_numMapTiles, R_RecurseWorld(), refdef, mBspModel_s::submodels, and rendererData_t::worldlevel.
Referenced by R_RenderFrame(), and R_RunThread().
Init the SDL window.
Definition at line 156 of file r_sdl.c.
References Com_Printf(), error(), i, cvar_s::integer, cvar_s::modified, qfalse, qtrue, r_ext_texture_compression, r_multisample, r_swapinterval, vid_fullscreen, vid_mode, and vid_strech.
Referenced by R_SetMode().
void R_SetSurfaceBumpMappingParameters | ( | const mBspSurface_t * | surf, | |
const image_t * | normalMap | |||
) |
Definition at line 66 of file r_surface.c.
References mBspSurface_s::deluxemap_texnum, mBspSurface_s::flags, mBspTexInfo_s::image, rstate_t::lighting_enabled, image_s::material, MSURF_LIGHTMAP, qfalse, qtrue, R_BindDeluxemapTexture(), r_bumpmap, R_EnableBumpmap(), r_state, R_UseMaterial(), mBspSurface_s::texinfo, and cvar_s::value.
Referenced by R_SetSurfaceState(), and R_StageLighting().
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().
qboolean Rimp_Init | ( | void | ) |
Definition at line 66 of file r_sdl.c.
References Com_Error(), Com_Printf(), ERR_FATAL, GAME_TITLE, GAME_TITLE_LONG, MAX_VAR, r_sdl_config_s::modes, r_sdl_config_s::numModes, r_sdl_config_s::pixelFormat, Q_strcat(), qtrue, r_config, r_driver, R_SetMode(), R_SetSDLIcon(), cvar_s::string, Sys_Setenv(), va(), r_sdl_config_s::videoInfo, and rconfig_t::videoMemory.
Referenced by R_Init().
void Rimp_Shutdown | ( | void | ) |
Definition at line 200 of file r_sdl.c.
Referenced by R_Shutdown().
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().
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().
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().
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().
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().
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 80 of file r_main.c.
Referenced by R_InitGraphics().
Definition at line 59 of file r_main.c.
Referenced by R_UploadTexture().
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 82 of file r_main.c.
Referenced by R_DrawMaterialSurfaces().