diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 10:08:43 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 16:12:51 +0100 |
commit | ec42b2a5a409d767655a61228f951e1f37835d44 (patch) | |
tree | 6475348f95c7bacfe6257b631faf2c88a7065be8 /src/mbgl/gl/enum.cpp | |
parent | 458bb6551009dae199fa57df8461f0b1878d7d06 (diff) | |
download | qtlocation-mapboxgl-ec42b2a5a409d767655a61228f951e1f37835d44.tar.gz |
[core] move BufferUsage enum to gfx namespace
Diffstat (limited to 'src/mbgl/gl/enum.cpp')
-rw-r--r-- | src/mbgl/gl/enum.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mbgl/gl/enum.cpp b/src/mbgl/gl/enum.cpp index da536692d1..81561360e9 100644 --- a/src/mbgl/gl/enum.cpp +++ b/src/mbgl/gl/enum.cpp @@ -221,5 +221,25 @@ platform::GLenum Enum<gfx::CullFaceWindingType>::to(const gfx::CullFaceWindingTy return GL_INVALID_ENUM; } +template <> +gfx::BufferUsageType Enum<gfx::BufferUsageType>::from(const platform::GLint value) { + switch (value) { + case GL_STREAM_DRAW: return gfx::BufferUsageType::StreamDraw; + case GL_STATIC_DRAW: return gfx::BufferUsageType::StaticDraw; + case GL_DYNAMIC_DRAW: return gfx::BufferUsageType::DynamicDraw; + } + return {}; +} + +template <> +platform::GLenum Enum<gfx::BufferUsageType>::to(const gfx::BufferUsageType value) { + switch (value) { + case gfx::BufferUsageType::StreamDraw: return GL_STREAM_DRAW; + case gfx::BufferUsageType::StaticDraw: return GL_STATIC_DRAW; + case gfx::BufferUsageType::DynamicDraw: return GL_DYNAMIC_DRAW; + } + return GL_INVALID_ENUM; +} + } // namespace gl } // namespace mbgl |