Dragonfly  4.3
A text-based game engine
Public Member Functions | Private Attributes | List of all members
df::Fraps Class Reference
Inheritance diagram for df::Fraps:
Inheritance graph
[legend]
Collaboration diagram for df::Fraps:
Collaboration graph
[legend]

Public Member Functions

 Fraps (bool do_record=false)
 
int eventHandler (const Event *p_e)
 
void setRecord (bool new_record)
 
void setLogFrameRate (bool new_do_frame_rate)
 
- Public Member Functions inherited from df::ViewObject
 ViewObject ()
 
virtual void draw ()
 
void setLocation (ViewObjectLocation new_location)
 
ViewObjectLocation getLocation () const
 
void setDrawValue (bool new_draw_value=true)
 
bool getDrawValue () const
 
void setValue (int new_value)
 
int getValue () const
 
void setBorder (bool new_border)
 
bool getBorder () const
 
void setColor (Color new_color)
 
Color getColor () const
 
void setViewString (std::string new_view_string)
 
std::string getViewString () const
 
void setPosition (Vector new_pos)
 
virtual std::string serialize (bool all=false)
 
virtual int deserialize (std::string s)
 
virtual bool isModified (enum ViewObjectAttribute attribute) const
 
virtual bool isModified () const
 
- Public Member Functions inherited from df::Object
 Object ()
 
virtual ~Object ()
 
void setId (int new_id)
 
int getId () const
 
void setType (std::string new_type)
 
std::string getType () const
 
Vector getPosition () const
 
bool isSolid () const
 
int setSolidness (Solidness new_solid)
 
Solidness getSolidness () const
 
void setNoSoft (bool new_no_soft=true)
 
bool getNoSoft () const
 
void setAvoidCollisions (bool new_avoid_collisions=true)
 
bool getAvoidCollisions () const
 
int setAltitude (int new_altitude)
 
int getAltitude () const
 
void setSpeed (float speed)
 
float getSpeed () const
 
void setDirection (Vector new_direction)
 
Vector getDirection () const
 
void setVelocity (Vector velocity)
 
Vector getVelocity () const
 
void setAcceleration (Vector new_acceleration)
 
Vector getAcceleration () const
 
void accelerate ()
 
Vector predictPosition ()
 
void pathTo (Vector position)
 
void pathTo (Object *p_o_target)
 
void moveTo (Vector position)
 
void doPathFollowing ()
 
int setVisible (bool visible=true)
 
bool isVisible () const
 
int setActive (bool active=true)
 
bool isActive () const
 
void setBox (Box new_box)
 
Box getBox () const
 
int registerInterest (std::string event_type)
 
int unregisterInterest (std::string event_type)
 
void setSpriteName (std::string new_name)
 
std::string getSpriteName () const
 
void setSprite (Sprite *p_new_sprite, bool set_box=true)
 
SpritegetSprite () const
 
void setCentered (bool centered=true)
 
bool isCentered () const
 
void setTransparency (char transparent=' ')
 
char getTransparency () const
 
void setSpriteIndex (int new_sprite_index)
 
int getSpriteIndex () const
 
void setSpriteSlowdown (int new_sprite_slowdown)
 
int getSpriteSlowdown () const
 
void setSpriteSlowdownCount (int new_sprite_slowdown_count)
 
int getSpriteSlowdownCount () const
 
virtual bool isModified (enum ObjectAttribute attribute) const
 
void setShape (Shape new_shape)
 
Shape getShape () const
 
void setFollowPath (bool new_follow_path=true)
 
bool getFollowPath () const
 
void setPath (Path new_path)
 
Path getPath () const
 
PathFindgetPathFind ()
 

Private Attributes

bool m_do_record
 
bool m_do_frame_rate
 
Clock m_clock
 
FILE * m_p_screen
 

Constructor & Destructor Documentation

df::Fraps::Fraps ( bool  do_record = false)

Frames per second meter (with option to record screen).

defaults: TOP_RIGHT, green, don't record, don't log frame rate.

Member Function Documentation

int df::Fraps::eventHandler ( const Event p_e)
virtual

Handle event each step.

Handle keyboard events:

  • f9 to show/hide
  • f11 to toggle logging frame rate
  • f12 to toggle recording

Reimplemented from df::ViewObject.

void df::Fraps::setLogFrameRate ( bool  new_do_frame_rate)

Set whether log frame rate or not.

void df::Fraps::setRecord ( bool  new_record)

Set whether record or not.

Member Data Documentation

Clock df::Fraps::m_clock
private

For computing frame rate.

bool df::Fraps::m_do_frame_rate
private

True if logging frame rate.

bool df::Fraps::m_do_record
private

True if recording.

FILE* df::Fraps::m_p_screen
private

Output file handle.