Public Types | Public Member Functions | List of all members
nom::IDrawable Class Referenceabstract

Base interface class for grouping objects under a united front. More...

#include <IDrawable.hpp>

Inheritance diagram for nom::IDrawable:
[legend]

Public Types

typedef std::unique_ptr
< IDrawable > 
UniquePtr
 std::unique_ptr definition type for your convenience, sir!
 
typedef std::shared_ptr
< IDrawable > 
SharedPtr
 std::shared_ptr definition type at your leisure, sir!
 
typedef std::vector
< std::shared_ptr< IDrawable > > 
SharedDrawables
 Vector of std::shared_ptr definition type for the brotherhood, sir!
 
typedef std::vector
< std::unique_ptr< IDrawable > > 
UniqueDrawables
 std::unique_ptr vector container type
 
typedef const Window & RenderTarget
 

Public Member Functions

 IDrawable (void)
 Do nothing at all default constructor.
 
virtual ~IDrawable (void)
 Do nothing at all destructor.
 
virtual void update (void)=0
 
virtual void draw (RenderTarget) const =0
 Render the object onto the primary video buffer – your visible screen.
 

Detailed Description

Base interface class for grouping objects under a united front.

nom::IDrawable is a simple, small base interface class ("a pure abstract class") intended for bridging a reliable contract between two or more classes.

      [ADDITIONAL DESCRIPTION]

You may freely use this class both inside and outside of the library, with little worry of trouble arising. Sprite layering (think: groups) are the first use that comes to mind!

Usage example:

* #include <nomlib/graphics.hpp>
*
* [TODO]
*
*

Definition at line 43 of file IDrawable.hpp.

Member Function Documentation

virtual void nom::IDrawable::update ( void  )
pure virtual

Intended to be used internally by the class re-implementing this method; for use in preparing the buffer to be drawn using the draw method call. Whereas both Update & Draw are typically publicly exposed to the end-user, only the Draw method call should be expected of the end-user to be explicitly called.

Todo:
Not all the interfaced (inherited) IDrawable objects in this library conform to the expectations stated above. We need to first figure out if we wish to stay on this course (of expectation), or diverge all together. Undecided. Jeffrey Carpenter jeffr.nosp@m.ey.c.nosp@m.arp@g.nosp@m.mail.nosp@m..com @ 2013-10-03

Implemented in nom::BitmapFont, nom::TrueTypeFont, nom::Gradient, nom::ui::MessageBox, nom::Sprite, nom::Rectangle, nom::SpriteBatch, nom::Line, nom::ui::GrayFrame, and nom::Point.


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