Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 116 vs 117 for /trunk/Source Code/Managers/Headers/CameraManager.h

Diff revisions: vs.
  @@ -19,24 +19,28 @@
19 19 #define _CAMERA_MANAGER_H
20 20
21 21 #include "core.h"
22 + #include <boost/noncopyable.hpp>
22 23 #include "Rendering/Camera/Headers/Camera.h"
23 24
24 - DEFINE_SINGLETON(CameraManager)
25 + /// Multiple camera managers can be created if needed in the future
26 + /// No need for singletons here
27 + class CameraManager : private boost::noncopyable {
25 28 typedef unordered_map<std::string, Camera*> CameraPool;
26 29
27 30 public:
31 + CameraManager();
32 + ~CameraManager();
33 +
28 34 Camera* const getActiveCamera();
29 35 void setActiveCamera(const std::string& name);
30 36 void addNewCamera(const std::string& cameraName, Camera* const camera);
31 37
32 - private:
33 - CameraManager();
34 - ~CameraManager();
38 + void addCameraChangeListener(boost::function0<void> f) {_listeners.push_back(f);}
35 39
36 40 private:
37 41 Camera* _camera;
38 42 CameraPool _cameraPool;
39 -
40 - END_SINGLETON
43 + std::vector<boost::function0<void> > _listeners;
44 + };
41 45
42 46 #endif