2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2014-02-02 21:29:38 +00:00
|
|
|
|
|
|
|
#ifndef QOPENGLTEXTUREBLITWINDOW_H
|
|
|
|
#define QOPENGLTEXTUREBLITWINDOW_H
|
|
|
|
|
|
|
|
#include <QtGui/QWindow>
|
|
|
|
#include <QtGui/QOpenGLContext>
|
2016-07-28 10:20:23 +00:00
|
|
|
#include <QtGui/QOpenGLTextureBlitter>
|
2014-02-02 21:29:38 +00:00
|
|
|
|
|
|
|
class QOpenGLTextureBlitWindow : public QWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QOpenGLTextureBlitWindow();
|
|
|
|
|
|
|
|
void render();
|
|
|
|
protected:
|
|
|
|
void exposeEvent(QExposeEvent *event);
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
qreal dWidth() const { return width() * devicePixelRatio(); }
|
|
|
|
qreal dHeight() const { return height() * devicePixelRatio(); }
|
|
|
|
|
|
|
|
QScopedPointer<QOpenGLContext> m_context;
|
|
|
|
QOpenGLTextureBlitter m_blitter;
|
|
|
|
QImage m_image;
|
2014-02-13 21:03:52 +00:00
|
|
|
QImage m_image_mirrord;
|
2014-02-02 21:29:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|