* uses OSM Bright style * adds dot shader * adds layer translation * adds dashed line support * adds style array parsing * improves background layer parsing * improves style constant parsing * fixes sprite JSON pixel ratio parsing
46 lines
960 B
C++
46 lines
960 B
C++
#ifndef LLMR_SHADER_SHADER_LINE
|
|
#define LLMR_SHADER_SHADER_LINE
|
|
|
|
#include <llmr/shader/shader.hpp>
|
|
|
|
namespace llmr {
|
|
|
|
class LineShader : public Shader {
|
|
public:
|
|
LineShader();
|
|
|
|
void bind(char *offset);
|
|
|
|
void setExtrudeMatrix(const std::array<float, 16>& exmatrix);
|
|
void setColor(const std::array<float, 4>& color);
|
|
void setLineWidth(const std::array<float, 2>& linewidth);
|
|
void setRatio(float ratio);
|
|
void setDashArray(const std::array<float, 2>& dasharray);
|
|
void setDebug(float debug);
|
|
|
|
private:
|
|
int32_t a_pos = -1;
|
|
int32_t a_extrude = -1;
|
|
int32_t a_linesofar = -1;
|
|
|
|
std::array<float, 16> exmatrix = {{}};
|
|
int32_t u_exmatrix = -1;
|
|
|
|
std::array<float, 4> color = {{}};
|
|
int32_t u_color = -1;
|
|
|
|
std::array<float, 2> linewidth = {{}};
|
|
int32_t u_linewidth = -1;
|
|
|
|
float ratio = 0;
|
|
int32_t u_ratio = -1;
|
|
|
|
std::array<float, 2> dasharray = {{}};
|
|
int32_t u_dasharray = -1;
|
|
};
|
|
|
|
|
|
}
|
|
|
|
#endif
|