nomlib
Loading...
Searching...
No Matches
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 IDrawable self_type
typedef self_type * raw_ptr
 A type definition for a C pointer – raw pointer – to an IDrawable object.
typedef std::unique_ptr< self_type > unique_ptr
 A type definition for a C++11 std::unique_ptr to an IDrawable object.
typedef std::shared_ptr< self_type > shared_ptr
 A type definition for a C++11 std::shared_ptr to an IDrawable object.
typedef const RenderWindow RenderTarget
Public Types inherited from nom::IObject
typedef IObject self_type
typedef IObjectraw_ptr

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.
virtual ObjectTypeInfo type (void) const
 Re-implements the IObject::type method.
Public Member Functions inherited from nom::IObject
 IObject (void)
 Default constructor.
virtual ~IObject (void)
 Virtual destructor.
virtual bool is_type (const ObjectTypeInfo &rhs) const
 Compare this object type with another object's type.

Additional Inherited Members

Static Public Member Functions inherited from nom::IObject
template<typename Base, typename Derived>
static bool is_a (const Derived object)
 Compare two objects to determine if a derived class inherits from a base class object.
static void * operator new (nom::size_type mem)
static void operator delete (void *ptr)
Static Public Attributes inherited from nom::IObject
static uint64 total_alloc_bytes
static uint64 total_dealloc_bytes

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:

Definition at line 41 of file IDrawable.hpp.

Member Typedef Documentation

◆ raw_ptr

typedef self_type* nom::IDrawable::raw_ptr

A type definition for a C pointer – raw pointer – to an IDrawable object.

Definition at line 48 of file IDrawable.hpp.

◆ RenderTarget

Todo
Remove or relocate this definition to resolve coupling issue?

Definition at line 59 of file IDrawable.hpp.

◆ self_type

typedef IDrawable nom::IDrawable::self_type

Definition at line 44 of file IDrawable.hpp.

◆ shared_ptr

typedef std::shared_ptr<self_type> nom::IDrawable::shared_ptr

A type definition for a C++11 std::shared_ptr to an IDrawable object.

Definition at line 56 of file IDrawable.hpp.

◆ unique_ptr

typedef std::unique_ptr<self_type> nom::IDrawable::unique_ptr

A type definition for a C++11 std::unique_ptr to an IDrawable object.

Definition at line 52 of file IDrawable.hpp.

Constructor & Destructor Documentation

◆ IDrawable()

nom::IDrawable::IDrawable ( void )
inline

Do nothing at all default constructor.

Definition at line 62 of file IDrawable.hpp.

◆ ~IDrawable()

virtual nom::IDrawable::~IDrawable ( void )
inlinevirtual

Do nothing at all destructor.

Definition at line 68 of file IDrawable.hpp.

Member Function Documentation

◆ draw()

virtual void nom::IDrawable::draw ( RenderTarget & ) const
pure virtual

Render the object onto the primary video buffer – your visible screen.

Implemented in nom::FinalFantasyDecorator, nom::FinalFantasyFrame, nom::Gradient, nom::Line, nom::MinimalDecorator, nom::Point, nom::Rectangle, nom::Sprite, nom::SpriteBatch, and nom::Text.

◆ type()

virtual ObjectTypeInfo nom::IDrawable::type ( void ) const
inlinevirtual

Re-implements the IObject::type method.

Remarks
This uniquely identifies the object's type.

Reimplemented from nom::IObject.

Reimplemented in nom::Decorator, nom::FinalFantasyDecorator, nom::FinalFantasyFrame, nom::Gradient, nom::Line, nom::MinimalDecorator, nom::Rectangle, nom::Shape, nom::Sprite, nom::SpriteBatch, nom::Text, and nom::Transformable.

Definition at line 94 of file IDrawable.hpp.

◆ update()

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 i8deg.nosp@m.rees.nosp@m.@gmai.nosp@m.l.co.nosp@m.m @ 2013-10-03

Implemented in nom::FinalFantasyDecorator, nom::FinalFantasyFrame, nom::Gradient, nom::Line, nom::MinimalDecorator, nom::Point, nom::Rectangle, nom::Sprite, nom::SpriteBatch, and nom::Text.


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