r_local.h File Reference

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"
Include dependency graph for r_local.h:
This graph shows which files directly or indirectly include this file:

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_tr_brightness
cvar_tr_contrast
cvar_tr_saturation
cvar_tr_drawworld
cvar_tr_drawentities
cvar_tr_nocull
cvar_tr_isometric
cvar_tr_anisotropic
cvar_tr_texture_lod
cvar_tr_materials
cvar_tr_screenshot_format
cvar_tr_screenshot_jpeg_quality
cvar_tr_lightmap
cvar_tr_debug_normals
cvar_tr_debug_tangents
cvar_tr_ext_texture_compression
cvar_tr_checkerror
cvar_tr_showbox
cvar_tr_shadows
cvar_tr_soften
cvar_tr_modulate
cvar_tr_drawbuffer
cvar_tr_driver
cvar_tr_swapinterval
cvar_tr_multisample
cvar_tr_threads
cvar_tr_wire
cvar_tr_vertexbuffers
cvar_tr_maxlightmap
cvar_tr_warp
cvar_tr_lights
cvar_tr_programs
cvar_tr_postprocess
cvar_tr_shownormals
cvar_tr_bumpmap
cvar_tr_specular
cvar_tr_hardness
cvar_tr_parallax
cvar_tr_fog
cvar_tr_flares
cvar_tr_coronas
cvar_tr_dynamic_lights
rlocals_t r_locals
rconfig_t r_config

Detailed Description

local graphics definitions

Definition in file r_local.h.


Typedef Documentation

typedef struct rlocals_s rlocals_t

Enumeration Type Documentation

Enumerator:
GLHW_GENERIC 
GLHW_MESA 
GLHW_INTEL 
GLHW_ATI 
GLHW_NVIDIA 

Definition at line 137 of file r_local.h.


Function Documentation

qboolean R_CullBspModel ( const entity_t e  ) 

Returns true if the specified entity is completely culled by the view frustum, false otherwise.

Parameters:
[in] e The entity to check
See also:
R_CullBox

Definition at line 93 of file r_bsp.c.

References i, qtrue, R_CullBox(), R_EntityGetOrigin(), VectorAdd, and VectorCopy.

Referenced by R_CullEntity().

qboolean R_CullMeshModel ( entity_t e  ) 
qboolean R_CullSphere ( const vec3_t  centre,
const float  radius,
const unsigned int  clipflags 
)

Performs a spherical frustum check.

Parameters:
[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
Returns:
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  ) 
void R_DrawBlendSurfaces ( const mBspSurfaces_t surfs  ) 

Draw the surface chain with multitexture enabled and blend enabled.

See also:
R_DrawOpaqueSurfaces

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.

See also:
R_DrawOpaqueWarpSurfaces

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.

Parameters:
[in] e The inline bsp model entity
Note:
E.g. a func_breakable or func_door

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  ) 
void R_DrawEntities ( void   ) 
void R_DrawInitLocal ( void   ) 

Loads some textures and init the 3d globe.

See also:
R_Init

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.

Todo:
  • integrate BSP lighting with dynamic lighting

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  ) 
void R_DrawOpaqueSurfaces ( const mBspSurfaces_t surfs  ) 

Draw the surface chain with multitexture enabled and light enabled.

See also:
R_DrawBlendSurfaces

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.

See also:
R_DrawBlendWarpSurfaces

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   ) 
void R_GetLevelSurfaceLists ( void   ) 

Fills the surface chains for the current worldlevel and hide other levels.

See also:
cvar cl_worldlevel

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().

qboolean R_InitGraphics ( qboolean  fullscreen,
int  width,
int  height 
)
void R_SetSurfaceBumpMappingParameters ( const mBspSurface_t surf,
const image_t normalMap 
)
void R_SetupFrustum ( void   ) 
qboolean Rimp_Init ( void   ) 
void Rimp_Shutdown ( void   ) 

Definition at line 200 of file r_sdl.c.

Referenced by R_Shutdown().


Variable Documentation

Definition at line 58 of file r_main.c.

Definition at line 51 of file r_main.c.

Referenced by R_FilterTexture().

Definition at line 74 of file r_main.c.

Referenced by R_CheckErrorDebug().

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 63 of file r_main.c.

Definition at line 64 of file r_main.c.

Definition at line 75 of file r_main.c.

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 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 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().


Generated by  doxygen 1.6.2