2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef GLWIDGET_H
|
|
|
|
#define GLWIDGET_H
|
|
|
|
|
2014-06-20 09:58:34 +00:00
|
|
|
#include <QOpenGLWidget>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2022-01-24 15:38:02 +00:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QThread)
|
2014-06-20 09:58:34 +00:00
|
|
|
|
2022-01-24 15:38:02 +00:00
|
|
|
class Renderer;
|
2014-06-20 09:58:34 +00:00
|
|
|
|
|
|
|
class GLWidget : public QOpenGLWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-09-13 18:43:09 +00:00
|
|
|
explicit GLWidget(QWidget *parent = nullptr);
|
2014-06-20 09:58:34 +00:00
|
|
|
~GLWidget();
|
|
|
|
|
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void paintEvent(QPaintEvent *) override { }
|
2014-06-20 09:58:34 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void renderRequested();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void grabContext();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onAboutToCompose();
|
|
|
|
void onFrameSwapped();
|
|
|
|
void onAboutToResize();
|
|
|
|
void onResized();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QThread *m_thread;
|
|
|
|
Renderer *m_renderer;
|
|
|
|
};
|
|
|
|
|
2022-01-24 15:38:02 +00:00
|
|
|
#endif // GLWIDGET_H
|