diff options
Diffstat (limited to 'src/menu')
-rw-r--r-- | src/menu/application.cpp | 13 | ||||
-rw-r--r-- | src/menu/application.hpp | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp index 49581227..45f7af0e 100644 --- a/src/menu/application.cpp +++ b/src/menu/application.cpp @@ -38,16 +38,22 @@ namespace usdx Application* Application::instance = NULL; Application::Application(Container* parent) - : Container(parent), display(NULL), fps_manager(NULL), + : Container(parent), config(NULL), display(NULL), fps_manager(NULL), running(false), frames_per_second(50) { set_size(800, 600); log4cpp::PropertyConfigurator::configure("log4cpp.property"); + config = new Config(); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); } Application::~Application() { + if (config) { + delete config; + config = NULL; + } + if (fps_manager) { delete fps_manager; fps_manager = NULL; @@ -68,6 +74,11 @@ namespace usdx return instance; } + Config* Application::get_config(void) + { + return get_instance()->config; + } + void Application::main_loop(SDL_Surface* display) { SDL_Event event; diff --git a/src/menu/application.hpp b/src/menu/application.hpp index 02508eae..9e6ab5c5 100644 --- a/src/menu/application.hpp +++ b/src/menu/application.hpp @@ -32,6 +32,7 @@ #include "container.hpp" #include "frame.hpp" +#include "base/config.hpp" namespace usdx { @@ -41,6 +42,8 @@ namespace usdx static log4cpp::Category& log; static Application* instance; + Config* config; + SDL_Surface* display; FPSmanager* fps_manager; @@ -62,6 +65,7 @@ namespace usdx virtual ~Application(); static Application* get_instance(void); + static Config* get_config(void); void run(void); |