mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Switch to Qt-style member naming.
This commit is contained in:
parent
68d4d7d10a
commit
b052ca5ca2
@ -21,18 +21,18 @@ void ScanTargetWidget::initializeGL() {
|
|||||||
void ScanTargetWidget::paintGL() {
|
void ScanTargetWidget::paintGL() {
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
if(scanTarget) {
|
if(scanTarget) {
|
||||||
vsync_predictor_.begin_redraw();
|
vsyncPredictor.begin_redraw();
|
||||||
scanTarget->update(width(), height());
|
scanTarget->update(width(), height());
|
||||||
scanTarget->draw(width(), height());
|
scanTarget->draw(width(), height());
|
||||||
vsync_predictor_.end_redraw();
|
vsyncPredictor.end_redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanTargetWidget::vsync() {
|
void ScanTargetWidget::vsync() {
|
||||||
vsync_predictor_.announce_vsync();
|
vsyncPredictor.announce_vsync();
|
||||||
|
|
||||||
const auto time_now = Time::nanos_now();
|
const auto time_now = Time::nanos_now();
|
||||||
const auto delay_time = ((vsync_predictor_.suggested_draw_time() - time_now) / 1'000'000) - 5; // TODO: the extra 5 is a random guess.
|
const auto delay_time = ((vsyncPredictor.suggested_draw_time() - time_now) / 1'000'000) - 5; // TODO: the extra 5 is a random guess.
|
||||||
if(delay_time > 0) {
|
if(delay_time > 0) {
|
||||||
QTimer::singleShot(delay_time, this, SLOT(repaint()));
|
QTimer::singleShot(delay_time, this, SLOT(repaint()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,7 +23,7 @@ class ScanTargetWidget : public QOpenGLWidget
|
|||||||
// This should be created only once there's an OpenGL context. So it
|
// This should be created only once there's an OpenGL context. So it
|
||||||
// can't be done at creation time.
|
// can't be done at creation time.
|
||||||
std::unique_ptr<Outputs::Display::OpenGL::ScanTarget> scanTarget;
|
std::unique_ptr<Outputs::Display::OpenGL::ScanTarget> scanTarget;
|
||||||
Time::VSyncPredictor vsync_predictor_;
|
Time::VSyncPredictor vsyncPredictor;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void vsync();
|
void vsync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user