A virtual derived class of GameObject that allows the GameObject to be drawn. More...

#include <Drawable.h>

Inheritance diagram for Drawable:

Detailed Description

A virtual derived class of GameObject that allows the GameObject to be drawn.

A class that inherits from Drawable gains access to the Draw() function. This allows the user to execute code every draw frame.

Protected Member Functions

virtual void Draw ()
 Function which is called every draw frame. More...
 
virtual void Draw2D ()
 Function which is called every draw frame for 2D elements. More...
 
void Register ()
 Registers the class to be Drawn. More...
 
void Deregister ()
 Deregisters the class from being Drawn. More...
 
- Protected Member Functions inherited from GameObject
virtual void SceneEntry ()=0
 Function which is called upon a registered scene entry. More...
 
virtual void SceneExit ()=0
 Function which is called upon a registered scene exit. More...
 

Additional Inherited Members

- Public Member Functions inherited from GameObject
void SubmitEntry ()
 Public Function to register a call for the GameObject's SceneEntry() function. More...
 
void SubmitExit ()
 Public Function to register a call for the GameObject's SceneEntry() function. More...
 

Member Function Documentation

void Drawable::Deregister ( )
inlineprotected

Deregisters the class from being Drawn.

The DrawableManager keeps track of all Drawable GameObjects. Deregistering the current Drawable GameObject removes this object from the list of Drawables to be drawn by the DrawableManager.

virtual void Drawable::Draw ( )
inlineprotectedvirtual

Function which is called every draw frame.

This is a virtual function to be overriden by the user. The Draw() function will be called by the DrawableManager every draw frame as long as the current Drawable class is registered to be drawn (See the Register() and Deregister() functions).

virtual void Drawable::Draw2D ( )
inlineprotectedvirtual

Function which is called every draw frame for 2D elements.

This is a virtual function to be overriden by the user. The Draw2D() function will be called by the DrawableManager every draw frame as long as the current Drawable class is registered to be drawn (See the Register() and Deregister() functions). 2D elements are split from 3D elements to insure that the draw order is correct. Make SURE to use Draw2D when rendering 2D elements to the screen.

void Drawable::Register ( )
inlineprotected

Registers the class to be Drawn.

The DrawableManager keeps track of all Drawable GameObjects. Registering the current Drawable GameObject adds this object to the list of Drawables to be drawn by the DrawableManager.