void GLLinesShader::bindBuffers(QVector<QVector3D> verts)
{
    bindBufferData(positionBuf, verts);

    QVector<GLuint> indices;
    indices.clear();
    for (int i = 0; i < verts.size()-1; i++)
    {
        indices.append(i);
        indices.append(i+1);
    }

    bindBufferData(indexBuf, indices);

    numIndices = indices.size();
}
void SelectionRectangle::setEndPosition(int x, int y)
{
    endX = x;
    endY = y;
    bindCoordinates();
    bindBufferData();

}
void SelectionRectangle::setStartPosition(int x, int y)
{
    startX = x;
    startY = y;
    bindCoordinates();
    bindBufferData();

}
void SelectionRectangle::init(GLuint vaoHandle)
{
    this->vaoHandle = vaoHandle;


    shader = new Shader();
    shader->load(":/selectrect_vertex",
                 ":/selectrect_fragment");


    bindCoordinates();
    bindBufferData();


}