aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-04-29 10:48:28 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:48 +0100
commite4426f0019cbde1035011e30e740bdbfffafa5ee (patch)
treea5d2ef8855f3a0721dc5379ef34f3e9e2468514c /src/menu
parent486f69a6863f94d5e6ee2cd2bc3124e0863b070a (diff)
downloadusdx-e4426f0019cbde1035011e30e740bdbfffafa5ee.tar.gz
usdx-e4426f0019cbde1035011e30e740bdbfffafa5ee.tar.xz
usdx-e4426f0019cbde1035011e30e740bdbfffafa5ee.zip
added overlays
added list of drawable controls that are drawn over all frames
Diffstat (limited to 'src/menu')
-rw-r--r--src/menu/application.cpp18
-rw-r--r--src/menu/application.hpp5
2 files changed, 23 insertions, 0 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp
index 670e4c77..cc690b1c 100644
--- a/src/menu/application.cpp
+++ b/src/menu/application.cpp
@@ -45,6 +45,13 @@ namespace usdx
Application::~Application()
{
+ for (std::list<DrawableControl*>::iterator it =
+ overlays.begin(); it != overlays.end(); it++) {
+ delete *it;
+ }
+
+ overlays.clear();
+
if (fps_manager) {
delete fps_manager;
fps_manager = NULL;
@@ -72,6 +79,17 @@ namespace usdx
}
}
+ void Application::repaint(SDL_Surface* display) const {
+ DrawableControl::repaint(display);
+
+ for (std::list<DrawableControl*>::const_iterator it =
+ overlays.begin();
+ it != overlays.end(); it++) {
+
+ (*it)->repaint(display);
+ }
+ }
+
const Frame *Application::get_current_frame(void) const
{
return frame;
diff --git a/src/menu/application.hpp b/src/menu/application.hpp
index 99036d51..24d0b44f 100644
--- a/src/menu/application.hpp
+++ b/src/menu/application.hpp
@@ -30,6 +30,7 @@
#include <SDL/SDL.h>
#include <SDL/SDL_framerate.h>
#include <log4cxx/logger.h>
+#include <list>
#include "drawable_control.hpp"
#include "frame.hpp"
@@ -53,6 +54,8 @@ namespace usdx
int frames_per_second;
+ std::list<DrawableControl*> overlays;
+
/**
* This is the main loop.
*/
@@ -80,6 +83,8 @@ namespace usdx
const int get_frames_per_second(void) const;
void set_frames_per_second(int fps);
+
+ void repaint(SDL_Surface* display) const;
};
};