diff options
Diffstat (limited to 'src/mbgl/gl/gl_config.hpp')
-rw-r--r-- | src/mbgl/gl/gl_config.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mbgl/gl/gl_config.hpp b/src/mbgl/gl/gl_config.hpp index 9d7dfb3b6c..41bee8fab7 100644 --- a/src/mbgl/gl/gl_config.hpp +++ b/src/mbgl/gl/gl_config.hpp @@ -13,13 +13,17 @@ template <typename T> class Value { public: void operator=(const typename T::Type& value) { - if (dirty || current != value) { + if (*this != value) { dirty = false; current = value; T::Set(current); } } + bool operator!=(const typename T::Type& value) const { + return dirty || current != value; + } + void reset() { *this = T::Default; } @@ -28,11 +32,11 @@ public: dirty = true; } - typename T::Type getCurrent() { + typename T::Type getCurrent() const { return current; } - bool getDirty() { + bool getDirty() const { return dirty; } @@ -115,6 +119,7 @@ public: Value<PixelZoom> pixelZoom; Value<RasterPos> rasterPos; #endif // GL_ES_VERSION_2_0 + std::array<Value<BindTexture>, 2> texture; }; } // namespace gl |