Loading...
Searching...
No Matches
OpenGL.hpp
1#pragma once
2
3#include <QString>
4#include <QStringList>
5#include <QSurfaceFormat>
6#if __has_include(<private/qshader_p.h>)
7#include <private/qshader_p.h>
8#endif
9
10#include <score_lib_base_export.h>
11
12namespace score
13{
28
32SCORE_LIB_BASE_TEST_EXPORT QString
33nvidiaKernelDriverVersion(const QString& procVersionText) noexcept;
34
37SCORE_LIB_BASE_TEST_EXPORT QString
38nvidiaGlxLibraryVersion(const QString& libraryPath) noexcept;
39
42SCORE_LIB_BASE_EXPORT NvidiaGlxVendorState nvidiaGlxVendorState(
43 const QString& kernelVersion, const QString& libraryVersion) noexcept;
44
50SCORE_LIB_BASE_EXPORT NvidiaGlxVendorState nvidiaGlxVendorState() noexcept;
51
52
67SCORE_LIB_BASE_EXPORT void setupDefaultOpenGLFormat() noexcept;
68
69struct SCORE_LIB_BASE_EXPORT GLCapabilities
70{
71public:
73
74 int major{};
75 int minor{};
76 int shaderVersion{};
77 QSurfaceFormat::RenderableType type{};
78
79#if __has_include(<private/qshader_p.h>)
80 QShaderVersion qShaderVersion;
81#endif
82
83 void setupFormat(QSurfaceFormat& fmt);
84};
85
86#if __has_include(<private/qshader_p.h>)
88SCORE_LIB_BASE_EXPORT QShaderVersion qShaderVersion(const QSurfaceFormat& fmt) noexcept;
89#endif
90
91// Unpinned, EGL hands back GLES and score's baked desktop GLSL matches nothing.
92SCORE_LIB_BASE_EXPORT void pinDefaultOpenGLFormat() noexcept;
93}
Base toolkit upon which the software is built.
Definition Application.cpp:83
NvidiaGlxVendorState
Whether the NVIDIA GLX vendor library can be asked to provide GL.
Definition OpenGL.hpp:16
@ VersionMismatch
Different releases: every GLX context creation fails with BadValue.
@ Consistent
Both halves agree.
@ NotInstalled
Kernel module loaded, no GLX vendor library.
@ Unknown
Versions unreadable; treated as usable.
@ NoDriver
No NVIDIA kernel module.
QString nvidiaKernelDriverVersion(const QString &procVersionText) noexcept
Definition OpenGL.cpp:29
QString nvidiaGlxLibraryVersion(const QString &libraryPath) noexcept
Definition OpenGL.cpp:43
NvidiaGlxVendorState nvidiaGlxVendorState() noexcept
Definition OpenGL.cpp:66
void setupDefaultOpenGLFormat() noexcept
Definition OpenGL.cpp:244
Definition OpenGL.hpp:70