doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
idDeviceContext Class Reference

#include <DeviceContext.h>

Public Types

enum  { CURSOR_ARROW, CURSOR_HAND, CURSOR_COUNT }
 
enum  { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }
 
enum  {
  SCROLLBAR_HBACK, SCROLLBAR_VBACK, SCROLLBAR_THUMB, SCROLLBAR_RIGHT,
  SCROLLBAR_LEFT, SCROLLBAR_UP, SCROLLBAR_DOWN, SCROLLBAR_COUNT
}
 

Public Member Functions

 idDeviceContext ()
 
 ~idDeviceContext ()
 
void Init ()
 
void Shutdown ()
 
bool Initialized ()
 
void EnableLocalization ()
 
void GetTransformInfo (idVec3 &origin, idMat3 &mat)
 
void SetTransformInfo (const idVec3 &origin, const idMat3 &mat)
 
void DrawMaterial (float x, float y, float w, float h, const idMaterial *mat, const idVec4 &color, float scalex=1.0, float scaley=1.0)
 
void DrawRect (float x, float y, float width, float height, float size, const idVec4 &color)
 
void DrawFilledRect (float x, float y, float width, float height, const idVec4 &color)
 
int DrawText (const char *text, float textScale, int textAlign, idVec4 color, idRectangle rectDraw, bool wrap, int cursor=-1, bool calcOnly=false, idList< int > *breaks=NULL, int limit=0)
 
void DrawMaterialRect (float x, float y, float w, float h, float size, const idMaterial *mat, const idVec4 &color)
 
void DrawStretchPic (float x, float y, float w, float h, float s0, float t0, float s1, float t1, const idMaterial *mat)
 
void DrawMaterialRotated (float x, float y, float w, float h, const idMaterial *mat, const idVec4 &color, float scalex=1.0, float scaley=1.0, float angle=0.0f)
 
void DrawStretchPicRotated (float x, float y, float w, float h, float s0, float t0, float s1, float t1, const idMaterial *mat, float angle=0.0f)
 
int CharWidth (const char c, float scale)
 
int TextWidth (const char *text, float scale, int limit)
 
int TextHeight (const char *text, float scale, int limit)
 
int MaxCharHeight (float scale)
 
int MaxCharWidth (float scale)
 
int FindFont (const char *name)
 
void SetupFonts ()
 
idRegionGetTextRegion (const char *text, float textScale, idRectangle rectDraw, float xStart, float yStart)
 
void SetSize (float width, float height)
 
const idMaterialGetScrollBarImage (int index)
 
void DrawCursor (float *x, float *y, float size)
 
void SetCursor (int n)
 
void AdjustCoords (float *x, float *y, float *w, float *h)
 
bool ClippedCoords (float *x, float *y, float *w, float *h)
 
bool ClippedCoords (float *x, float *y, float *w, float *h, float *s1, float *t1, float *s2, float *t2)
 
void PushClipRect (float x, float y, float w, float h)
 
void PushClipRect (idRectangle r)
 
void PopClipRect ()
 
void EnableClipping (bool b)
 
void SetFont (int num)
 
void SetOverStrike (bool b)
 
bool GetOverStrike ()
 
void DrawEditCursor (float x, float y, float scale)
 

Static Public Attributes

static idVec4 colorPurple
 
static idVec4 colorOrange
 
static idVec4 colorYellow
 
static idVec4 colorGreen
 
static idVec4 colorBlue
 
static idVec4 colorRed
 
static idVec4 colorWhite
 
static idVec4 colorBlack
 
static idVec4 colorNone
 

Private Member Functions

int DrawText (float x, float y, float scale, idVec4 color, const char *text, float adjust, int limit, int style, int cursor=-1)
 
void PaintChar (float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, const idMaterial *hShader)
 
void SetFontByScale (float scale)
 
void Clear (void)
 

Private Attributes

const idMaterialcursorImages [CURSOR_COUNT]
 
const idMaterialscrollBarImages [SCROLLBAR_COUNT]
 
const idMaterialwhiteImage
 
fontInfoEx_tactiveFont
 
fontInfo_tuseFont
 
idStr fontName
 
float xScale
 
float yScale
 
float vidHeight
 
float vidWidth
 
int cursor
 
idList< idRectangleclipRects
 
idStr fontLang
 
bool enableClipping
 
bool overStrikeMode
 
idMat3 mat
 
idVec3 origin
 
bool initialized
 
bool mbcs
 

Static Private Attributes

static idList< fontInfoEx_tfonts
 

Detailed Description

Definition at line 41 of file DeviceContext.h.

Member Enumeration Documentation

anonymous enum
Enumerator
CURSOR_ARROW 
CURSOR_HAND 
CURSOR_COUNT 

Definition at line 99 of file DeviceContext.h.

anonymous enum
Enumerator
ALIGN_LEFT 
ALIGN_CENTER 
ALIGN_RIGHT 

Definition at line 105 of file DeviceContext.h.

anonymous enum
Enumerator
SCROLLBAR_HBACK 
SCROLLBAR_VBACK 
SCROLLBAR_THUMB 
SCROLLBAR_RIGHT 
SCROLLBAR_LEFT 
SCROLLBAR_UP 
SCROLLBAR_DOWN 
SCROLLBAR_COUNT 

Definition at line 111 of file DeviceContext.h.

Constructor & Destructor Documentation

idDeviceContext::idDeviceContext ( )

Definition at line 154 of file DeviceContext.cpp.

idDeviceContext::~idDeviceContext ( )
inline

Definition at line 44 of file DeviceContext.h.

Member Function Documentation

void idDeviceContext::AdjustCoords ( float x,
float y,
float w,
float h 
)

Definition at line 258 of file DeviceContext.cpp.

int idDeviceContext::CharWidth ( const char  c,
float  scale 
)

Definition at line 757 of file DeviceContext.cpp.

void idDeviceContext::Clear ( void  )
private

Definition at line 147 of file DeviceContext.cpp.

bool idDeviceContext::ClippedCoords ( float x,
float y,
float w,
float h 
)
bool idDeviceContext::ClippedCoords ( float x,
float y,
float w,
float h,
float s1,
float t1,
float s2,
float t2 
)

Definition at line 186 of file DeviceContext.cpp.

void idDeviceContext::DrawCursor ( float x,
float y,
float  size 
)

Definition at line 622 of file DeviceContext.cpp.

void idDeviceContext::DrawEditCursor ( float  x,
float  y,
float  scale 
)

Definition at line 926 of file DeviceContext.cpp.

void idDeviceContext::DrawFilledRect ( float  x,
float  y,
float  width,
float  height,
const idVec4 color 
)

Definition at line 568 of file DeviceContext.cpp.

void idDeviceContext::DrawMaterial ( float  x,
float  y,
float  w,
float  h,
const idMaterial mat,
const idVec4 color,
float  scalex = 1.0,
float  scaley = 1.0 
)

Definition at line 360 of file DeviceContext.cpp.

void idDeviceContext::DrawMaterialRect ( float  x,
float  y,
float  w,
float  h,
float  size,
const idMaterial mat,
const idVec4 color 
)

Definition at line 604 of file DeviceContext.cpp.

void idDeviceContext::DrawMaterialRotated ( float  x,
float  y,
float  w,
float  h,
const idMaterial mat,
const idVec4 color,
float  scalex = 1.0,
float  scaley = 1.0,
float  angle = 0.0f 
)

Definition at line 407 of file DeviceContext.cpp.

void idDeviceContext::DrawRect ( float  x,
float  y,
float  width,
float  height,
float  size,
const idVec4 color 
)

Definition at line 585 of file DeviceContext.cpp.

void idDeviceContext::DrawStretchPic ( float  x,
float  y,
float  w,
float  h,
float  s0,
float  t0,
float  s1,
float  t1,
const idMaterial mat 
)

Definition at line 273 of file DeviceContext.cpp.

void idDeviceContext::DrawStretchPicRotated ( float  x,
float  y,
float  w,
float  h,
float  s0,
float  t0,
float  s1,
float  t1,
const idMaterial mat,
float  angle = 0.0f 
)

Definition at line 454 of file DeviceContext.cpp.

int idDeviceContext::DrawText ( const char *  text,
float  textScale,
int  textAlign,
idVec4  color,
idRectangle  rectDraw,
bool  wrap,
int  cursor = -1,
bool  calcOnly = false,
idList< int > *  breaks = NULL,
int  limit = 0 
)

Definition at line 937 of file DeviceContext.cpp.

int idDeviceContext::DrawText ( float  x,
float  y,
float  scale,
idVec4  color,
const char *  text,
float  adjust,
int  limit,
int  style,
int  cursor = -1 
)
private

Definition at line 678 of file DeviceContext.cpp.

void idDeviceContext::EnableClipping ( bool  b)
inline

Definition at line 90 of file DeviceContext.h.

void idDeviceContext::EnableLocalization ( )
int idDeviceContext::FindFont ( const char *  name)

Definition at line 51 of file DeviceContext.cpp.

bool idDeviceContext::GetOverStrike ( )
inline

Definition at line 95 of file DeviceContext.h.

const idMaterial * idDeviceContext::GetScrollBarImage ( int  index)

Definition at line 848 of file DeviceContext.cpp.

idRegion * idDeviceContext::GetTextRegion ( const char *  text,
float  textScale,
idRectangle  rectDraw,
float  xStart,
float  yStart 
)

Definition at line 856 of file DeviceContext.cpp.

void idDeviceContext::GetTransformInfo ( idVec3 origin,
idMat3 mat 
)

Definition at line 165 of file DeviceContext.cpp.

void idDeviceContext::Init ( void  )

Definition at line 97 of file DeviceContext.cpp.

bool idDeviceContext::Initialized ( )
inline

Definition at line 48 of file DeviceContext.h.

int idDeviceContext::MaxCharHeight ( float  scale)

Definition at line 842 of file DeviceContext.cpp.

int idDeviceContext::MaxCharWidth ( float  scale)

Definition at line 836 of file DeviceContext.cpp.

void idDeviceContext::PaintChar ( float  x,
float  y,
float  width,
float  height,
float  scale,
float  s,
float  t,
float  s2,
float  t2,
const idMaterial hShader 
)
private

Definition at line 648 of file DeviceContext.cpp.

void idDeviceContext::PopClipRect ( )

Definition at line 172 of file DeviceContext.cpp.

void idDeviceContext::PushClipRect ( float  x,
float  y,
float  w,
float  h 
)

Definition at line 182 of file DeviceContext.cpp.

void idDeviceContext::PushClipRect ( idRectangle  r)

Definition at line 178 of file DeviceContext.cpp.

void idDeviceContext::SetCursor ( int  n)

Definition at line 618 of file DeviceContext.cpp.

void idDeviceContext::SetFont ( int  num)

Definition at line 88 of file DeviceContext.cpp.

void idDeviceContext::SetFontByScale ( float  scale)
private

Definition at line 662 of file DeviceContext.cpp.

void idDeviceContext::SetOverStrike ( bool  b)
inline

Definition at line 93 of file DeviceContext.h.

void idDeviceContext::SetSize ( float  width,
float  height 
)

Definition at line 747 of file DeviceContext.cpp.

void idDeviceContext::SetTransformInfo ( const idVec3 origin,
const idMat3 mat 
)

Definition at line 158 of file DeviceContext.cpp.

void idDeviceContext::SetupFonts ( )

Definition at line 74 of file DeviceContext.cpp.

void idDeviceContext::Shutdown ( void  )

Definition at line 140 of file DeviceContext.cpp.

int idDeviceContext::TextHeight ( const char *  text,
float  scale,
int  limit 
)

Definition at line 798 of file DeviceContext.cpp.

int idDeviceContext::TextWidth ( const char *  text,
float  scale,
int  limit 
)

Definition at line 767 of file DeviceContext.cpp.

Member Data Documentation

fontInfoEx_t* idDeviceContext::activeFont
private

Definition at line 141 of file DeviceContext.h.

idList<idRectangle> idDeviceContext::clipRects
private

Definition at line 152 of file DeviceContext.h.

idVec4 idDeviceContext::colorBlack
static

Definition at line 129 of file DeviceContext.h.

idVec4 idDeviceContext::colorBlue
static

Definition at line 126 of file DeviceContext.h.

idVec4 idDeviceContext::colorGreen
static

Definition at line 125 of file DeviceContext.h.

idVec4 idDeviceContext::colorNone
static

Definition at line 130 of file DeviceContext.h.

idVec4 idDeviceContext::colorOrange
static

Definition at line 123 of file DeviceContext.h.

idVec4 idDeviceContext::colorPurple
static

Definition at line 122 of file DeviceContext.h.

idVec4 idDeviceContext::colorRed
static

Definition at line 127 of file DeviceContext.h.

idVec4 idDeviceContext::colorWhite
static

Definition at line 128 of file DeviceContext.h.

idVec4 idDeviceContext::colorYellow
static

Definition at line 124 of file DeviceContext.h.

int idDeviceContext::cursor
private

Definition at line 150 of file DeviceContext.h.

const idMaterial* idDeviceContext::cursorImages[CURSOR_COUNT]
private

Definition at line 138 of file DeviceContext.h.

bool idDeviceContext::enableClipping
private

Definition at line 157 of file DeviceContext.h.

idStr idDeviceContext::fontLang
private

Definition at line 155 of file DeviceContext.h.

idStr idDeviceContext::fontName
private

Definition at line 143 of file DeviceContext.h.

idList< fontInfoEx_t > idDeviceContext::fonts
staticprivate

Definition at line 154 of file DeviceContext.h.

bool idDeviceContext::initialized
private

Definition at line 163 of file DeviceContext.h.

idMat3 idDeviceContext::mat
private

Definition at line 161 of file DeviceContext.h.

bool idDeviceContext::mbcs
private

Definition at line 165 of file DeviceContext.h.

idVec3 idDeviceContext::origin
private

Definition at line 162 of file DeviceContext.h.

bool idDeviceContext::overStrikeMode
private

Definition at line 159 of file DeviceContext.h.

const idMaterial* idDeviceContext::scrollBarImages[SCROLLBAR_COUNT]
private

Definition at line 139 of file DeviceContext.h.

fontInfo_t* idDeviceContext::useFont
private

Definition at line 142 of file DeviceContext.h.

float idDeviceContext::vidHeight
private

Definition at line 147 of file DeviceContext.h.

float idDeviceContext::vidWidth
private

Definition at line 148 of file DeviceContext.h.

const idMaterial* idDeviceContext::whiteImage
private

Definition at line 140 of file DeviceContext.h.

float idDeviceContext::xScale
private

Definition at line 144 of file DeviceContext.h.

float idDeviceContext::yScale
private

Definition at line 145 of file DeviceContext.h.


The documentation for this class was generated from the following files: