linepattern in progress
This commit is contained in:
committed by
John Firebaugh
parent
c1280f0b38
commit
71c31cee24
@@ -17,10 +17,11 @@ class LineVertexBuffer;
|
||||
class TriangleElementsBuffer;
|
||||
class LineShader;
|
||||
class LinejoinShader;
|
||||
class LinepatternShader;
|
||||
struct pbf;
|
||||
|
||||
class LineBucket : public Bucket {
|
||||
typedef ElementGroup<1> triangle_group_type;
|
||||
typedef ElementGroup<2> triangle_group_type;
|
||||
typedef ElementGroup<1> point_group_type;
|
||||
|
||||
public:
|
||||
@@ -38,6 +39,7 @@ public:
|
||||
bool hasPoints() const;
|
||||
|
||||
void drawLines(LineShader& shader);
|
||||
void drawLinePatterns(LinepatternShader& shader);
|
||||
void drawPoints(LinejoinShader& shader);
|
||||
|
||||
public:
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <mbgl/shader/pattern_shader.hpp>
|
||||
#include <mbgl/shader/line_shader.hpp>
|
||||
#include <mbgl/shader/linejoin_shader.hpp>
|
||||
#include <mbgl/shader/linepattern_shader.hpp>
|
||||
#include <mbgl/shader/icon_shader.hpp>
|
||||
#include <mbgl/shader/raster_shader.hpp>
|
||||
#include <mbgl/shader/text_shader.hpp>
|
||||
@@ -169,6 +170,7 @@ public:
|
||||
std::unique_ptr<OutlineShader> outlineShader;
|
||||
std::unique_ptr<LineShader> lineShader;
|
||||
std::unique_ptr<LinejoinShader> linejoinShader;
|
||||
std::unique_ptr<LinepatternShader> linepatternShader;
|
||||
std::unique_ptr<PatternShader> patternShader;
|
||||
std::unique_ptr<IconShader> iconShader;
|
||||
std::unique_ptr<RasterShader> rasterShader;
|
||||
|
||||
59
include/mbgl/shader/linepattern_shader.hpp
Normal file
59
include/mbgl/shader/linepattern_shader.hpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#ifndef MBGL_SHADER_SHADER_LINEPATTERN
|
||||
#define MBGL_SHADER_SHADER_LINEPATTERN
|
||||
|
||||
#include <mbgl/shader/shader.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class LinepatternShader : public Shader {
|
||||
public:
|
||||
LinepatternShader();
|
||||
|
||||
void bind(char *offset);
|
||||
|
||||
void setExtrudeMatrix(const std::array<float, 16>& exmatrix);
|
||||
void setLineWidth(const std::array<float, 2>& linewidth);
|
||||
void setRatio(float ratio);
|
||||
void setDebug(float debug);
|
||||
void setPatternSize(const std::array<float, 2>& new_pattern_size);
|
||||
void setPatternTopLeft(const std::array<float, 2>& new_pattern_tl);
|
||||
void setPatternBottomRight(const std::array<float, 2>& new_pattern_br);
|
||||
void setOffset(const std::array<float, 2>& offset);
|
||||
void setGamma(float new_gamma);
|
||||
void setFade(float new_fade);
|
||||
|
||||
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, 2> linewidth = {{}};
|
||||
int32_t u_linewidth = -1;
|
||||
|
||||
float ratio = 0;
|
||||
int32_t u_ratio = -1;
|
||||
|
||||
std::array<float, 2> pattern_size = {{}};
|
||||
int32_t u_pattern_size = -1;
|
||||
|
||||
std::array<float, 2> pattern_tl = {{}};
|
||||
int32_t u_pattern_tl = -1;
|
||||
|
||||
std::array<float, 2> pattern_br = {{}};
|
||||
int32_t u_pattern_br = -1;
|
||||
|
||||
std::array<float, 2> offset = {{}};
|
||||
int32_t u_offset = -1;
|
||||
|
||||
float gamma = 0.0f;
|
||||
int32_t u_gamma = -1;
|
||||
|
||||
float fade = 0;
|
||||
int32_t u_fade = -1;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user