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 setResetOnVideoMemoryPurge(bool reset) { | ||||
60 | m_resetOnVideoMemoryPurge = reset; | ||||
61 | } | ||||
62 | | ||||
63 | bool isResetOnVideoMemoryPurge() const { | ||||
64 | return m_resetOnVideoMemoryPurge; | ||||
65 | } | ||||
66 | | ||||
58 | virtual std::vector<int> build() const = 0; | 67 | virtual std::vector<int> build() const = 0; | ||
59 | 68 | | |||
60 | QDebug operator<<(QDebug dbg) const; | 69 | QDebug operator<<(QDebug dbg) const; | ||
61 | 70 | | |||
62 | private: | 71 | private: | ||
63 | bool m_versionRequested = false; | 72 | bool m_versionRequested = false; | ||
64 | int m_majorVersion = 0; | 73 | int m_majorVersion = 0; | ||
65 | int m_minorVersion = 0; | 74 | int m_minorVersion = 0; | ||
66 | bool m_robust = false; | 75 | bool m_robust = false; | ||
76 | bool m_resetOnVideoMemoryPurge = false; | ||||
67 | }; | 77 | }; | ||
68 | 78 | | |||
69 | inline QDebug operator<<(QDebug dbg, const AbstractOpenGLContextAttributeBuilder *attribs) | 79 | inline QDebug operator<<(QDebug dbg, const AbstractOpenGLContextAttributeBuilder *attribs) | ||
70 | { | 80 | { | ||
71 | return attribs->operator<<(dbg); | 81 | return attribs->operator<<(dbg); | ||
72 | } | 82 | } | ||
73 | 83 | | |||
74 | } | 84 | } |