Provide dummy instances of Screen and Scene.
diff --git a/src/scene.h b/src/scene.h
index 882fe03..0cc9fbf 100644
--- a/src/scene.h
+++ b/src/scene.h
@@ -76,6 +76,12 @@
void reset_options();
const std::map<std::string, Option> &options() { return mOptions; }
+ static Scene &dummy()
+ {
+ static Scene dummy_scene(Screen::dummy(), "");
+ return dummy_scene;
+ }
+
protected:
Scene(Screen &pScreen, const std::string &name);
std::string construct_title(const std::string &title);
diff --git a/src/screen.h b/src/screen.h
index b267b2e..f8e0a8b 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -32,6 +32,8 @@
class Screen
{
public:
+ ~Screen() {}
+
int mWidth;
int mHeight;
int mBpp;
@@ -39,9 +41,18 @@
Matrix4f mProjection;
int mInitSuccess;
- virtual void clear() = 0;
- virtual void update() = 0;
- virtual void print_info() = 0;
+ virtual void clear() {}
+ virtual void update() {}
+ virtual void print_info() {}
+
+ static Screen &dummy()
+ {
+ static Screen dummy_screen;
+ return dummy_screen;
+ }
+
+protected:
+ Screen() {}
};
#endif