diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-02-28 12:31:54 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-02-28 17:43:40 +0100 |
commit | 076a69e6f02e73ffcf4e3a65c025077a4298a6ae (patch) | |
tree | 0a11064acec035b62a9d51f8661341719f276ef8 /src/mbgl/gl/enum.cpp | |
parent | 864364083c204e27f3f7a42f004ab1d1c87561d4 (diff) | |
download | qtlocation-mapboxgl-upstream/gfx-refactor.tar.gz |
[core] move CullFaceMode to gfx namespaceupstream/gfx-refactor
Diffstat (limited to 'src/mbgl/gl/enum.cpp')
-rw-r--r-- | src/mbgl/gl/enum.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mbgl/gl/enum.cpp b/src/mbgl/gl/enum.cpp index ea47f2104f..da536692d1 100644 --- a/src/mbgl/gl/enum.cpp +++ b/src/mbgl/gl/enum.cpp @@ -183,5 +183,43 @@ platform::GLenum Enum<gfx::StencilOpType>::to(const gfx::StencilOpType value) { return GL_INVALID_ENUM; } +template <> +gfx::CullFaceSideType Enum<gfx::CullFaceSideType>::from(const platform::GLint value) { + switch (value) { + case GL_FRONT: return gfx::CullFaceSideType::Front; + case GL_BACK: return gfx::CullFaceSideType::Back; + case GL_FRONT_AND_BACK: return gfx::CullFaceSideType::FrontAndBack; + } + return {}; +} + +template <> +platform::GLenum Enum<gfx::CullFaceSideType>::to(const gfx::CullFaceSideType value) { + switch (value) { + case gfx::CullFaceSideType::Front: return GL_FRONT; + case gfx::CullFaceSideType::Back: return GL_BACK; + case gfx::CullFaceSideType::FrontAndBack: return GL_FRONT_AND_BACK; + } + return GL_INVALID_ENUM; +} + +template <> +gfx::CullFaceWindingType Enum<gfx::CullFaceWindingType>::from(const platform::GLint value) { + switch (value) { + case GL_CW: return gfx::CullFaceWindingType::Clockwise; + case GL_CCW: return gfx::CullFaceWindingType::CounterClockwise; + } + return {}; +} + +template <> +platform::GLenum Enum<gfx::CullFaceWindingType>::to(const gfx::CullFaceWindingType value) { + switch (value) { + case gfx::CullFaceWindingType::Clockwise: return GL_CW; + case gfx::CullFaceWindingType::CounterClockwise: return GL_CCW; + } + return GL_INVALID_ENUM; +} + } // namespace gl } // namespace mbgl |