From: Mikko Rasa Date: Sat, 26 Nov 2016 11:38:42 +0000 (+0200) Subject: Change the Resources reference in Root to non-const X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f8f2f18e886429b70325ff36989bb126de617716;p=libs%2Fgltk.git Change the Resources reference in Root to non-const It might be necessary to load textures on the fly. --- diff --git a/source/root.cpp b/source/root.cpp index e867fae..e9e62f6 100644 --- a/source/root.cpp +++ b/source/root.cpp @@ -13,7 +13,7 @@ namespace Msp { namespace GLtk { -Root::Root(const Resources &r, Graphics::Window &window): +Root::Root(Resources &r, Graphics::Window &window): resources(r), keyboard(new Input::Keyboard(window)), input_method(0), @@ -24,7 +24,7 @@ Root::Root(const Resources &r, Graphics::Window &window): init(&window); } -Root::Root(const Resources &r, Graphics::Window *window, Input::Keyboard *k, Input::Mouse *m, Input::Touchscreen *t): +Root::Root(Resources &r, Graphics::Window *window, Input::Keyboard *k, Input::Mouse *m, Input::Touchscreen *t): resources(r), keyboard(k), input_method(0), diff --git a/source/root.h b/source/root.h index aeb2b9b..5dbf7bb 100644 --- a/source/root.h +++ b/source/root.h @@ -29,7 +29,7 @@ public: sigc::signal signal_tooltip; private: - const Resources &resources; + Resources &resources; Input::Keyboard *keyboard; InputMethod *input_method; Input::Mouse *mouse; @@ -46,11 +46,11 @@ private: public: /** Creates a Root widget for a window. The geometry is set to match the window's size, and input devices are created automatically. */ - Root(const Resources &, Graphics::Window &); + Root(Resources &, Graphics::Window &); /** Creates a Root widget with custom input devices. If window is not null, it is used to set the widget's initial geometry. */ - Root(const Resources &, Graphics::Window *, Input::Keyboard *, Input::Mouse *, Input::Touchscreen * = 0); + Root(Resources &, Graphics::Window *, Input::Keyboard *, Input::Mouse *, Input::Touchscreen * = 0); private: void init(Graphics::Window *); public: @@ -58,7 +58,7 @@ public: virtual const char *get_class() const { return "root"; } - const Resources &get_resources() const { return resources; } + Resources &get_resources() const { return resources; } virtual unsigned get_width() const { return geom.w; } virtual unsigned get_height() const { return geom.h; }