summaryrefslogtreecommitdiff
path: root/include/mbgl/gl/gl_helper.hpp
blob: 4f3990a43460e62556fead36e64108335d1bc77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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