Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/glxbackend.cpp
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 123 | { | |||
---|---|---|---|---|---|
148 | delete m_overlayWindow; | 148 | delete m_overlayWindow; | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | void GlxBackend::init() | 151 | void GlxBackend::init() | ||
152 | { | 152 | { | ||
153 | initGLX(); | 153 | initGLX(); | ||
154 | 154 | | |||
155 | // Require at least GLX 1.3 | 155 | // Require at least GLX 1.3 | ||
156 | if (!hasGLXVersion(1, 3)) { | 156 | if (!checkVersion()) { | ||
157 | setFailed(QStringLiteral("Requires at least GLX 1.3")); | 157 | setFailed(QStringLiteral("Requires at least GLX 1.3")); | ||
158 | return; | 158 | return; | ||
159 | } | 159 | } | ||
160 | 160 | | |||
161 | initVisualDepthHashTable(); | 161 | initVisualDepthHashTable(); | ||
162 | 162 | | |||
163 | if (!initBuffer()) { | 163 | if (!initBuffer()) { | ||
164 | setFailed(QStringLiteral("Could not initialize the buffer")); | 164 | setFailed(QStringLiteral("Could not initialize the buffer")); | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 237 | if (glPlatform->isVirtualBox()) { | |||
241 | glXQueryDrawable = NULL; | 241 | glXQueryDrawable = NULL; | ||
242 | } | 242 | } | ||
243 | 243 | | |||
244 | setIsDirectRendering(bool(glXIsDirect(display(), ctx))); | 244 | setIsDirectRendering(bool(glXIsDirect(display(), ctx))); | ||
245 | 245 | | |||
246 | qCDebug(KWIN_X11STANDALONE) << "Direct rendering:" << isDirectRendering(); | 246 | qCDebug(KWIN_X11STANDALONE) << "Direct rendering:" << isDirectRendering(); | ||
247 | } | 247 | } | ||
248 | 248 | | |||
249 | bool GlxBackend::checkVersion() | ||||
250 | { | ||||
251 | int major, minor; | ||||
252 | glXQueryVersion(display(), &major, &minor); | ||||
253 | return kVersionNumber(major, minor) >= kVersionNumber(1, 3); | ||||
broulik: Just fyi: QVersionNumber is public since Qt 5.6 | |||||
254 | } | ||||
255 | | ||||
249 | bool GlxBackend::initRenderingContext() | 256 | bool GlxBackend::initRenderingContext() | ||
250 | { | 257 | { | ||
251 | const bool direct = true; | 258 | const bool direct = true; | ||
252 | 259 | | |||
253 | // Use glXCreateContextAttribsARB() when it's available | 260 | // Use glXCreateContextAttribsARB() when it's available | ||
254 | if (hasGLExtension(QByteArrayLiteral("GLX_ARB_create_context"))) { | 261 | if (hasGLExtension(QByteArrayLiteral("GLX_ARB_create_context"))) { | ||
255 | const int attribs_31_core_robustness[] = { | 262 | const int attribs_31_core_robustness[] = { | ||
256 | GLX_CONTEXT_MAJOR_VERSION_ARB, 3, | 263 | GLX_CONTEXT_MAJOR_VERSION_ARB, 3, | ||
▲ Show 20 Lines • Show All 623 Lines • Show Last 20 Lines |
Just fyi: QVersionNumber is public since Qt 5.6