23 // Note: We use the older QGLWidget instead of QOpenGLWidget as it is
24 // much faster (does not go through a separate offscreen rendering step).
26 // TODO: Consider if QOpenGLWindow could do what we want.
27 class GLWidget : public QGLWidget
32 GLWidget(QWidget *parent = 0);
35 void set_output(Mixer::Output output)
37 this->output = output;
42 // NOTE: Will make the white balance flicker for a frame.
43 void grab_white_balance(unsigned channel, unsigned x, unsigned y);
46 void initializeGL() override;
47 void resizeGL(int width, int height) override;
48 void paintGL() override;
49 void mousePressEvent(QMouseEvent *event) override;
53 void transition_names_updated(std::vector<std::string> transition_names);
54 void name_updated(Mixer::Output output, const std::string &name);
55 void color_updated(Mixer::Output output, const std::string &color);
58 void show_context_menu(const QPoint &pos);
61 void show_live_context_menu(const QPoint &pos);
62 void show_preview_context_menu(unsigned signal_num, const QPoint &pos);
65 GLuint vao, program_num;
66 GLuint position_vbo, texcoord_vbo;
67 movit::ResourcePool *resource_pool = nullptr;
68 int current_width = 1, current_height = 1;
69 bool should_grab = false;
70 unsigned grab_x, grab_y;
71 Mixer::Output grab_output; // Should nominally be the same as output.