Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopenglversionprofile.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENGLVERSIONPROFILE_H
5#define QOPENGLVERSIONPROFILE_H
6
7#include <QtOpenGL/qtopenglglobal.h>
8
9#include <QtGui/QSurfaceFormat>
10
11#include <QtCore/QPair>
12#include <QtCore/qhashfunctions.h>
13
15
17class QDebug;
18
19class Q_OPENGL_EXPORT QOpenGLVersionProfile
20{
21public:
26
27 QOpenGLVersionProfile &operator=(const QOpenGLVersionProfile &rhs);
28
29 QPair<int, int> version() const;
30 void setVersion(int majorVersion, int minorVersion);
31
34
35 bool hasProfiles() const;
36 bool isLegacyVersion() const;
37 bool isValid() const;
38
39private:
41
42 friend bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
43 {
44 if (lhs.profile() != rhs.profile())
45 return false;
46 return lhs.version() == rhs.version();
47 }
48
49 friend bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
50 {
51 return !operator==(lhs, rhs);
52 }
53};
54
55inline size_t qHash(const QOpenGLVersionProfile &v, size_t seed = 0) noexcept
56{
57 return qHash(static_cast<int>(v.profile() * 1000)
58 + v.version().first * 100 + v.version().second * 10, seed);
59}
60
61
62#ifndef QT_NO_DEBUG_STREAM
63Q_OPENGL_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp);
64#endif // !QT_NO_DEBUG_STREAM
65
67
68#endif // QOPENGLVERSIONPROFILE_H
\inmodule QtCore
QSurfaceFormat::OpenGLContextProfile profile() const
Returns the OpenGL profile.
friend bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
friend bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
QPair< int, int > version() const
Returns a QPair<int,int> where the components represent the major and minor OpenGL version numbers re...
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
OpenGLContextProfile
This enum is used to specify the OpenGL context profile, in conjunction with QSurfaceFormat::setMajor...
format setVersion(3, 2)
format setProfile(QSurfaceFormat::CoreProfile)
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLint GLsizei GLsizei GLenum format
size_t qHash(const QOpenGLVersionProfile &v, size_t seed=0) noexcept
Q_OPENGL_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
QSharedPointer< T > other(t)
[5]