summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/raster_attributes.hpp
blob: 88f01257545976b14ce85c0d347271782df4886c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <mbgl/shader/attributes.hpp>
#include <mbgl/util/geometry.hpp>

namespace mbgl {

struct RasterAttributes : gl::Attributes<
    attributes::a_pos,
    attributes::a_texture_pos>
{
    static Vertex vertex(Point<int16_t> p, Point<uint16_t> t) {
        return Vertex {
            {
                p.x,
                p.y
            },
            {
                t.x,
                t.y
            }
        };
    }
};

using RasterVertex = RasterAttributes::Vertex;
static_assert(sizeof(RasterVertex) == 8, "expected RasterVertex size");

} // namespace mbgl