Example #1
0
void VectorView::on_key_down(unsigned char key, int x, int y)
{
    switch (key)
    {
    case 'm':
        lines = !lines;
        refresh();
        break;

    case 'l':
        pmode = !pmode;
        refresh();
        break;

    case 'c':
        reset_view(true);
        refresh();
        break;

    case 'f':
        set_palette_filter(pal_filter != GL_LINEAR);
        break;

    case 'x':
        set_grid_type(!hexa);
        break;

    case 'b':
        mode++;
        if (mode > 2) mode = 0;
        refresh();
        break;

    case '*':
    case '/':
        if (key == '*') length_coef *= 1.1;
        else length_coef /= 1.1;
        refresh();
        break;

    default:
        View::on_key_down(key, x, y);
        break;
    }
}
Example #2
0
void View::on_create(int output_id)
{
  this->output_id = output_id; //does not need thread protection because it is during execution of add_view
  create_gl_palette();
  set_palette_filter(pal_filter == GL_LINEAR);
}