diff options
Diffstat (limited to 'include/mbgl/gl/gl_helper.hpp')
-rw-r--r-- | include/mbgl/gl/gl_helper.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/mbgl/gl/gl_helper.hpp b/include/mbgl/gl/gl_helper.hpp new file mode 100644 index 0000000000..4f3990a434 --- /dev/null +++ b/include/mbgl/gl/gl_helper.hpp @@ -0,0 +1,23 @@ +#ifndef MBGL_GL_GL_HELPER +#define MBGL_GL_GL_HELPER + +namespace mbgl { +namespace gl { + +template <typename T> +class Preserve { +public: + inline Preserve() : data(T::Get()) { + } + inline ~Preserve() { + T::Set(data); + } + +private: + const typename T::Type data; +}; + +} // namespace gl +} // namespace mbgl + +#endif |