summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/circle_shader.hpp
blob: 99f099800d6ceca8b89bfd4a3eb1d6780630e849 (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
#pragma once

#include <mbgl/gl/shader.hpp>
#include <mbgl/gl/uniform.hpp>
#include <mbgl/util/color.hpp>

namespace mbgl {

namespace gl {
template <class> class VertexBuffer;
} // namespace gl

class CircleVertex;

class CircleShader : public gl::Shader {
public:
    CircleShader(gl::Context&, Defines defines = None);

    void bind(const gl::VertexBuffer<CircleVertex>&,
              const int8_t* offset);

    gl::UniformMatrix<4>              u_matrix           = {"u_matrix",           *this};
    gl::Uniform<std::array<float, 2>> u_extrude_scale    = {"u_extrude_scale",    *this};
    gl::Uniform<float>                u_devicepixelratio = {"u_devicepixelratio", *this};
    gl::Uniform<Color>                u_color            = {"u_color",            *this};
    gl::Uniform<float>                u_radius           = {"u_radius",           *this};
    gl::Uniform<float>                u_blur             = {"u_blur",             *this};
    gl::Uniform<float>                u_opacity          = {"u_opacity",          *this};
    gl::Uniform<int32_t>              u_scale_with_map   = {"u_scale_with_map",   *this};
};

} // namespace mbgl