2020-06-04 03:39:16 +00:00
|
|
|
#ifndef SCANTARGETWIDGET_H
|
|
|
|
#define SCANTARGETWIDGET_H
|
|
|
|
|
|
|
|
#include <QOpenGLWidget>
|
|
|
|
|
|
|
|
#include "../../Outputs/OpenGL/ScanTarget.hpp"
|
2020-06-14 23:26:56 +00:00
|
|
|
#include "../../ClockReceiver/VSyncPredictor.hpp"
|
2020-06-04 03:39:16 +00:00
|
|
|
|
|
|
|
class ScanTargetWidget : public QOpenGLWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScanTargetWidget(QWidget *parent = nullptr);
|
|
|
|
~ScanTargetWidget();
|
|
|
|
|
|
|
|
Outputs::Display::OpenGL::ScanTarget *getScanTarget();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void initializeGL() override;
|
|
|
|
void resizeGL(int w, int h) override;
|
|
|
|
void paintGL() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// This should be created only once there's an OpenGL context. So it
|
2020-06-14 23:26:56 +00:00
|
|
|
// can't be done at creation time.
|
2020-06-04 03:39:16 +00:00
|
|
|
std::unique_ptr<Outputs::Display::OpenGL::ScanTarget> scanTarget;
|
2020-06-14 23:26:56 +00:00
|
|
|
Time::VSyncPredictor vsync_predictor_;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void vsync();
|
2020-06-04 03:39:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SCANTARGETWIDGET_H
|