blob: df988bb3373d16d8b152a02ddc9ce0b1a6117c03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <mbgl/shader/linesdf_shader.hpp>
#include <mbgl/shader/linesdf.vertex.hpp>
#include <mbgl/shader/linesdf.fragment.hpp>
#include <mbgl/platform/gl.hpp>
#include <cstdio>
using namespace mbgl;
LineSDFShader::LineSDFShader()
: Shader("line", shaders::linesdf::vertex, shaders::linesdf::fragment) {
a_data = MBGL_CHECK_ERROR(glGetAttribLocation(program, "a_data"));
}
void LineSDFShader::bind(GLbyte* offset) {
MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_pos));
MBGL_CHECK_ERROR(glVertexAttribPointer(a_pos, 2, GL_SHORT, false, 8, offset + 0));
MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data));
MBGL_CHECK_ERROR(glVertexAttribPointer(a_data, 4, GL_BYTE, false, 8, offset + 4));
}
|