| 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 QGLXCONVENIENCE_H |
| 5 | #define QGLXCONVENIENCE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/qlist.h> |
| 19 | #include <QtGui/qsurfaceformat.h> |
| 20 | #include <QtCore/private/qglobal_p.h> |
| 21 | |
| 22 | #include <X11/Xlib.h> |
| 23 | #include <GL/glx.h> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | enum QGlxFlags |
| 28 | { |
| 29 | QGLX_SUPPORTS_SRGB = 0x01 |
| 30 | }; |
| 31 | |
| 32 | Q_GUI_EXPORT QList<int> qglx_buildSpec(const QSurfaceFormat &format, |
| 33 | int drawableBit = GLX_WINDOW_BIT, |
| 34 | int flags = 0); |
| 35 | |
| 36 | Q_GUI_EXPORT XVisualInfo *qglx_findVisualInfo(Display *display, int screen, |
| 37 | QSurfaceFormat *format, |
| 38 | int drawableBit = GLX_WINDOW_BIT, |
| 39 | int flags = 0); |
| 40 | |
| 41 | Q_GUI_EXPORT GLXFBConfig qglx_findConfig(Display *display, int screen, |
| 42 | QSurfaceFormat format, |
| 43 | bool highestPixelFormat = false, |
| 44 | int drawableBit = GLX_WINDOW_BIT, |
| 45 | int flags = 0); |
| 46 | |
| 47 | Q_GUI_EXPORT void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, |
| 48 | GLXFBConfig config, int flags = 0); |
| 49 | |
| 50 | Q_GUI_EXPORT void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, |
| 51 | XVisualInfo *visualInfo, int flags = 0); |
| 52 | |
| 53 | Q_GUI_EXPORT bool qglx_reduceFormat(QSurfaceFormat *format); |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif // QGLXCONVENIENCE_H |
| 58 | |