Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'drape/texture_types.hpp')
-rw-r--r--drape/texture_types.hpp41
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