KWin
Loading...
Searching...
No Matches
x11_standalone_glx_context_attribute_builder.cpp
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*/
10#include <epoxy/glx.h>
11
12#ifndef GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV
13#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7
14#endif
15
16namespace KWin
17{
18
19std::vector<int> GlxContextAttributeBuilder::build() const
20{
21 std::vector<int> attribs;
22 if (isVersionRequested()) {
23 attribs.emplace_back(GLX_CONTEXT_MAJOR_VERSION_ARB);
24 attribs.emplace_back(majorVersion());
25 attribs.emplace_back(GLX_CONTEXT_MINOR_VERSION_ARB);
26 attribs.emplace_back(minorVersion());
27 }
28 if (isRobust()) {
29 attribs.emplace_back(GLX_CONTEXT_FLAGS_ARB);
30 attribs.emplace_back(GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB);
31 attribs.emplace_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB);
32 attribs.emplace_back(GLX_LOSE_CONTEXT_ON_RESET_ARB);
35 attribs.emplace_back(GL_TRUE);
36 }
37 }
38 attribs.emplace_back(0);
39 return attribs;
40}
41
42}