diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-08-03 13:16:59 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2018-08-06 14:09:53 +0300 |
commit | 704fd74d8d709f643d38266e1b484c16a441fb8b (patch) | |
tree | 09b594294973956482178ec173f27d899112ecd8 /drape/texture_types.hpp | |
parent | c43305029839d5c7c9ab2eeed370e56bd777cc41 (diff) |
Removed glConst from render state and texture
Diffstat (limited to 'drape/texture_types.hpp')
-rw-r--r-- | drape/texture_types.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drape/texture_types.hpp b/drape/texture_types.hpp new file mode 100644 index 0000000000..20b1cc8ad6 --- /dev/null +++ b/drape/texture_types.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "base/assert.hpp" + +#include <cstdint> + +namespace dp +{ +enum class TextureFormat : uint8_t +{ + RGBA8, + Alpha, + RedGreen, + Unspecified +}; + +enum class TextureFilter : uint8_t +{ + Nearest, + Linear +}; + +enum class TextureWrapping : uint8_t +{ + ClampToEdge, + Repeat +}; + +inline uint8_t GetBytesPerPixel(TextureFormat format) +{ + uint8_t result = 0; + switch (format) + { + case TextureFormat::RGBA8: result = 4; break; + case TextureFormat::Alpha: result = 1; break; + case TextureFormat::RedGreen: result = 2; break; + default: ASSERT(false, ()); break; + } + return result; +} +} // namespace dp |