summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/enum.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/enum.hpp')
-rw-r--r--src/mbgl/gl/enum.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/gl/enum.hpp b/src/mbgl/gl/enum.hpp
index aaed3a962b..6aa29efdb1 100644
--- a/src/mbgl/gl/enum.hpp
+++ b/src/mbgl/gl/enum.hpp
@@ -2,14 +2,19 @@
#include <mbgl/platform/gl_functions.hpp>
+#include <type_traits>
+
namespace mbgl {
namespace gl {
template <typename T>
class Enum {
public:
- static T from(const platform::GLint);
- static platform::GLenum to(T);
+ using InType = std::conditional_t<std::is_same<std::underlying_type_t<T>, bool>::value, platform::GLboolean, platform::GLint>;
+ using OutType = std::conditional_t<std::is_same<std::underlying_type_t<T>, bool>::value, platform::GLboolean, platform::GLenum>;
+
+ static T from(const InType);
+ static OutType to(T);
};
} // namespace gl