Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 29, 2009, 10:27:10 PM (15 years ago)
Author:
rgrieder
Message:

Derived all singletons implemented in a usual manner from orxonox::Singleton<T>.
This resolves inconsistencies with the singletonPtr_s variable in case of exceptions (asserts were being triggered then).
And while at it replaced singletonRef_s with singletonPtr_s for it to be less misleading (as fabian has already pointed out).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/core/GraphicsManager.h

    r3346 r3366  
    4242#include <string>
    4343#include <OgreLog.h>
     44#include "util/Singleton.h"
    4445#include "OrxonoxClass.h"
    4546
     
    5051        Graphics engine manager class
    5152    */
    52     class _CoreExport GraphicsManager : public OrxonoxClass, public Ogre::LogListener
     53    class _CoreExport GraphicsManager : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
    5354    {
     55        friend class Singleton<GraphicsManager>;
    5456    public:
    5557        GraphicsManager();
     
    6668
    6769        void setCamera(Ogre::Camera* camera);
    68 
    69         inline static GraphicsManager& getInstance()
    70             { assert(singletonRef_s); return *singletonRef_s; }
    7170
    7271    private:
     
    107106        ConsoleCommand*     ccPrintScreen_;
    108107
    109         static GraphicsManager* singletonRef_s;        //!< Pointer to the Singleton
     108        static GraphicsManager* singletonPtr_s;        //!< Pointer to the Singleton
    110109    };
    111110}
Note: See TracChangeset for help on using the changeset viewer.