summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-03-21 15:01:32 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-03-28 13:53:19 +0200
commit14bf47c296f7ef80c91366a30b8ec593898e1e9d (patch)
tree121502bac9556061cf0230af307022905c28f1e8 /src
parent68e032e505e23811aec1f6079995709b3d2b9700 (diff)
downloadqtlocation-mapboxgl-14bf47c296f7ef80c91366a30b8ec593898e1e9d.tar.gz
[glfw] Remove GL state restoration
We're doing all of this in our own context anyway, so no need to restore the state
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/gl/state.hpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/mbgl/gl/state.hpp b/src/mbgl/gl/state.hpp
index f3268229d1..17503cc043 100644
--- a/src/mbgl/gl/state.hpp
+++ b/src/mbgl/gl/state.hpp
@@ -66,34 +66,5 @@ private:
const std::tuple<Args...> params;
};
-// Helper struct that stores the current state and restores it upon destruction. You should not use
-// this code normally, except for debugging purposes.
-template <typename T, typename... Args>
-class PreserveState {
-public:
- PreserveState(Args&&... args)
- : params(std::forward_as_tuple(std::forward<Args>(args)...)),
- value(get(std::index_sequence_for<Args...>{})) {
- }
- ~PreserveState() {
- set(std::index_sequence_for<Args...>{});
- }
-
-private:
- template <std::size_t... I>
- typename T::Type get(std::index_sequence<I...>) {
- return T::Get(std::get<I>(params)...);
- }
-
- template <std::size_t... I>
- void set(std::index_sequence<I...>) {
- T::Set(value, std::get<I>(params)...);
- }
-
-private:
- const std::tuple<Args...> params;
- const typename T::Type value;
-};
-
} // namespace gl
} // namespace mbgl