Changeset View
Changeset View
Standalone View
Standalone View
abstract_opengl_context_attribute_builder.h
Show All 13 Lines | |||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #pragma once | 20 | #pragma once | ||
21 | #include <QDebug> | 21 | #include <QDebug> | ||
22 | #include <kwin_export.h> | ||||
22 | 23 | | |||
23 | namespace KWin | 24 | namespace KWin | ||
24 | { | 25 | { | ||
25 | 26 | | |||
26 | class AbstractOpenGLContextAttributeBuilder | 27 | class KWIN_EXPORT AbstractOpenGLContextAttributeBuilder | ||
27 | { | 28 | { | ||
28 | public: | 29 | public: | ||
29 | virtual ~AbstractOpenGLContextAttributeBuilder() { | 30 | virtual ~AbstractOpenGLContextAttributeBuilder() { | ||
30 | } | 31 | } | ||
31 | 32 | | |||
32 | void setVersion(int major, int minor = 0) { | 33 | void setVersion(int major, int minor = 0) { | ||
33 | m_versionRequested = true; | 34 | m_versionRequested = true; | ||
34 | m_majorVersion = major; | 35 | m_majorVersion = major; | ||
Show All 15 Lines | |||||
50 | void setRobust(bool robust) { | 51 | void setRobust(bool robust) { | ||
51 | m_robust = robust; | 52 | m_robust = robust; | ||
52 | } | 53 | } | ||
53 | 54 | | |||
54 | bool isRobust() const { | 55 | bool isRobust() const { | ||
55 | return m_robust; | 56 | return m_robust; | ||
56 | } | 57 | } | ||
57 | 58 | | |||
59 | void setForwardCompatible(bool forward) { | ||||
60 | m_forwardCompatible = forward; | ||||
61 | } | ||||
62 | | ||||
63 | bool isForwardCompatible() const { | ||||
64 | return m_forwardCompatible; | ||||
65 | } | ||||
66 | | ||||
67 | void setCoreProfile(bool core) { | ||||
68 | m_coreProfile = core; | ||||
69 | if (m_coreProfile) { | ||||
70 | setCompatibilityProfile(false); | ||||
71 | } | ||||
72 | } | ||||
73 | | ||||
74 | bool isCoreProfile() const { | ||||
75 | return m_coreProfile; | ||||
76 | } | ||||
77 | | ||||
78 | void setCompatibilityProfile(bool compatibility) { | ||||
79 | m_compatibilityProfile = compatibility; | ||||
80 | if (m_compatibilityProfile) { | ||||
81 | setCoreProfile(false); | ||||
82 | } | ||||
83 | } | ||||
84 | | ||||
85 | bool isCompatibilityProfile() const { | ||||
86 | return m_compatibilityProfile; | ||||
87 | } | ||||
88 | | ||||
58 | virtual std::vector<int> build() const = 0; | 89 | virtual std::vector<int> build() const = 0; | ||
59 | 90 | | |||
60 | QDebug operator<<(QDebug dbg) const; | 91 | QDebug operator<<(QDebug dbg) const; | ||
61 | 92 | | |||
62 | private: | 93 | private: | ||
63 | bool m_versionRequested = false; | 94 | bool m_versionRequested = false; | ||
64 | int m_majorVersion = 0; | 95 | int m_majorVersion = 0; | ||
65 | int m_minorVersion = 0; | 96 | int m_minorVersion = 0; | ||
66 | bool m_robust = false; | 97 | bool m_robust = false; | ||
98 | bool m_forwardCompatible = false; | ||||
99 | bool m_coreProfile = false; | ||||
100 | bool m_compatibilityProfile = false; | ||||
67 | }; | 101 | }; | ||
68 | 102 | | |||
69 | inline QDebug operator<<(QDebug dbg, const AbstractOpenGLContextAttributeBuilder *attribs) | 103 | inline QDebug operator<<(QDebug dbg, const AbstractOpenGLContextAttributeBuilder *attribs) | ||
70 | { | 104 | { | ||
71 | return attribs->operator<<(dbg); | 105 | return attribs->operator<<(dbg); | ||
72 | } | 106 | } | ||
73 | 107 | | |||
74 | } | 108 | } |