Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:12:17

0001 // Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QOPENGLTIMERQUERY_H
0005 #define QOPENGLTIMERQUERY_H
0006 
0007 #include <QtOpenGL/qtopenglglobal.h>
0008 
0009 #if !defined(QT_NO_OPENGL) && !QT_CONFIG(opengles2)
0010 
0011 #include <QtCore/QObject>
0012 #include <QtGui/qopengl.h>
0013 
0014 QT_BEGIN_NAMESPACE
0015 
0016 class QOpenGLTimerQueryPrivate;
0017 
0018 class Q_OPENGL_EXPORT QOpenGLTimerQuery : public QObject
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit QOpenGLTimerQuery(QObject *parent = nullptr);
0024     ~QOpenGLTimerQuery();
0025 
0026     bool create();
0027     void destroy();
0028     bool isCreated() const;
0029     GLuint objectId() const;
0030 
0031     void begin();
0032     void end();
0033     GLuint64 waitForTimestamp() const;
0034     void recordTimestamp();
0035     bool isResultAvailable() const;
0036     GLuint64 waitForResult() const;
0037 
0038 private:
0039     Q_DECLARE_PRIVATE(QOpenGLTimerQuery)
0040     Q_DISABLE_COPY(QOpenGLTimerQuery)
0041 };
0042 
0043 
0044 class QOpenGLTimeMonitorPrivate;
0045 
0046 class Q_OPENGL_EXPORT QOpenGLTimeMonitor : public QObject
0047 {
0048     Q_OBJECT
0049 
0050 public:
0051     explicit QOpenGLTimeMonitor(QObject *parent = nullptr);
0052     ~QOpenGLTimeMonitor();
0053 
0054     void setSampleCount(int sampleCount);
0055     int sampleCount() const;
0056 
0057     bool create();
0058     void destroy();
0059     bool isCreated() const;
0060     QList<GLuint> objectIds() const;
0061 
0062     int recordSample();
0063 
0064     bool isResultAvailable() const;
0065 
0066     QList<GLuint64> waitForSamples() const;
0067     QList<GLuint64> waitForIntervals() const;
0068 
0069     void reset();
0070 
0071 private:
0072     Q_DECLARE_PRIVATE(QOpenGLTimeMonitor)
0073     Q_DISABLE_COPY(QOpenGLTimeMonitor)
0074 };
0075 
0076 QT_END_NAMESPACE
0077 
0078 #endif // QT_NO_OPENGL
0079 
0080 #endif // QOPENGLTIMERQUERY_H