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
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/util/geometry.hpp>
namespace mbgl {
namespace uniforms {
MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, dimension);
MBGL_DEFINE_UNIFORM_SCALAR(float, maxzoom);
} // namespace uniforms
class HillshadePrepareProgram : public Program<
HillshadePrepareProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::pos,
attributes::texture_pos>,
TypeList<
uniforms::matrix,
uniforms::dimension,
uniforms::zoom,
uniforms::maxzoom>,
TypeList<
textures::image>,
style::Properties<>> {
public:
using Program::Program;
static LayoutVertex layoutVertex(Point<int16_t> p, Point<uint16_t> t) {
return LayoutVertex {
{{
p.x,
p.y
}},
{{
t.x,
t.y
}}
};
}
};
using HillshadePrepareLayoutVertex = HillshadePrepareProgram::LayoutVertex;
using HillshadePrepareAttributes = HillshadePrepareProgram::AttributeList;
} // namespace mbgl
|