KWin
Loading...
Searching...
No Matches
abstract_opengl_context_attribute_builder.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10#include <QDebug>
11#include <kwin_export.h>
12
13namespace KWin
14{
15
17{
18public:
22
23 void setVersion(int major, int minor = 0)
24 {
25 m_versionRequested = true;
26 m_majorVersion = major;
27 m_minorVersion = minor;
28 }
29
30 bool isVersionRequested() const
31 {
32 return m_versionRequested;
33 }
34
35 int majorVersion() const
36 {
37 return m_majorVersion;
38 }
39
40 int minorVersion() const
41 {
42 return m_minorVersion;
43 }
44
45 void setRobust(bool robust)
46 {
47 m_robust = robust;
48 }
49
50 bool isRobust() const
51 {
52 return m_robust;
53 }
54
55 void setForwardCompatible(bool forward)
56 {
57 m_forwardCompatible = forward;
58 }
59
61 {
62 return m_forwardCompatible;
63 }
64
65 void setCoreProfile(bool core)
66 {
67 m_coreProfile = core;
68 if (m_coreProfile) {
69 setCompatibilityProfile(false);
70 }
71 }
72
73 bool isCoreProfile() const
74 {
75 return m_coreProfile;
76 }
77
78 void setCompatibilityProfile(bool compatibility)
79 {
80 m_compatibilityProfile = compatibility;
81 if (m_compatibilityProfile) {
82 setCoreProfile(false);
83 }
84 }
85
87 {
88 return m_compatibilityProfile;
89 }
90
92 {
93 m_resetOnVideoMemoryPurge = reset;
94 }
95
97 {
98 return m_resetOnVideoMemoryPurge;
99 }
100
101 void setHighPriority(bool highPriority)
102 {
103 m_highPriority = highPriority;
104 }
105
106 bool isHighPriority() const
107 {
108 return m_highPriority;
109 }
110
111 virtual std::vector<int> build() const = 0;
112
113 QDebug operator<<(QDebug dbg) const;
114
115private:
116 bool m_versionRequested = false;
117 int m_majorVersion = 0;
118 int m_minorVersion = 0;
119 bool m_robust = false;
120 bool m_forwardCompatible = false;
121 bool m_coreProfile = false;
122 bool m_compatibilityProfile = false;
123 bool m_resetOnVideoMemoryPurge = false;
124 bool m_highPriority = false;
125};
126
127inline QDebug operator<<(QDebug dbg, const AbstractOpenGLContextAttributeBuilder *attribs)
128{
129 return attribs->operator<<(dbg);
130}
131
132}
virtual std::vector< int > build() const =0
QDebug operator<<(QDebug s, const KWin::DrmObject *obj)
QDebug & operator<<(QDebug &s, const KWin::DrmConnector *obj)