#pragma once #include "geometry/point2d.hpp" #include "drape/color.hpp" #include #include #include #include #include #include #include #include namespace glsl { using glm::vec2; using glm::vec3; using glm::vec4; using glm::dvec2; using glm::dvec3; using glm::dvec4; using glm::mat3; using glm::mat4; using glm::mat4x2; using glm::mat4x3; using glm::dmat3; using glm::dmat4; using glm::dmat4x2; using glm::dmat4x3; typedef vec4 Quad1; typedef mat4x2 Quad2; typedef mat4x3 Quad3; typedef mat4 Quad4; inline m2::PointF ToPoint(vec2 const & v) { return m2::PointF(v.x, v.y); } inline vec2 ToVec2(m2::PointF const & pt) { return glsl::vec2(pt.x, pt.y); } inline vec2 ToVec2(m2::PointD const & pt) { return glsl::vec2(pt.x, pt.y); } inline vec4 ToVec4(dp::Color const & color) { return glsl::vec4(double(color.GetRed()) / 255, double(color.GetGreen()) / 255, double(color.GetBlue()) / 255, double(color.GetAlfa()) / 255); } template::value || is_floating_point::value>::type> inline uint8_t GetArithmeticComponentCount() { return 1; } template inline uint8_t GetComponentCount() { return GetArithmeticComponentCount(); } template <> inline uint8_t GetComponentCount() { return 2; } template <> inline uint8_t GetComponentCount() { return 3; } template <> inline uint8_t GetComponentCount() { return 4; } } // namespace glsl