summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/circle_shader.cpp
blob: 074f92d68b248b02dca81053667cae1d01fe13b4 (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/circle_shader.hpp>
#include <mbgl/shader/shaders.hpp>
#include <mbgl/platform/gl.hpp>

#include <cstdio>

using namespace mbgl;

CircleShader::CircleShader()
    : Shader(
        "circle",
        shaders[CIRCLE_SHADER].vertex,
        shaders[CIRCLE_SHADER].fragment
    ) {
    a_pos = MBGL_CHECK_ERROR(glGetAttribLocation(program, "a_pos"));
}

void CircleShader::bind(char *offset) {
    MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_pos));
    MBGL_CHECK_ERROR(glVertexAttribPointer(a_pos, 2, GL_SHORT, false, 4, offset));
}