diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2015-04-03 00:48:56 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2015-04-03 01:07:01 +0200 |
commit | 82cc9c0cf2cdb8de17233a2ea943a5247d5da305 (patch) | |
tree | af341aed11c15ac3ab54de6c62e56251c859d76f /src/menu/application.hpp | |
parent | 263ef7f8c7085b90f8d21e3dfc2598ed7340e73d (diff) | |
download | usdx-82cc9c0cf2cdb8de17233a2ea943a5247d5da305.tar.gz usdx-82cc9c0cf2cdb8de17233a2ea943a5247d5da305.tar.xz usdx-82cc9c0cf2cdb8de17233a2ea943a5247d5da305.zip |
menu/application: Remove singleton.
The singleton pattern should not be used in most cases, because it
behaves like global variables.
Diffstat (limited to '')
-rw-r--r-- | src/menu/application.hpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/menu/application.hpp b/src/menu/application.hpp index a47bd42a..6d1b2b44 100644 --- a/src/menu/application.hpp +++ b/src/menu/application.hpp @@ -28,6 +28,7 @@ #include <SDL/SDL.h> #include <SDL/SDL_framerate.h> #include <boost/thread/thread.hpp> +#include <boost/noncopyable.hpp> #include <log4cpp/Category.hh> #include <list> @@ -37,13 +38,12 @@ namespace usdx { - class Application : public Container + class Application : public Container, public boost::noncopyable { private: static log4cpp::Category& log; - static Application* instance; - Config* config; + static Config* config; SDL_Surface* display; FPSmanager* fps_manager; @@ -56,20 +56,17 @@ namespace usdx * This is the main loop. */ void main_loop(SDL_Surface* display); - boost::thread::id gl_thread; + static boost::thread::id gl_thread; boost::thread event_thread; void init_fps_manager(void); protected: - Application(Container* parent); public: + Application(void); virtual ~Application(); - static Application* get_instance(void); - static void free(void); - static Config* get_config(void); static bool is_gl_thread(void); |