Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 5, 2008, 9:50:26 PM (16 years ago)
Author:
rgrieder
Message:
  • getInstance is probably more suitable than getSingleton (as x3n has already done so in most of his classes) I changed it in Orxonox and GraphicsEngine. Maybe more to come.
  • Removed derivation from BaseObject in InputState (templates work well too, don't need a factory at all)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/input/InputManager.h

    r1645 r1653  
    102102        void setWindowExtents(const int width, const int height);
    103103
    104         SimpleInputState*   createSimpleInputState  (const std::string& name, int priority);
    105         ExtendedInputState* createExtendedInputState(const std::string& name, int priority);
    106         InputState*         createInputState(const std::string& type, const std::string &name, int priority);
     104        template <class T>
     105        T* createInputState(const std::string& name, int priority)
     106        {
     107            T* state = new T;
     108            if (_configureInputState(state, name, priority))
     109                return state;
     110            else
     111            {
     112                delete state;
     113                return 0;
     114            }
     115        }
     116
    107117        bool destroyState          (const std::string& name);
    108118        InputState* getState       (const std::string& name);
Note: See TracChangeset for help on using the changeset viewer.