summaryrefslogtreecommitdiff
path: root/src/mbgl/gl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r--src/mbgl/gl/gl_config.cpp3
-rw-r--r--src/mbgl/gl/gl_config.hpp11
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mbgl/gl/gl_config.cpp b/src/mbgl/gl/gl_config.cpp
index 97d2f26f6c..9031c3d34f 100644
--- a/src/mbgl/gl/gl_config.cpp
+++ b/src/mbgl/gl/gl_config.cpp
@@ -20,7 +20,8 @@ const ClearColor::Type ClearColor::Default = { 0, 0, 0, 0 };
const ClearStencil::Type ClearStencil::Default = 0;
const Program::Type Program::Default = 0;
const LineWidth::Type LineWidth::Default = 1;
-const ActiveTexture::Type ActiveTexture::Default = GL_TEXTURE0;
+const ActiveTexture::Type ActiveTexture::Default = 0;
+const BindTexture::Type BindTexture::Default = 0;
#ifndef GL_ES_VERSION_2_0
const PixelZoom::Type PixelZoom::Default = { 1, 1 };
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