blob: 70e08c609db55d0ea74fd1637b42900e1df01852 (
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
30
31
32
33
34
35
36
37
38
39
|
#pragma once
#include <mbgl/gl/attribute.hpp>
#include <array>
#include <cstdint>
namespace mbgl {
class RasterVertex {
public:
RasterVertex(int16_t x, int16_t y, uint16_t tx, uint16_t ty)
: a_pos {
x,
y
},
a_texture_pos {
tx,
ty
} {}
const int16_t a_pos[2];
const uint16_t a_texture_pos[2];
};
namespace gl {
template <class Shader>
struct AttributeBindings<Shader, RasterVertex> {
std::array<AttributeBinding, 2> operator()(const Shader& shader) {
return {{
MBGL_MAKE_ATTRIBUTE_BINDING(RasterVertex, shader, a_pos),
MBGL_MAKE_ATTRIBUTE_BINDING(RasterVertex, shader, a_texture_pos)
}};
};
};
} // namespace gl
} // namespace mbgl
|