Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qopengltimerquery.h
Go to the documentation of this file.
1// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QOPENGLTIMERQUERY_H
6#define QOPENGLTIMERQUERY_H
7
8#include <QtOpenGL/qtopenglglobal.h>
9
10#if !defined(QT_NO_OPENGL) && !QT_CONFIG(opengles2)
11
12#include <QtCore/QObject>
13#include <QtGui/qopengl.h>
14
15QT_BEGIN_NAMESPACE
16
17class QOpenGLTimerQueryPrivate;
18
19class Q_OPENGL_EXPORT QOpenGLTimerQuery : public QObject
20{
21 Q_OBJECT
22
23public:
24 explicit QOpenGLTimerQuery(QObject *parent = nullptr);
25 ~QOpenGLTimerQuery();
26
27 bool create();
28 void destroy();
29 bool isCreated() const;
30 GLuint objectId() const;
31
32 void begin();
33 void end();
34 GLuint64 waitForTimestamp() const;
35 void recordTimestamp();
36 bool isResultAvailable() const;
37 GLuint64 waitForResult() const;
38
39private:
40 Q_DECLARE_PRIVATE(QOpenGLTimerQuery)
41 Q_DISABLE_COPY(QOpenGLTimerQuery)
42};
43
44
45class QOpenGLTimeMonitorPrivate;
46
47class Q_OPENGL_EXPORT QOpenGLTimeMonitor : public QObject
48{
49 Q_OBJECT
50
51public:
52 explicit QOpenGLTimeMonitor(QObject *parent = nullptr);
53 ~QOpenGLTimeMonitor();
54
55 void setSampleCount(int sampleCount);
56 int sampleCount() const;
57
58 bool create();
59 void destroy();
60 bool isCreated() const;
61 QList<GLuint> objectIds() const;
62
63 int recordSample();
64
65 bool isResultAvailable() const;
66
67 QList<GLuint64> waitForSamples() const;
68 QList<GLuint64> waitForIntervals() const;
69
70 void reset();
71
72private:
73 Q_DECLARE_PRIVATE(QOpenGLTimeMonitor)
74 Q_DISABLE_COPY(QOpenGLTimeMonitor)
75};
76
77QT_END_NAMESPACE
78
79#endif // QT_NO_OPENGL
80
81#endif // QOPENGLTIMERQUERY_H
QList< GLuint64 > intervals() const
QExtTimerQueryHelper * ext
QList< GLuint64 > samples() const
QOpenGLQueryHelper * core
QExtTimerQueryHelper * ext
#define GL_TIME_ELAPSED_EXT
#define GL_TIME_ELAPSED