r_draw.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void R_DrawImage (float x, float y, const image_t *image)
 Draws an image or parts of it.
void R_DrawStretchImage (float x, float y, int w, int h, const image_t *image)
const image_tR_DrawImageArray (const vec2_t texcoords[4], const vec2_t verts[4], const image_t *image)
void R_DrawChar (int x, int y, int c)
 Draws one 8*8 graphics character with 0 being transparent. It can be clipped to the top of the screen to allow the console to be smoothly scrolled off.
void R_DrawChars (void)
void R_DrawFill (int x, int y, int w, int h, const vec4_t color)
 Fills a box of pixels with a single color.
void R_DrawRect (int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern)
 Draws a rect to the screen. Also has support for stippled rendering of the rect.
int R_UploadData (const char *name, byte *frame, int width, int height)
 Uploads image data.
void R_DrawTexture (int texnum, int x, int y, int w, int h)
 Bind and draw a texture.
void R_DrawLineStrip (int points, int *verts)
 2 dimensional line strip
void R_DrawLineLoop (int points, int *verts)
void R_DrawLine (int *verts, float thickness)
 Draws one line with only one start and one end point.
void R_DrawCircle (vec3_t mid, float radius, const vec4_t color, int thickness)
 Draws a circle out of lines.
void R_DrawCircle2D (int x, int y, float radius, qboolean fill, const vec4_t color, float thickness)
 Draws a circle out of lines.
void R_DrawPolygon (int points, int *verts)
void R_PushClipRect (int x, int y, int width, int height)
 Force to draw only on a rect.
void R_PopClipRect (void)
void R_CleanupDepthBuffer (int x, int y, int width, int height)
 "Clean up" the depth buffer into a rect
void R_DrawBoundingBox (const vec3_t mins, const vec3_t maxs)
 Draws the model bounding box.

Detailed Description

Definition in file r_draw.h.


Function Documentation

void R_CleanupDepthBuffer ( int  x,
int  y,
int  width,
int  height 
)

"Clean up" the depth buffer into a rect

Note:
we use a big value (but not too big) to set the depth buffer, then it is not really a clean up
Todo:
can we fix bigZ with a value come from glGet?

Definition at line 585 of file r_draw.c.

References GLboolean(), GLint, viddef_t::rx, viddef_t::ry, and viddef.

Referenced by UI_DrawModelNode(), UI_ItemNodeDraw(), and UI_RadarNodeDraw().

void R_DrawBoundingBox ( const vec3_t  mins,
const vec3_t  maxs 
)

Draws the model bounding box.

See also:
R_EntityComputeBoundingBox

Definition at line 634 of file r_draw.c.

References R_ComputeBoundingBox().

Referenced by R_DrawBox(), R_DrawBrushModel(), R_DrawModelDirect(), R_DrawModelParticle(), and R_DrawSurface().

void R_DrawChar ( int  x,
int  y,
int  c 
)

Draws one 8*8 graphics character with 0 being transparent. It can be clipped to the top of the screen to allow the console to be smoothly scrolled off.

Definition at line 66 of file r_draw.c.

References char_index, char_texcoords, char_verts, con_fontHeight, con_fontWidth, int(), and MAX_CHARS.

Referenced by Con_DisplayString(), Con_DrawConsole(), Con_DrawInput(), Con_DrawNotify(), and SCR_DrawString().

void R_DrawChars ( void   ) 

Definition at line 110 of file r_draw.c.

References char_index, char_texcoords, char_verts, R_BindDefaultArray(), R_BindTexture, and image_s::texnum.

Referenced by SCR_UpdateScreen().

void R_DrawCircle ( vec3_t  mid,
float  radius,
const vec4_t  color,
int  thickness 
)

Draws a circle out of lines.

Parameters:
[in] mid Center of the circle
[in] radius Radius of the circle
[in] color The color of the circle lines
See also:
R_DrawPtlCircle
R_DrawLineStrip

Definition at line 334 of file r_draw.c.

References R_Color(), viddef_t::rx, and viddef.

void R_DrawCircle2D ( int  x,
int  y,
float  radius,
qboolean  fill,
const vec4_t  color,
float  thickness 
)

Draws a circle out of lines.

Parameters:
[in] x X screen coordinate
[in] y Y screen coordinate
[in] radius Radius of the circle
[in] color The color of the circle lines
[in] fill Fill the circle with the given color
[in] thickness The thickness of the lines
See also:
R_DrawPtlCircle
R_DrawLineStrip

Definition at line 395 of file r_draw.c.

References CIRCLE_LINE_COUNT, i, and R_Color().

void R_DrawFill ( int  x,
int  y,
int  w,
int  h,
const vec4_t  color 
)

Fills a box of pixels with a single color.

Definition at line 261 of file r_draw.c.

References R_Color(), viddef_t::rx, viddef_t::ry, and viddef.

Referenced by MAP_DrawAircraftHealthBar(), MAP_DrawBullets(), SCR_DrawLoadingBar(), SEQ_Render2D(), and UI_DrawFill().

void R_DrawImage ( float  x,
float  y,
const image_t image 
)

Draws an image or parts of it.

Parameters:
[in] x X position to draw the image to
[in] y Y position to draw the image to

Definition at line 224 of file r_draw.c.

References image_s::height, R_DrawTexture(), viddef_t::rx, viddef_t::ry, image_s::texnum, viddef, and image_s::width.

Referenced by HUD_UpdateCursor(), MAP_DrawMapMarkers(), MAP_DrawMapOneBase(), MAP_DrawMapOneInstallation(), MAP_DrawMapOneMission(), MAP_DrawMapOnePhalanxAircraft(), SCR_DrawCursor(), SCR_DrawLoading(), SCR_DrawPrecacheScreen(), and SEQ_Render2D().

const image_t* R_DrawImageArray ( const vec2_t  texcoords[4],
const vec2_t  verts[4],
const image_t image 
)
void R_DrawLine ( int *  verts,
float  thickness 
)

Draws one line with only one start and one end point.

See also:
R_DrawCircle
R_DrawLineStrip

Definition at line 482 of file r_draw.c.

References R_Draw2DArray().

Referenced by MAP_DrawBeam().

void R_DrawLineLoop ( int  points,
int *  verts 
)
See also:
R_DrawCircle
R_DrawLineStrip

Definition at line 472 of file r_draw.c.

References R_Draw2DArray().

void R_DrawLineStrip ( int  points,
int *  verts 
)

2 dimensional line strip

See also:
R_DrawCircle
R_DrawLineLoop

Definition at line 463 of file r_draw.c.

References R_Draw2DArray().

Referenced by MAP_3DMapDrawLine(), MAP_MapDrawEquidistantPoints(), MAP_MapDrawLine(), RADAR_DrawInMap(), and UI_LineChartNodeDraw().

void R_DrawPolygon ( int  points,
int *  verts 
)
See also:
R_DrawCircle
R_DrawLineStrip
R_DrawLineLoop

Definition at line 498 of file r_draw.c.

References R_Draw2DArray().

void R_DrawRect ( int  x,
int  y,
int  w,
int  h,
const vec4_t  color,
float  lineWidth,
int  pattern 
)

Draws a rect to the screen. Also has support for stippled rendering of the rect.

Parameters:
[in] x X-position of the rect
[in] y Y-position of the rect
[in] w Width of the rect
[in] h Height of the rect
[in] color RGBA color of the rect
[in] lineWidth Line strength in pixel of the rect
[in] pattern Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first; the default pattern is all 1's
Note:
The stipple factor is 2 for this function

Definition at line 298 of file r_draw.c.

References f, R_Color(), viddef_t::rx, viddef_t::ry, and viddef.

Referenced by MAP_DrawAircraftHealthBar(), UI_DrawNode(), UI_EditorNodeHighlightNode(), and UI_MaterialEditorNodeDraw().

void R_DrawStretchImage ( float  x,
float  y,
int  w,
int  h,
const image_t image 
)

Definition at line 232 of file r_draw.c.

References R_DrawTexture(), viddef_t::rx, viddef_t::ry, image_s::texnum, and viddef.

Referenced by Con_DrawConsole().

void R_DrawTexture ( int  texnum,
int  x,
int  y,
int  w,
int  h 
)

Bind and draw a texture.

Parameters:
[in] texnum The texture id (already uploaded of course)
[in] x normalized x value on the screen
[in] y normalized y value on the screen
[in] w normalized width value
[in] h normalized height value

Definition at line 211 of file r_draw.c.

References default_texcoords, R_BindTexture, and R_DrawImageArray().

Referenced by CIN_OGM_DrawCinematic(), CIN_ROQ_DrawCinematic(), R_Draw3DGlobe(), R_DrawImage(), and R_DrawStretchImage().

void R_PopClipRect ( void   ) 
void R_PushClipRect ( int  x,
int  y,
int  width,
int  height 
)

Force to draw only on a rect.

Note:
Don't forget to call R_EndClipRect
See also:
R_PopClipRect

Definition at line 539 of file r_draw.c.

References currentClipRect, rect_t::height, MAX_CLIPRECT, R_RectIntersection(), viddef_t::rx, viddef_t::ry, viddef, viddef_t::virtualHeight, rect_t::width, rect_t::x, and rect_t::y.

Referenced by UI_BaseInventoryNodeDraw2(), UI_DrawModelNode(), UI_DrawNode(), UI_MapNodeDraw(), and UI_RadarNodeDraw().

int R_UploadData ( const char *  name,
byte frame,
int  width,
int  height 
)

Uploads image data.

Parameters:
[in] name The name of the texture to use for this data
[in] frame The frame data that is uploaded
[in] width The width of the texture
[in] height The height of the texture
Returns:
the texture number of the uploaded images

Definition at line 135 of file r_draw.c.

References byte, Com_Error(), ERR_FATAL, rconfig_t::gl_alpha_format, rconfig_t::gl_compressed_alpha_format, rconfig_t::gl_compressed_solid_format, rconfig_t::gl_solid_format, image_s::height, i, it_pic, Mem_Free, Mem_PoolAllocExt, qfalse, R_BindTexture, R_CheckError, r_config, R_FindImage(), R_GetScaledTextureSize(), r_noTexture, R_ScaleTexture(), image_s::texnum, image_s::upload_height, image_s::upload_width, vid_imagePool, and image_s::width.

Referenced by CIN_OGM_DrawCinematic(), and CIN_ROQ_DrawCinematic().


Generated by  doxygen 1.6.2