1 // This file is part of Desktop App Toolkit,
2 // a set of libraries for developing nice desktop applications.
3 //
4 // For license and copyright information please follow this link:
5 // https://github.com/desktop-app/legal/blob/master/LEGAL
6 //
7 #pragma once
8 
9 #include "base/flags.h"
10 
11 class QOpenGLContext;
12 
13 namespace Ui::GL {
14 
15 enum class Backend {
16 	Raster,
17 	OpenGL,
18 };
19 
20 struct Capabilities {
21 	bool supported = false;
22 	bool transparency = false;
23 };
24 
25 [[nodiscard]] Capabilities CheckCapabilities(QWidget *widget = nullptr);
26 
27 void ForceDisable(bool disable);
28 
29 [[nodiscard]] bool LastCrashCheckFailed();
30 void CrashCheckFinish();
31 
32 // Windows only.
33 enum class ANGLE {
34 	Auto,
35 	D3D9,
36 	D3D11,
37 	D3D11on12,
38 	OpenGL,
39 };
40 
41 void ConfigureANGLE(); // Requires Ui::Integration being set.
42 void ChangeANGLE(ANGLE backend);
43 [[nodiscard]] ANGLE CurrentANGLE();
44 
45 [[nodiscard]] QList<QByteArray> EGLExtensions(
46 	not_null<QOpenGLContext*> context);
47 
48 } // namespace Ui::GL
49