summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellowindow/hellowindow.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-03-22 16:36:36 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-03-23 15:13:02 +0100
commit3b015718b0d156bbedafd3f83f069ce5a360d5cb (patch)
tree307759c4ef951f9e52d3b887865a122aa5a7805a /examples/opengl/hellowindow/hellowindow.h
parenta956b7a9b7dc5329ac1466c21dc74d471e7ca6f1 (diff)
Move hellowindow and qopenglwindow to be a manual tests
Pick-to: 6.5 Change-Id: I8d1517ee57df9b2dee0486f47562b0754e9dcbad Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.h')
-rw-r--r--examples/opengl/hellowindow/hellowindow.h77
1 files changed, 0 insertions, 77 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
deleted file mode 100644
index 1e117ab2e05..00000000000
--- a/examples/opengl/hellowindow/hellowindow.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef HELLOWINDOW_H
-#define HELLOWINDOW_H
-
-#include <QWindow>
-
-#include <QColor>
-#include <QMutex>
-#include <QOpenGLShaderProgram>
-#include <QOpenGLBuffer>
-#include <QSharedPointer>
-#include <QTimer>
-
-class HelloWindow;
-
-class Renderer : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Renderer(const QSurfaceFormat &format, Renderer *share = nullptr,
- QScreen *screen = nullptr);
-
- QSurfaceFormat format() const { return m_format; }
-
-public slots:
- void render(HelloWindow *surface, qreal angle, const QColor &color);
-
-signals:
- void requestUpdate();
-
-private:
- void initialize();
-
- void createGeometry();
- void createBubbles(int number);
- void quad(qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4);
- void extrude(qreal x1, qreal y1, qreal x2, qreal y2);
-
- QList<QVector3D> vertices;
- QList<QVector3D> normals;
- int vertexAttr;
- int normalAttr;
- int matrixUniform;
- int colorUniform;
-
- bool m_initialized;
- QSurfaceFormat m_format;
- QOpenGLContext *m_context;
- QOpenGLShaderProgram *m_program;
- QOpenGLBuffer m_vbo;
- QColor m_backgroundColor;
-};
-
-class HelloWindow : public QWindow
-{
-public:
- explicit HelloWindow(const QSharedPointer<Renderer> &renderer, QScreen *screen = nullptr);
-
- QColor color() const;
- void updateColor();
-
-protected:
- bool event(QEvent *ev) override;
- void exposeEvent(QExposeEvent *event) override;
- void mousePressEvent(QMouseEvent *) override;
- void render();
-
-private:
- int m_colorIndex;
- QColor m_color;
- const QSharedPointer<Renderer> m_renderer;
-};
-
-#endif // HELLOWINDOW_H