ork::ShowInfoTask Class Reference
[scenegraph]

An AbstractTask to display the framerate and other information. More...

#include <ShowInfoTask.h>

Inheritance diagram for ork::ShowInfoTask:
ork::AbstractTask ork::TaskFactory ork::Object ork::ShowLogTask

List of all members.

Public Member Functions

 ShowInfoTask (ptr< Font > font, ptr< Program > p, int color, float size, vec3i pos)
 Creates a new ShowInfoTask.
virtual ~ShowInfoTask ()
 Deletes this ShowInfoTask.
virtual ptr< TaskgetTask (ptr< Object > context)
 Creates a new task.

Static Public Member Functions

static void setInfo (const string &topic, const string &info)
 Adds an information to display.

Protected Member Functions

 ShowInfoTask ()
 Creates an uninitialized ShowInfoTask.
virtual void init (ptr< Font > font, ptr< Program > p, int color, float size, vec3i pos)
 Initializes this ShowInfoTask.
virtual void swap (ptr< ShowInfoTask > t)
 Swaps this ShowInfoTask with another one.
virtual void drawLine (const vec4f &vp, float xs, float ys, int color, const string &s)
 Draws a line of text.
virtual void draw (ptr< Method > context)
 Draws the framerate and the information messages.

Protected Attributes

ptr< ProgramfontProgram
 The program use to draw characters.
ptr< UniformSamplerfontU
 The uniform in fontProgram used to control the font texture.
ptr< Fontfont
 The Font used to display Text.
int fontColor
 The font color in RGBA8 format.
float fontHeight
 The used font height.
vec3i position
 The x,y position and the maximum number of lines of text to be displayed.

Static Protected Attributes

static static_ptr< Mesh
< Font::Vertex, unsigned int > > 
fontMesh
 The mesh used to draw character quads, in order to display text.
static map< string, string > infos
 The current information messages, associated with their topic.

Detailed Description

An AbstractTask to display the framerate and other information.


Constructor & Destructor Documentation

ork::ShowInfoTask::ShowInfoTask ( ptr< Font font,
ptr< Program p,
int  color,
float  size,
vec3i  pos 
)

Creates a new ShowInfoTask.

Parameters:
font the Font used to display Text.
p the program to be used to draw characters.
color the font color in RGBA8 format.
size the font height.
pos x,y position and maximum number of lines of text to display.
virtual ork::ShowInfoTask::~ShowInfoTask (  )  [virtual]

Deletes this ShowInfoTask.

ork::ShowInfoTask::ShowInfoTask (  )  [protected]

Creates an uninitialized ShowInfoTask.


Member Function Documentation

virtual void ork::ShowInfoTask::draw ( ptr< Method context  )  [protected, virtual]

Draws the framerate and the information messages.

Parameters:
context the method to which this task belongs.

Reimplemented in ork::ShowLogTask.

virtual void ork::ShowInfoTask::drawLine ( const vec4f vp,
float  xs,
float  ys,
int  color,
const string &  s 
) [protected, virtual]

Draws a line of text.

Parameters:
vp the framebuffer viewport, in pixels.
xs the x coordinate of the first character to display.
ys the y coordinate of the first character to display.
color the color of this line of text, in RGBA8 format.
s the line of text to display.
virtual ptr<Task> ork::ShowInfoTask::getTask ( ptr< Object context  )  [virtual]

Creates a new task.

Parameters:
context an optional parameter to control the task creation.
Returns:
the created task.

Implements ork::TaskFactory.

virtual void ork::ShowInfoTask::init ( ptr< Font font,
ptr< Program p,
int  color,
float  size,
vec3i  pos 
) [protected, virtual]

Initializes this ShowInfoTask.

Parameters:
font the Font used to display Text.
p the program to be used to draw characters.
color the font color in RGBA8 format.
size the font height.
pos x,y position and maximum number of lines of text to display.
static void ork::ShowInfoTask::setInfo ( const string &  topic,
const string &  info 
) [static]

Adds an information to display.

The information has a topic and replaces the previous information in this topic. All the topics are cleared after each frame (you have to set them at each frame if you want them to persist on screen).

Parameters:
topic the topic of the information.
info an information message.
virtual void ork::ShowInfoTask::swap ( ptr< ShowInfoTask t  )  [protected, virtual]

Swaps this ShowInfoTask with another one.

Parameters:
t a ShowInfoTask.

Member Data Documentation

The Font used to display Text.

The font color in RGBA8 format.

float ork::ShowInfoTask::fontHeight [protected]

The used font height.

static_ptr< Mesh<Font::Vertex, unsigned int> > ork::ShowInfoTask::fontMesh [static, protected]

The mesh used to draw character quads, in order to display text.

The program use to draw characters.

The uniform in fontProgram used to control the font texture.

map<string, string> ork::ShowInfoTask::infos [static, protected]

The current information messages, associated with their topic.

The x,y position and the maximum number of lines of text to be displayed.


Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1