- nom
- IDrawable
Base interface class for grouping objects under a united front. More...
#include <IDrawable.hpp>
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. | |
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:
Definition at line 43 of file IDrawable.hpp.
|
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.
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.