ui::Graphics Class Reference

Collaboration diagram for ui::Graphics:

Collaboration graph
[legend]
List of all members.

Detailed Description

Graphics Context. Graphics is the base class for all drawing related code, and thus also contains OpenGL code.


Public Member Functions

 Graphics ()
 ~Graphics ()
void translate (int x, int y)
void pushMatrix ()
void popMatrix ()
void setDepth (float newDepth)
float getDepth ()
void setPaint (const util::Paint *paint)
void drawRect (int x, int y, int width, int height)
void fillRect (int x, int y, int width, int height)
void drawImage (int textureId, int x, int y, int width, int height)
void drawLine (int x1, int y1, int x2, int y2)
void setFont (Font *f)
void drawString (int x, int y, std::string str)
void fillCircle (int x, int y, int radius)
void setLineWidth (int width)
bool pushDepth (float d)
void popDepth (float d)
void enableScissor (int x, int y, int width, int height)
void disableScissor ()
void enableBlending ()
void disableBlending ()
void paintUniqueColoredRect (int index, int x, int y, int width, int height)
void rotate (float degrees)
bool pushTransparency (float f)
void popTransparency ()
void setTransparency (float f)
float getTransparency ()


Constructor & Destructor Documentation

ui::Graphics::Graphics  ) 
 

Creates a Graphics instance. For normal use you'll only want one of these.

ui::Graphics::~Graphics  ) 
 

Destroys the Graphics instance, and returns all memory used by it.


Member Function Documentation

void ui::Graphics::translate int  x,
int  y
 

Translate the orientation.

void ui::Graphics::pushMatrix  ) 
 

Save translation matrix.

void ui::Graphics::popMatrix  ) 
 

Restore translation matrix.

void ui::Graphics::setDepth float  newDepth  ) 
 

Sets the rendering depth.

Parameters:
newDepth new depth should range from 0 to 1.

float ui::Graphics::getDepth  ) 
 

Returns the currently used depth.

void ui::Graphics::setPaint const util::Paint paint  ) 
 

Sets the current color(paint), this will be used by any further call to the Graphics context, until another setPaint() call is made.

void ui::Graphics::drawRect int  x,
int  y,
int  width,
int  height
 

Draws a rectangle to the screen at the given location, with specified width and height.

void ui::Graphics::fillRect int  x,
int  y,
int  width,
int  height
 

Draws a filled rectangle to the screen at the given location, with specified width and height.

void ui::Graphics::drawImage int  textureId,
int  x,
int  y,
int  width,
int  height
 

draws an image

void ui::Graphics::drawLine int  x1,
int  y1,
int  x2,
int  y2
 

Draws a line from one point to another.

void ui::Graphics::drawString int  x,
int  y,
std::string  str
 

Draws a string in the current font.

void ui::Graphics::fillCircle int  x,
int  y,
int  radius
 

Fills a circle at the given location with given radius.

void ui::Graphics::setLineWidth int  width  ) 
 

Set the linewidth.

Note:
this is a state switch, you must set it back to the original value after using it.

bool ui::Graphics::pushDepth float  d  ) 
 

Store the current depth.

void ui::Graphics::popDepth float  d  ) 
 

Restore the previous depth.

void ui::Graphics::enableScissor int  x,
int  y,
int  width,
int  height
 

Enable scissor testing, which effectively 'masks' out a rendering area. This is automatically calculated from GUI coordinates ((0,0) in top-left corner) to OpenGL coordinates ((0,0) in bottom-left corner).

Note:
Note that this is a state flag, you must return to normal mode by using disableScissor().
See also:
disableScissor();
Parameters:
x horizontal location of the scissor area.
y vertical location of the scissor area.
width scissor area width.
height scissor area height.

void ui::Graphics::disableScissor  ) 
 

Disables the scissor area testing.

void ui::Graphics::enableBlending  ) 
 

Enables alpha blending.

void ui::Graphics::disableBlending  ) 
 

Disables alpha blending.

void ui::Graphics::paintUniqueColoredRect int  index,
int  x,
int  y,
int  width,
int  height
 

Paint a unique colored rectangle to the screen. This is used by the SelectionManager, and should not be used for normal painting.

void ui::Graphics::rotate float  degrees  ) 
 

Rotate the coordinate system over the x axis.


Generated on Mon Jun 20 19:41:43 2005 for UI by doxygen 1.3.1 using KingsTools