comparison engine/core/controller/engine.i @ 654:5d6b1820b953

* Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes. * Added IEngineChangeListener so the client can update the cameras viewport if the screen mode has been changed. I chose to do it this way because the engine has no way to know which camera it should update. It will be up to the client to do it. * The cursor surface is now correctly freed when exiting. * Added DeviceCaps::getNearestScreenMode() for the client to request a supported screen mode. closes[t:315]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 21 Oct 2010 18:50:50 +0000
parents 01acc9fc35ea
children e3140f01749d
comparison
equal deleted inserted replaced
653:01acc9fc35ea 654:5d6b1820b953
39 class VFS; 39 class VFS;
40 class Cursor; 40 class Cursor;
41 class RendererBase; 41 class RendererBase;
42 class DeviceCaps; 42 class DeviceCaps;
43 class ScreenMode; 43 class ScreenMode;
44 class Image;
44 45
45 class EngineSettings { 46 class EngineSettings {
46 public: 47 public:
47 ~EngineSettings(); 48 ~EngineSettings();
48 void validate() const; 49 void validate() const;
83 84
84 private: 85 private:
85 EngineSettings(); 86 EngineSettings();
86 }; 87 };
87 88
89 %feature("director") IEngineChangeListener;
90 class IEngineChangeListener {
91 public:
92 virtual ~IEngineChangeListener() {}
93 virtual void onScreenModeChanged(const ScreenMode& newmode) = 0;
94 };
95
88 class Engine { 96 class Engine {
89 public: 97 public:
90 Engine(); 98 Engine();
91 virtual ~Engine(); 99 virtual ~Engine();
92 void initializePumping(); 100 void initializePumping();
93 void finalizePumping(); 101 void finalizePumping();
94 void pump(); 102 void pump();
95 103
96 EngineSettings& getSettings(); 104 EngineSettings& getSettings();
97 const DeviceCaps& getDeviceCaps() const; 105 const DeviceCaps& getDeviceCaps() const;
106
107 Image* changeScreenMode(const ScreenMode& mode);
98 108
99 void init(); 109 void init();
100 void destroy(); 110 void destroy();
101 111
102 SoundManager* getSoundManager(); 112 SoundManager* getSoundManager();
110 Model* getModel(); 120 Model* getModel();
111 LogManager* getLogManager(); 121 LogManager* getLogManager();
112 GuiFont* getDefaultFont(); 122 GuiFont* getDefaultFont();
113 VFS* getVFS(); 123 VFS* getVFS();
114 Cursor* getCursor(); 124 Cursor* getCursor();
125
126 void addChangeListener(IEngineChangeListener* listener);
127 void removeChangeListener(IEngineChangeListener* listener);
115 }; 128 };
116 } 129 }