From 704fd74d8d709f643d38266e1b484c16a441fb8b Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Fri, 3 Aug 2018 13:16:59 +0300 Subject: Removed glConst from render state and texture --- drape/texture_types.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 drape/texture_types.hpp (limited to 'drape/texture_types.hpp') 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 + +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 -- cgit v1.2.3