1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00
CLK/OSBindings/Qt/scantargetwidget.h
Thomas Harte 79833deeaf With some attempt at vsync prediction, seeks to smooth audio/video output.
There's plenty more work to do here, but hopefully it takes the issue immediately off the table.
2020-06-14 19:26:56 -04:00

33 lines
770 B
C++

#ifndef SCANTARGETWIDGET_H
#define SCANTARGETWIDGET_H
#include <QOpenGLWidget>
#include "../../Outputs/OpenGL/ScanTarget.hpp"
#include "../../ClockReceiver/VSyncPredictor.hpp"
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
// can't be done at creation time.
std::unique_ptr<Outputs::Display::OpenGL::ScanTarget> scanTarget;
Time::VSyncPredictor vsync_predictor_;
private slots:
void vsync();
};
#endif // SCANTARGETWIDGET_H