1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2020 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the QtGui module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU Lesser General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | ** |
25 | ** GNU General Public License Usage |
26 | ** Alternatively, this file may be used under the terms of the GNU |
27 | ** General Public License version 2.0 or (at your option) the GNU General |
28 | ** Public license version 3 or any later version approved by the KDE Free |
29 | ** Qt Foundation. The licenses are as published by the Free Software |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | ** included in the packaging of this file. Please review the following |
32 | ** information to ensure the GNU General Public License requirements will |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | ** |
36 | ** $QT_END_LICENSE$ |
37 | ** |
38 | ****************************************************************************/ |
39 | |
40 | #include "qeglplatformcontext_p.h" |
41 | #include "qeglconvenience_p.h" |
42 | #include "qeglpbuffer_p.h" |
43 | #include <qpa/qplatformwindow.h> |
44 | #include <QtGui/qopenglcontext.h> |
45 | #include <QtCore/qdebug.h> |
46 | |
47 | #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) |
48 | #include <QtCore/private/qjnihelpers_p.h> |
49 | #endif |
50 | #ifndef Q_OS_WIN |
51 | #include <dlfcn.h> |
52 | #endif |
53 | |
54 | QT_BEGIN_NAMESPACE |
55 | |
56 | /*! |
57 | \class QEGLPlatformContext |
58 | \brief An EGL context implementation. |
59 | \since 5.2 |
60 | \internal |
61 | \ingroup qpa |
62 | |
63 | Implement QPlatformOpenGLContext using EGL. To use it in platform |
64 | plugins a subclass must be created since |
65 | eglSurfaceForPlatformSurface() has to be reimplemented. This |
66 | function is used for mapping platform surfaces (windows) to EGL |
67 | surfaces and is necessary since different platform plugins may |
68 | have different ways of handling native windows (for example, a |
69 | plugin may choose not to back every platform window by a real EGL |
70 | surface). Other than that, no further customization is necessary. |
71 | */ |
72 | |
73 | // Constants from EGL_KHR_create_context |
74 | #ifndef EGL_CONTEXT_MINOR_VERSION_KHR |
75 | #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB |
76 | #endif |
77 | #ifndef EGL_CONTEXT_FLAGS_KHR |
78 | #define EGL_CONTEXT_FLAGS_KHR 0x30FC |
79 | #endif |
80 | #ifndef EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR |
81 | #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD |
82 | #endif |
83 | #ifndef EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR |
84 | #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 |
85 | #endif |
86 | #ifndef EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR |
87 | #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 |
88 | #endif |
89 | #ifndef EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR |
90 | #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 |
91 | #endif |
92 | #ifndef EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR |
93 | #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 |
94 | #endif |
95 | |
96 | // Constants for OpenGL which are not available in the ES headers. |
97 | #ifndef GL_CONTEXT_FLAGS |
98 | #define GL_CONTEXT_FLAGS 0x821E |
99 | #endif |
100 | #ifndef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT |
101 | #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 |
102 | #endif |
103 | #ifndef GL_CONTEXT_FLAG_DEBUG_BIT |
104 | #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 |
105 | #endif |
106 | #ifndef GL_CONTEXT_PROFILE_MASK |
107 | #define GL_CONTEXT_PROFILE_MASK 0x9126 |
108 | #endif |
109 | #ifndef GL_CONTEXT_CORE_PROFILE_BIT |
110 | #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 |
111 | #endif |
112 | #ifndef GL_CONTEXT_COMPATIBILITY_PROFILE_BIT |
113 | #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 |
114 | #endif |
115 | |
116 | QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, |
117 | EGLConfig *config, Flags flags) |
118 | : m_eglDisplay(display) |
119 | , m_flags(flags) |
120 | , m_ownsContext(true) |
121 | { |
122 | m_eglConfig = config ? *config : q_configFromGLFormat(display, format); |
123 | |
124 | m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig, format); |
125 | // m_format now has the renderableType() resolved (it cannot be Default anymore) |
126 | // but does not yet contain version, profile, options. |
127 | m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : nullptr; |
128 | |
129 | QList<EGLint> contextAttrs; |
130 | contextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); |
131 | contextAttrs.append(format.majorVersion()); |
132 | const bool hasKHRCreateContext = q_hasEglExtension(m_eglDisplay, "EGL_KHR_create_context" ); |
133 | if (hasKHRCreateContext) { |
134 | contextAttrs.append(EGL_CONTEXT_MINOR_VERSION_KHR); |
135 | contextAttrs.append(format.minorVersion()); |
136 | int flags = 0; |
137 | // The debug bit is supported both for OpenGL and OpenGL ES. |
138 | if (format.testOption(QSurfaceFormat::DebugContext)) |
139 | flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; |
140 | // The fwdcompat bit is only for OpenGL 3.0+. |
141 | if (m_format.renderableType() == QSurfaceFormat::OpenGL |
142 | && format.majorVersion() >= 3 |
143 | && !format.testOption(QSurfaceFormat::DeprecatedFunctions)) |
144 | flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR; |
145 | if (flags) { |
146 | contextAttrs.append(EGL_CONTEXT_FLAGS_KHR); |
147 | contextAttrs.append(flags); |
148 | } |
149 | // Profiles are OpenGL only and mandatory in 3.2+. The value is silently ignored for < 3.2. |
150 | if (m_format.renderableType() == QSurfaceFormat::OpenGL) { |
151 | contextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR); |
152 | contextAttrs.append(format.profile() == QSurfaceFormat::CoreProfile |
153 | ? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR |
154 | : EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR); |
155 | } |
156 | } |
157 | |
158 | // Special Options for OpenVG surfaces |
159 | if (m_format.renderableType() == QSurfaceFormat::OpenVG) { |
160 | contextAttrs.append(EGL_ALPHA_MASK_SIZE); |
161 | contextAttrs.append(8); |
162 | } |
163 | |
164 | contextAttrs.append(EGL_NONE); |
165 | m_contextAttrs = contextAttrs; |
166 | |
167 | switch (m_format.renderableType()) { |
168 | case QSurfaceFormat::OpenVG: |
169 | m_api = EGL_OPENVG_API; |
170 | break; |
171 | #ifdef EGL_VERSION_1_4 |
172 | case QSurfaceFormat::OpenGL: |
173 | m_api = EGL_OPENGL_API; |
174 | break; |
175 | #endif // EGL_VERSION_1_4 |
176 | default: |
177 | m_api = EGL_OPENGL_ES_API; |
178 | break; |
179 | } |
180 | |
181 | eglBindAPI(m_api); |
182 | m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, m_shareContext, contextAttrs.constData()); |
183 | if (m_eglContext == EGL_NO_CONTEXT && m_shareContext != EGL_NO_CONTEXT) { |
184 | m_shareContext = nullptr; |
185 | m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, nullptr, contextAttrs.constData()); |
186 | } |
187 | |
188 | if (m_eglContext == EGL_NO_CONTEXT) { |
189 | qWarning("QEGLPlatformContext: Failed to create context: %x" , eglGetError()); |
190 | return; |
191 | } |
192 | |
193 | static const bool printConfig = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG" ); |
194 | if (printConfig) { |
195 | qDebug() << "Created context for format" << format << "with config:" ; |
196 | q_printEglConfig(m_eglDisplay, m_eglConfig); |
197 | } |
198 | |
199 | // Cannot just call updateFormatFromGL() since it relies on virtuals. Defer it to initialize(). |
200 | } |
201 | |
202 | void QEGLPlatformContext::adopt(EGLContext context, EGLDisplay display, QPlatformOpenGLContext *share) |
203 | { |
204 | Q_ASSERT(!m_ownsContext); |
205 | |
206 | m_eglDisplay = display; |
207 | |
208 | // Figure out the EGLConfig. |
209 | EGLint value = 0; |
210 | eglQueryContext(m_eglDisplay, context, EGL_CONFIG_ID, &value); |
211 | EGLint n = 0; |
212 | EGLConfig cfg; |
213 | const EGLint attribs[] = { EGL_CONFIG_ID, value, EGL_NONE }; |
214 | if (eglChooseConfig(m_eglDisplay, attribs, &cfg, 1, &n) && n == 1) { |
215 | m_eglConfig = cfg; |
216 | m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig); |
217 | } else { |
218 | qWarning("QEGLPlatformContext: Failed to get framebuffer configuration for context" ); |
219 | } |
220 | |
221 | // Fetch client API type. |
222 | value = 0; |
223 | eglQueryContext(m_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value); |
224 | if (value == EGL_OPENGL_API || value == EGL_OPENGL_ES_API) { |
225 | // if EGL config supports both OpenGL and OpenGL ES render type, |
226 | // q_glFormatFromConfig() with the default "referenceFormat" parameter |
227 | // will always figure it out as OpenGL render type. |
228 | // We can override it to match user's real render type. |
229 | if (value == EGL_OPENGL_ES_API) |
230 | m_format.setRenderableType(QSurfaceFormat::OpenGLES); |
231 | m_api = value; |
232 | eglBindAPI(m_api); |
233 | } else { |
234 | qWarning("QEGLPlatformContext: Failed to get client API type" ); |
235 | m_api = EGL_OPENGL_ES_API; |
236 | } |
237 | |
238 | m_eglContext = context; |
239 | m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : nullptr; |
240 | updateFormatFromGL(); |
241 | } |
242 | |
243 | void QEGLPlatformContext::initialize() |
244 | { |
245 | if (m_eglContext != EGL_NO_CONTEXT) |
246 | updateFormatFromGL(); |
247 | } |
248 | |
249 | // Base implementation for pbuffers. Subclasses will handle the specialized cases for |
250 | // platforms without pbuffers. |
251 | EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface() |
252 | { |
253 | // Make the context current to ensure the GL version query works. This needs a surface too. |
254 | const EGLint pbufferAttributes[] = { |
255 | EGL_WIDTH, 1, |
256 | EGL_HEIGHT, 1, |
257 | EGL_LARGEST_PBUFFER, EGL_FALSE, |
258 | EGL_NONE |
259 | }; |
260 | |
261 | // Cannot just pass m_eglConfig because it may not be suitable for pbuffers. Instead, |
262 | // do what QEGLPbuffer would do: request a config with the same attributes but with |
263 | // PBUFFER_BIT set. |
264 | EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT); |
265 | |
266 | return eglCreatePbufferSurface(m_eglDisplay, config, pbufferAttributes); |
267 | } |
268 | |
269 | void QEGLPlatformContext::destroyTemporaryOffscreenSurface(EGLSurface surface) |
270 | { |
271 | eglDestroySurface(m_eglDisplay, surface); |
272 | } |
273 | |
274 | void QEGLPlatformContext::runGLChecks() |
275 | { |
276 | // Nothing to do here, subclasses may override in order to perform OpenGL |
277 | // queries needing a context. |
278 | } |
279 | |
280 | void QEGLPlatformContext::updateFormatFromGL() |
281 | { |
282 | #ifndef QT_NO_OPENGL |
283 | // Have to save & restore to prevent QOpenGLContext::currentContext() from becoming |
284 | // inconsistent after QOpenGLContext::create(). |
285 | EGLDisplay prevDisplay = eglGetCurrentDisplay(); |
286 | if (prevDisplay == EGL_NO_DISPLAY) // when no context is current |
287 | prevDisplay = m_eglDisplay; |
288 | EGLContext prevContext = eglGetCurrentContext(); |
289 | EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW); |
290 | EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ); |
291 | |
292 | // Rely on the surfaceless extension, if available. This is beneficial since we can |
293 | // avoid creating an extra pbuffer surface which is apparently troublesome with some |
294 | // drivers (Mesa) when certain attributes are present (multisampling). |
295 | EGLSurface tempSurface = EGL_NO_SURFACE; |
296 | EGLContext tempContext = EGL_NO_CONTEXT; |
297 | if (m_flags.testFlag(NoSurfaceless) || !q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context" )) |
298 | tempSurface = createTemporaryOffscreenSurface(); |
299 | |
300 | EGLBoolean ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext); |
301 | if (!ok) { |
302 | EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT); |
303 | tempContext = eglCreateContext(m_eglDisplay, config, nullptr, m_contextAttrs.constData()); |
304 | if (tempContext != EGL_NO_CONTEXT) |
305 | ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, tempContext); |
306 | } |
307 | if (ok) { |
308 | if (m_format.renderableType() == QSurfaceFormat::OpenGL |
309 | || m_format.renderableType() == QSurfaceFormat::OpenGLES) { |
310 | const GLubyte *s = glGetString(GL_VERSION); |
311 | if (s) { |
312 | QByteArray version = QByteArray(reinterpret_cast<const char *>(s)); |
313 | int major, minor; |
314 | if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) { |
315 | m_format.setMajorVersion(major); |
316 | m_format.setMinorVersion(minor); |
317 | } |
318 | } |
319 | m_format.setProfile(QSurfaceFormat::NoProfile); |
320 | m_format.setOptions(QSurfaceFormat::FormatOptions()); |
321 | if (m_format.renderableType() == QSurfaceFormat::OpenGL) { |
322 | // Check profile and options. |
323 | if (m_format.majorVersion() < 3) { |
324 | m_format.setOption(QSurfaceFormat::DeprecatedFunctions); |
325 | } else { |
326 | GLint value = 0; |
327 | glGetIntegerv(GL_CONTEXT_FLAGS, &value); |
328 | if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) |
329 | m_format.setOption(QSurfaceFormat::DeprecatedFunctions); |
330 | if (value & GL_CONTEXT_FLAG_DEBUG_BIT) |
331 | m_format.setOption(QSurfaceFormat::DebugContext); |
332 | if (m_format.version() >= qMakePair(3, 2)) { |
333 | value = 0; |
334 | glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value); |
335 | if (value & GL_CONTEXT_CORE_PROFILE_BIT) |
336 | m_format.setProfile(QSurfaceFormat::CoreProfile); |
337 | else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) |
338 | m_format.setProfile(QSurfaceFormat::CompatibilityProfile); |
339 | } |
340 | } |
341 | } |
342 | } |
343 | runGLChecks(); |
344 | eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext); |
345 | } else { |
346 | qWarning("QEGLPlatformContext: Failed to make temporary surface current, format not updated (%x)" , eglGetError()); |
347 | } |
348 | if (tempSurface != EGL_NO_SURFACE) |
349 | destroyTemporaryOffscreenSurface(tempSurface); |
350 | if (tempContext != EGL_NO_CONTEXT) |
351 | eglDestroyContext(m_eglDisplay, tempContext); |
352 | #endif // QT_NO_OPENGL |
353 | } |
354 | |
355 | bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface) |
356 | { |
357 | Q_ASSERT(surface->surface()->supportsOpenGL()); |
358 | |
359 | eglBindAPI(m_api); |
360 | |
361 | EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface); |
362 | |
363 | // shortcut: on some GPUs, eglMakeCurrent is not a cheap operation |
364 | if (eglGetCurrentContext() == m_eglContext && |
365 | eglGetCurrentDisplay() == m_eglDisplay && |
366 | eglGetCurrentSurface(EGL_READ) == eglSurface && |
367 | eglGetCurrentSurface(EGL_DRAW) == eglSurface) { |
368 | return true; |
369 | } |
370 | |
371 | const bool ok = eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_eglContext); |
372 | if (ok) { |
373 | if (!m_swapIntervalEnvChecked) { |
374 | m_swapIntervalEnvChecked = true; |
375 | if (qEnvironmentVariableIsSet("QT_QPA_EGLFS_SWAPINTERVAL" )) { |
376 | QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL" ); |
377 | bool intervalOk; |
378 | const int swapInterval = swapIntervalString.toInt(&intervalOk); |
379 | if (intervalOk) |
380 | m_swapIntervalFromEnv = swapInterval; |
381 | } |
382 | } |
383 | const int requestedSwapInterval = m_swapIntervalFromEnv >= 0 |
384 | ? m_swapIntervalFromEnv |
385 | : surface->format().swapInterval(); |
386 | if (requestedSwapInterval >= 0 && m_swapInterval != requestedSwapInterval) { |
387 | m_swapInterval = requestedSwapInterval; |
388 | if (eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context |
389 | eglSwapInterval(eglDisplay(), m_swapInterval); |
390 | } |
391 | } else { |
392 | qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x" , eglGetError()); |
393 | } |
394 | |
395 | return ok; |
396 | } |
397 | |
398 | QEGLPlatformContext::~QEGLPlatformContext() |
399 | { |
400 | if (m_ownsContext && m_eglContext != EGL_NO_CONTEXT) |
401 | eglDestroyContext(m_eglDisplay, m_eglContext); |
402 | |
403 | m_eglContext = EGL_NO_CONTEXT; |
404 | } |
405 | |
406 | void QEGLPlatformContext::doneCurrent() |
407 | { |
408 | eglBindAPI(m_api); |
409 | bool ok = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
410 | if (!ok) |
411 | qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x" , eglGetError()); |
412 | } |
413 | |
414 | void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface) |
415 | { |
416 | eglBindAPI(m_api); |
417 | EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface); |
418 | if (eglSurface != EGL_NO_SURFACE) { // skip if using surfaceless context |
419 | bool ok = eglSwapBuffers(m_eglDisplay, eglSurface); |
420 | if (!ok) |
421 | qWarning("QEGLPlatformContext: eglSwapBuffers failed: %x" , eglGetError()); |
422 | } |
423 | } |
424 | |
425 | QFunctionPointer QEGLPlatformContext::getProcAddress(const char *procName) |
426 | { |
427 | eglBindAPI(m_api); |
428 | QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); |
429 | #if !defined(Q_OS_WIN) && !defined(Q_OS_INTEGRITY) |
430 | if (!proc) |
431 | proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); |
432 | #elif !defined(QT_OPENGL_DYNAMIC) |
433 | // On systems without KHR_get_all_proc_addresses and without |
434 | // dynamic linking there still has to be a way to access the |
435 | // standard GLES functions. QOpenGL(Extra)Functions never makes |
436 | // direct GL API calls since Qt 5.7, so all such workarounds are |
437 | // expected to be handled in the platform plugin. |
438 | if (!proc) { |
439 | static struct StdFunc { |
440 | const char *name; |
441 | QFunctionPointer func; |
442 | } standardFuncs[] = { |
443 | #if QT_CONFIG(opengles2) |
444 | { "glBindTexture" , (QFunctionPointer) ::glBindTexture }, |
445 | { "glBlendFunc" , (QFunctionPointer) ::glBlendFunc }, |
446 | { "glClear" , (QFunctionPointer) ::glClear }, |
447 | { "glClearColor" , (QFunctionPointer) ::glClearColor }, |
448 | { "glClearStencil" , (QFunctionPointer) ::glClearStencil }, |
449 | { "glColorMask" , (QFunctionPointer) ::glColorMask }, |
450 | { "glCopyTexImage2D" , (QFunctionPointer) ::glCopyTexImage2D }, |
451 | { "glCopyTexSubImage2D" , (QFunctionPointer) ::glCopyTexSubImage2D }, |
452 | { "glCullFace" , (QFunctionPointer) ::glCullFace }, |
453 | { "glDeleteTextures" , (QFunctionPointer) ::glDeleteTextures }, |
454 | { "glDepthFunc" , (QFunctionPointer) ::glDepthFunc }, |
455 | { "glDepthMask" , (QFunctionPointer) ::glDepthMask }, |
456 | { "glDisable" , (QFunctionPointer) ::glDisable }, |
457 | { "glDrawArrays" , (QFunctionPointer) ::glDrawArrays }, |
458 | { "glDrawElements" , (QFunctionPointer) ::glDrawElements }, |
459 | { "glEnable" , (QFunctionPointer) ::glEnable }, |
460 | { "glFinish" , (QFunctionPointer) ::glFinish }, |
461 | { "glFlush" , (QFunctionPointer) ::glFlush }, |
462 | { "glFrontFace" , (QFunctionPointer) ::glFrontFace }, |
463 | { "glGenTextures" , (QFunctionPointer) ::glGenTextures }, |
464 | { "glGetBooleanv" , (QFunctionPointer) ::glGetBooleanv }, |
465 | { "glGetError" , (QFunctionPointer) ::glGetError }, |
466 | { "glGetFloatv" , (QFunctionPointer) ::glGetFloatv }, |
467 | { "glGetIntegerv" , (QFunctionPointer) ::glGetIntegerv }, |
468 | { "glGetString" , (QFunctionPointer) ::glGetString }, |
469 | { "glGetTexParameterfv" , (QFunctionPointer) ::glGetTexParameterfv }, |
470 | { "glGetTexParameteriv" , (QFunctionPointer) ::glGetTexParameteriv }, |
471 | { "glHint" , (QFunctionPointer) ::glHint }, |
472 | { "glIsEnabled" , (QFunctionPointer) ::glIsEnabled }, |
473 | { "glIsTexture" , (QFunctionPointer) ::glIsTexture }, |
474 | { "glLineWidth" , (QFunctionPointer) ::glLineWidth }, |
475 | { "glPixelStorei" , (QFunctionPointer) ::glPixelStorei }, |
476 | { "glPolygonOffset" , (QFunctionPointer) ::glPolygonOffset }, |
477 | { "glReadPixels" , (QFunctionPointer) ::glReadPixels }, |
478 | { "glScissor" , (QFunctionPointer) ::glScissor }, |
479 | { "glStencilFunc" , (QFunctionPointer) ::glStencilFunc }, |
480 | { "glStencilMask" , (QFunctionPointer) ::glStencilMask }, |
481 | { "glStencilOp" , (QFunctionPointer) ::glStencilOp }, |
482 | { "glTexImage2D" , (QFunctionPointer) ::glTexImage2D }, |
483 | { "glTexParameterf" , (QFunctionPointer) ::glTexParameterf }, |
484 | { "glTexParameterfv" , (QFunctionPointer) ::glTexParameterfv }, |
485 | { "glTexParameteri" , (QFunctionPointer) ::glTexParameteri }, |
486 | { "glTexParameteriv" , (QFunctionPointer) ::glTexParameteriv }, |
487 | { "glTexSubImage2D" , (QFunctionPointer) ::glTexSubImage2D }, |
488 | { "glViewport" , (QFunctionPointer) ::glViewport }, |
489 | |
490 | { "glActiveTexture" , (QFunctionPointer) ::glActiveTexture }, |
491 | { "glAttachShader" , (QFunctionPointer) ::glAttachShader }, |
492 | { "glBindAttribLocation" , (QFunctionPointer) ::glBindAttribLocation }, |
493 | { "glBindBuffer" , (QFunctionPointer) ::glBindBuffer }, |
494 | { "glBindFramebuffer" , (QFunctionPointer) ::glBindFramebuffer }, |
495 | { "glBindRenderbuffer" , (QFunctionPointer) ::glBindRenderbuffer }, |
496 | { "glBlendColor" , (QFunctionPointer) ::glBlendColor }, |
497 | { "glBlendEquation" , (QFunctionPointer) ::glBlendEquation }, |
498 | { "glBlendEquationSeparate" , (QFunctionPointer) ::glBlendEquationSeparate }, |
499 | { "glBlendFuncSeparate" , (QFunctionPointer) ::glBlendFuncSeparate }, |
500 | { "glBufferData" , (QFunctionPointer) ::glBufferData }, |
501 | { "glBufferSubData" , (QFunctionPointer) ::glBufferSubData }, |
502 | { "glCheckFramebufferStatus" , (QFunctionPointer) ::glCheckFramebufferStatus }, |
503 | { "glCompileShader" , (QFunctionPointer) ::glCompileShader }, |
504 | { "glCompressedTexImage2D" , (QFunctionPointer) ::glCompressedTexImage2D }, |
505 | { "glCompressedTexSubImage2D" , (QFunctionPointer) ::glCompressedTexSubImage2D }, |
506 | { "glCreateProgram" , (QFunctionPointer) ::glCreateProgram }, |
507 | { "glCreateShader" , (QFunctionPointer) ::glCreateShader }, |
508 | { "glDeleteBuffers" , (QFunctionPointer) ::glDeleteBuffers }, |
509 | { "glDeleteFramebuffers" , (QFunctionPointer) ::glDeleteFramebuffers }, |
510 | { "glDeleteProgram" , (QFunctionPointer) ::glDeleteProgram }, |
511 | { "glDeleteRenderbuffers" , (QFunctionPointer) ::glDeleteRenderbuffers }, |
512 | { "glDeleteShader" , (QFunctionPointer) ::glDeleteShader }, |
513 | { "glDetachShader" , (QFunctionPointer) ::glDetachShader }, |
514 | { "glDisableVertexAttribArray" , (QFunctionPointer) ::glDisableVertexAttribArray }, |
515 | { "glEnableVertexAttribArray" , (QFunctionPointer) ::glEnableVertexAttribArray }, |
516 | { "glFramebufferRenderbuffer" , (QFunctionPointer) ::glFramebufferRenderbuffer }, |
517 | { "glFramebufferTexture2D" , (QFunctionPointer) ::glFramebufferTexture2D }, |
518 | { "glGenBuffers" , (QFunctionPointer) ::glGenBuffers }, |
519 | { "glGenerateMipmap" , (QFunctionPointer) ::glGenerateMipmap }, |
520 | { "glGenFramebuffers" , (QFunctionPointer) ::glGenFramebuffers }, |
521 | { "glGenRenderbuffers" , (QFunctionPointer) ::glGenRenderbuffers }, |
522 | { "glGetActiveAttrib" , (QFunctionPointer) ::glGetActiveAttrib }, |
523 | { "glGetActiveUniform" , (QFunctionPointer) ::glGetActiveUniform }, |
524 | { "glGetAttachedShaders" , (QFunctionPointer) ::glGetAttachedShaders }, |
525 | { "glGetAttribLocation" , (QFunctionPointer) ::glGetAttribLocation }, |
526 | { "glGetBufferParameteriv" , (QFunctionPointer) ::glGetBufferParameteriv }, |
527 | { "glGetFramebufferAttachmentParameteriv" , (QFunctionPointer) ::glGetFramebufferAttachmentParameteriv }, |
528 | { "glGetProgramiv" , (QFunctionPointer) ::glGetProgramiv }, |
529 | { "glGetProgramInfoLog" , (QFunctionPointer) ::glGetProgramInfoLog }, |
530 | { "glGetRenderbufferParameteriv" , (QFunctionPointer) ::glGetRenderbufferParameteriv }, |
531 | { "glGetShaderiv" , (QFunctionPointer) ::glGetShaderiv }, |
532 | { "glGetShaderInfoLog" , (QFunctionPointer) ::glGetShaderInfoLog }, |
533 | { "glGetShaderPrecisionFormat" , (QFunctionPointer) ::glGetShaderPrecisionFormat }, |
534 | { "glGetShaderSource" , (QFunctionPointer) ::glGetShaderSource }, |
535 | { "glGetUniformfv" , (QFunctionPointer) ::glGetUniformfv }, |
536 | { "glGetUniformiv" , (QFunctionPointer) ::glGetUniformiv }, |
537 | { "glGetUniformLocation" , (QFunctionPointer) ::glGetUniformLocation }, |
538 | { "glGetVertexAttribfv" , (QFunctionPointer) ::glGetVertexAttribfv }, |
539 | { "glGetVertexAttribiv" , (QFunctionPointer) ::glGetVertexAttribiv }, |
540 | { "glGetVertexAttribPointerv" , (QFunctionPointer) ::glGetVertexAttribPointerv }, |
541 | { "glIsBuffer" , (QFunctionPointer) ::glIsBuffer }, |
542 | { "glIsFramebuffer" , (QFunctionPointer) ::glIsFramebuffer }, |
543 | { "glIsProgram" , (QFunctionPointer) ::glIsProgram }, |
544 | { "glIsRenderbuffer" , (QFunctionPointer) ::glIsRenderbuffer }, |
545 | { "glIsShader" , (QFunctionPointer) ::glIsShader }, |
546 | { "glLinkProgram" , (QFunctionPointer) ::glLinkProgram }, |
547 | { "glReleaseShaderCompiler" , (QFunctionPointer) ::glReleaseShaderCompiler }, |
548 | { "glRenderbufferStorage" , (QFunctionPointer) ::glRenderbufferStorage }, |
549 | { "glSampleCoverage" , (QFunctionPointer) ::glSampleCoverage }, |
550 | { "glShaderBinary" , (QFunctionPointer) ::glShaderBinary }, |
551 | { "glShaderSource" , (QFunctionPointer) ::glShaderSource }, |
552 | { "glStencilFuncSeparate" , (QFunctionPointer) ::glStencilFuncSeparate }, |
553 | { "glStencilMaskSeparate" , (QFunctionPointer) ::glStencilMaskSeparate }, |
554 | { "glStencilOpSeparate" , (QFunctionPointer) ::glStencilOpSeparate }, |
555 | { "glUniform1f" , (QFunctionPointer) ::glUniform1f }, |
556 | { "glUniform1fv" , (QFunctionPointer) ::glUniform1fv }, |
557 | { "glUniform1i" , (QFunctionPointer) ::glUniform1i }, |
558 | { "glUniform1iv" , (QFunctionPointer) ::glUniform1iv }, |
559 | { "glUniform2f" , (QFunctionPointer) ::glUniform2f }, |
560 | { "glUniform2fv" , (QFunctionPointer) ::glUniform2fv }, |
561 | { "glUniform2i" , (QFunctionPointer) ::glUniform2i }, |
562 | { "glUniform2iv" , (QFunctionPointer) ::glUniform2iv }, |
563 | { "glUniform3f" , (QFunctionPointer) ::glUniform3f }, |
564 | { "glUniform3fv" , (QFunctionPointer) ::glUniform3fv }, |
565 | { "glUniform3i" , (QFunctionPointer) ::glUniform3i }, |
566 | { "glUniform3iv" , (QFunctionPointer) ::glUniform3iv }, |
567 | { "glUniform4f" , (QFunctionPointer) ::glUniform4f }, |
568 | { "glUniform4fv" , (QFunctionPointer) ::glUniform4fv }, |
569 | { "glUniform4i" , (QFunctionPointer) ::glUniform4i }, |
570 | { "glUniform4iv" , (QFunctionPointer) ::glUniform4iv }, |
571 | { "glUniformMatrix2fv" , (QFunctionPointer) ::glUniformMatrix2fv }, |
572 | { "glUniformMatrix3fv" , (QFunctionPointer) ::glUniformMatrix3fv }, |
573 | { "glUniformMatrix4fv" , (QFunctionPointer) ::glUniformMatrix4fv }, |
574 | { "glUseProgram" , (QFunctionPointer) ::glUseProgram }, |
575 | { "glValidateProgram" , (QFunctionPointer) ::glValidateProgram }, |
576 | { "glVertexAttrib1f" , (QFunctionPointer) ::glVertexAttrib1f }, |
577 | { "glVertexAttrib1fv" , (QFunctionPointer) ::glVertexAttrib1fv }, |
578 | { "glVertexAttrib2f" , (QFunctionPointer) ::glVertexAttrib2f }, |
579 | { "glVertexAttrib2fv" , (QFunctionPointer) ::glVertexAttrib2fv }, |
580 | { "glVertexAttrib3f" , (QFunctionPointer) ::glVertexAttrib3f }, |
581 | { "glVertexAttrib3fv" , (QFunctionPointer) ::glVertexAttrib3fv }, |
582 | { "glVertexAttrib4f" , (QFunctionPointer) ::glVertexAttrib4f }, |
583 | { "glVertexAttrib4fv" , (QFunctionPointer) ::glVertexAttrib4fv }, |
584 | { "glVertexAttribPointer" , (QFunctionPointer) ::glVertexAttribPointer }, |
585 | |
586 | { "glClearDepthf" , (QFunctionPointer) ::glClearDepthf }, |
587 | { "glDepthRangef" , (QFunctionPointer) ::glDepthRangef }, |
588 | #endif // QT_CONFIG(opengles2) |
589 | |
590 | #if QT_CONFIG(opengles3) |
591 | { "glBeginQuery" , (QFunctionPointer) ::glBeginQuery }, |
592 | { "glBeginTransformFeedback" , (QFunctionPointer) ::glBeginTransformFeedback }, |
593 | { "glBindBufferBase" , (QFunctionPointer) ::glBindBufferBase }, |
594 | { "glBindBufferRange" , (QFunctionPointer) ::glBindBufferRange }, |
595 | { "glBindSampler" , (QFunctionPointer) ::glBindSampler }, |
596 | { "glBindTransformFeedback" , (QFunctionPointer) ::glBindTransformFeedback }, |
597 | { "glBindVertexArray" , (QFunctionPointer) ::glBindVertexArray }, |
598 | { "glBlitFramebuffer" , (QFunctionPointer) ::glBlitFramebuffer }, |
599 | { "glClearBufferfi" , (QFunctionPointer) ::glClearBufferfi }, |
600 | { "glClearBufferfv" , (QFunctionPointer) ::glClearBufferfv }, |
601 | { "glClearBufferiv" , (QFunctionPointer) ::glClearBufferiv }, |
602 | { "glClearBufferuiv" , (QFunctionPointer) ::glClearBufferuiv }, |
603 | { "glClientWaitSync" , (QFunctionPointer) ::glClientWaitSync }, |
604 | { "glCompressedTexImage3D" , (QFunctionPointer) ::glCompressedTexImage3D }, |
605 | { "glCompressedTexSubImage3D" , (QFunctionPointer) ::glCompressedTexSubImage3D }, |
606 | { "glCopyBufferSubData" , (QFunctionPointer) ::glCopyBufferSubData }, |
607 | { "glCopyTexSubImage3D" , (QFunctionPointer) ::glCopyTexSubImage3D }, |
608 | { "glDeleteQueries" , (QFunctionPointer) ::glDeleteQueries }, |
609 | { "glDeleteSamplers" , (QFunctionPointer) ::glDeleteSamplers }, |
610 | { "glDeleteSync" , (QFunctionPointer) ::glDeleteSync }, |
611 | { "glDeleteTransformFeedbacks" , (QFunctionPointer) ::glDeleteTransformFeedbacks }, |
612 | { "glDeleteVertexArrays" , (QFunctionPointer) ::glDeleteVertexArrays }, |
613 | { "glDrawArraysInstanced" , (QFunctionPointer) ::glDrawArraysInstanced }, |
614 | { "glDrawBuffers" , (QFunctionPointer) ::glDrawBuffers }, |
615 | { "glDrawElementsInstanced" , (QFunctionPointer) ::glDrawElementsInstanced }, |
616 | { "glDrawRangeElements" , (QFunctionPointer) ::glDrawRangeElements }, |
617 | { "glEndQuery" , (QFunctionPointer) ::glEndQuery }, |
618 | { "glEndTransformFeedback" , (QFunctionPointer) ::glEndTransformFeedback }, |
619 | { "glFenceSync" , (QFunctionPointer) ::glFenceSync }, |
620 | { "glFlushMappedBufferRange" , (QFunctionPointer) ::glFlushMappedBufferRange }, |
621 | { "glFramebufferTextureLayer" , (QFunctionPointer) ::glFramebufferTextureLayer }, |
622 | { "glGenQueries" , (QFunctionPointer) ::glGenQueries }, |
623 | { "glGenSamplers" , (QFunctionPointer) ::glGenSamplers }, |
624 | { "glGenTransformFeedbacks" , (QFunctionPointer) ::glGenTransformFeedbacks }, |
625 | { "glGenVertexArrays" , (QFunctionPointer) ::glGenVertexArrays }, |
626 | { "glGetActiveUniformBlockName" , (QFunctionPointer) ::glGetActiveUniformBlockName }, |
627 | { "glGetActiveUniformBlockiv" , (QFunctionPointer) ::glGetActiveUniformBlockiv }, |
628 | { "glGetActiveUniformsiv" , (QFunctionPointer) ::glGetActiveUniformsiv }, |
629 | { "glGetBufferParameteri64v" , (QFunctionPointer) ::glGetBufferParameteri64v }, |
630 | { "glGetBufferPointerv" , (QFunctionPointer) ::glGetBufferPointerv }, |
631 | { "glGetFragDataLocation" , (QFunctionPointer) ::glGetFragDataLocation }, |
632 | { "glGetInteger64i_v" , (QFunctionPointer) ::glGetInteger64i_v }, |
633 | { "glGetInteger64v" , (QFunctionPointer) ::glGetInteger64v }, |
634 | { "glGetIntegeri_v" , (QFunctionPointer) ::glGetIntegeri_v }, |
635 | { "glGetInternalformativ" , (QFunctionPointer) ::glGetInternalformativ }, |
636 | { "glGetProgramBinary" , (QFunctionPointer) ::glGetProgramBinary }, |
637 | { "glGetQueryObjectuiv" , (QFunctionPointer) ::glGetQueryObjectuiv }, |
638 | { "glGetQueryiv" , (QFunctionPointer) ::glGetQueryiv }, |
639 | { "glGetSamplerParameterfv" , (QFunctionPointer) ::glGetSamplerParameterfv }, |
640 | { "glGetSamplerParameteriv" , (QFunctionPointer) ::glGetSamplerParameteriv }, |
641 | { "glGetStringi" , (QFunctionPointer) ::glGetStringi }, |
642 | { "glGetSynciv" , (QFunctionPointer) ::glGetSynciv }, |
643 | { "glGetTransformFeedbackVarying" , (QFunctionPointer) ::glGetTransformFeedbackVarying }, |
644 | { "glGetUniformBlockIndex" , (QFunctionPointer) ::glGetUniformBlockIndex }, |
645 | { "glGetUniformIndices" , (QFunctionPointer) ::glGetUniformIndices }, |
646 | { "glGetUniformuiv" , (QFunctionPointer) ::glGetUniformuiv }, |
647 | { "glGetVertexAttribIiv" , (QFunctionPointer) ::glGetVertexAttribIiv }, |
648 | { "glGetVertexAttribIuiv" , (QFunctionPointer) ::glGetVertexAttribIuiv }, |
649 | { "glInvalidateFramebuffer" , (QFunctionPointer) ::glInvalidateFramebuffer }, |
650 | { "glInvalidateSubFramebuffer" , (QFunctionPointer) ::glInvalidateSubFramebuffer }, |
651 | { "glIsQuery" , (QFunctionPointer) ::glIsQuery }, |
652 | { "glIsSampler" , (QFunctionPointer) ::glIsSampler }, |
653 | { "glIsSync" , (QFunctionPointer) ::glIsSync }, |
654 | { "glIsTransformFeedback" , (QFunctionPointer) ::glIsTransformFeedback }, |
655 | { "glIsVertexArray" , (QFunctionPointer) ::glIsVertexArray }, |
656 | { "glMapBufferRange" , (QFunctionPointer) ::glMapBufferRange }, |
657 | { "glPauseTransformFeedback" , (QFunctionPointer) ::glPauseTransformFeedback }, |
658 | { "glProgramBinary" , (QFunctionPointer) ::glProgramBinary }, |
659 | { "glProgramParameteri" , (QFunctionPointer) ::glProgramParameteri }, |
660 | { "glReadBuffer" , (QFunctionPointer) ::glReadBuffer }, |
661 | { "glRenderbufferStorageMultisample" , (QFunctionPointer) ::glRenderbufferStorageMultisample }, |
662 | { "glResumeTransformFeedback" , (QFunctionPointer) ::glResumeTransformFeedback }, |
663 | { "glSamplerParameterf" , (QFunctionPointer) ::glSamplerParameterf }, |
664 | { "glSamplerParameterfv" , (QFunctionPointer) ::glSamplerParameterfv }, |
665 | { "glSamplerParameteri" , (QFunctionPointer) ::glSamplerParameteri }, |
666 | { "glSamplerParameteriv" , (QFunctionPointer) ::glSamplerParameteriv }, |
667 | { "glTexImage3D" , (QFunctionPointer) ::glTexImage3D }, |
668 | { "glTexStorage2D" , (QFunctionPointer) ::glTexStorage2D }, |
669 | { "glTexStorage3D" , (QFunctionPointer) ::glTexStorage3D }, |
670 | { "glTexSubImage3D" , (QFunctionPointer) ::glTexSubImage3D }, |
671 | { "glTransformFeedbackVaryings" , (QFunctionPointer) ::glTransformFeedbackVaryings }, |
672 | { "glUniform1ui" , (QFunctionPointer) ::glUniform1ui }, |
673 | { "glUniform1uiv" , (QFunctionPointer) ::glUniform1uiv }, |
674 | { "glUniform2ui" , (QFunctionPointer) ::glUniform2ui }, |
675 | { "glUniform2uiv" , (QFunctionPointer) ::glUniform2uiv }, |
676 | { "glUniform3ui" , (QFunctionPointer) ::glUniform3ui }, |
677 | { "glUniform3uiv" , (QFunctionPointer) ::glUniform3uiv }, |
678 | { "glUniform4ui" , (QFunctionPointer) ::glUniform4ui }, |
679 | { "glUniform4uiv" , (QFunctionPointer) ::glUniform4uiv }, |
680 | { "glUniformBlockBinding" , (QFunctionPointer) ::glUniformBlockBinding }, |
681 | { "glUniformMatrix2x3fv" , (QFunctionPointer) ::glUniformMatrix2x3fv }, |
682 | { "glUniformMatrix2x4fv" , (QFunctionPointer) ::glUniformMatrix2x4fv }, |
683 | { "glUniformMatrix3x2fv" , (QFunctionPointer) ::glUniformMatrix3x2fv }, |
684 | { "glUniformMatrix3x4fv" , (QFunctionPointer) ::glUniformMatrix3x4fv }, |
685 | { "glUniformMatrix4x2fv" , (QFunctionPointer) ::glUniformMatrix4x2fv }, |
686 | { "glUniformMatrix4x3fv" , (QFunctionPointer) ::glUniformMatrix4x3fv }, |
687 | { "glUnmapBuffer" , (QFunctionPointer) ::glUnmapBuffer }, |
688 | { "glVertexAttribDivisor" , (QFunctionPointer) ::glVertexAttribDivisor }, |
689 | { "glVertexAttribI4i" , (QFunctionPointer) ::glVertexAttribI4i }, |
690 | { "glVertexAttribI4iv" , (QFunctionPointer) ::glVertexAttribI4iv }, |
691 | { "glVertexAttribI4ui" , (QFunctionPointer) ::glVertexAttribI4ui }, |
692 | { "glVertexAttribI4uiv" , (QFunctionPointer) ::glVertexAttribI4uiv }, |
693 | { "glVertexAttribIPointer" , (QFunctionPointer) ::glVertexAttribIPointer }, |
694 | { "glWaitSync" , (QFunctionPointer) ::glWaitSync }, |
695 | #endif // QT_CONFIG(opengles3) |
696 | |
697 | #if QT_CONFIG(opengles31) |
698 | { "glActiveShaderProgram" , (QFunctionPointer) ::glActiveShaderProgram }, |
699 | { "glBindImageTexture" , (QFunctionPointer) ::glBindImageTexture }, |
700 | { "glBindProgramPipeline" , (QFunctionPointer) ::glBindProgramPipeline }, |
701 | { "glBindVertexBuffer" , (QFunctionPointer) ::glBindVertexBuffer }, |
702 | { "glCreateShaderProgramv" , (QFunctionPointer) ::glCreateShaderProgramv }, |
703 | { "glDeleteProgramPipelines" , (QFunctionPointer) ::glDeleteProgramPipelines }, |
704 | { "glDispatchCompute" , (QFunctionPointer) ::glDispatchCompute }, |
705 | { "glDispatchComputeIndirect" , (QFunctionPointer) ::glDispatchComputeIndirect }, |
706 | { "glDrawArraysIndirect" , (QFunctionPointer) ::glDrawArraysIndirect }, |
707 | { "glDrawElementsIndirect" , (QFunctionPointer) ::glDrawElementsIndirect }, |
708 | { "glFramebufferParameteri" , (QFunctionPointer) ::glFramebufferParameteri }, |
709 | { "glGenProgramPipelines" , (QFunctionPointer) ::glGenProgramPipelines }, |
710 | { "glGetBooleani_v" , (QFunctionPointer) ::glGetBooleani_v }, |
711 | { "glGetFramebufferParameteriv" , (QFunctionPointer) ::glGetFramebufferParameteriv }, |
712 | { "glGetMultisamplefv" , (QFunctionPointer) ::glGetMultisamplefv }, |
713 | { "glGetProgramInterfaceiv" , (QFunctionPointer) ::glGetProgramInterfaceiv }, |
714 | { "glGetProgramPipelineInfoLog" , (QFunctionPointer) ::glGetProgramPipelineInfoLog }, |
715 | { "glGetProgramPipelineiv" , (QFunctionPointer) ::glGetProgramPipelineiv }, |
716 | { "glGetProgramResourceIndex" , (QFunctionPointer) ::glGetProgramResourceIndex }, |
717 | { "glGetProgramResourceLocation" , (QFunctionPointer) ::glGetProgramResourceLocation }, |
718 | { "glGetProgramResourceName" , (QFunctionPointer) ::glGetProgramResourceName }, |
719 | { "glGetProgramResourceiv" , (QFunctionPointer) ::glGetProgramResourceiv }, |
720 | { "glGetTexLevelParameterfv" , (QFunctionPointer) ::glGetTexLevelParameterfv }, |
721 | { "glGetTexLevelParameteriv" , (QFunctionPointer) ::glGetTexLevelParameteriv }, |
722 | { "glIsProgramPipeline" , (QFunctionPointer) ::glIsProgramPipeline }, |
723 | { "glMemoryBarrier" , (QFunctionPointer) ::glMemoryBarrier }, |
724 | { "glMemoryBarrierByRegion" , (QFunctionPointer) ::glMemoryBarrierByRegion }, |
725 | { "glProgramUniform1f" , (QFunctionPointer) ::glProgramUniform1f }, |
726 | { "glProgramUniform1fv" , (QFunctionPointer) ::glProgramUniform1fv }, |
727 | { "glProgramUniform1i" , (QFunctionPointer) ::glProgramUniform1i }, |
728 | { "glProgramUniform1iv" , (QFunctionPointer) ::glProgramUniform1iv }, |
729 | { "glProgramUniform1ui" , (QFunctionPointer) ::glProgramUniform1ui }, |
730 | { "glProgramUniform1uiv" , (QFunctionPointer) ::glProgramUniform1uiv }, |
731 | { "glProgramUniform2f" , (QFunctionPointer) ::glProgramUniform2f }, |
732 | { "glProgramUniform2fv" , (QFunctionPointer) ::glProgramUniform2fv }, |
733 | { "glProgramUniform2i" , (QFunctionPointer) ::glProgramUniform2i }, |
734 | { "glProgramUniform2iv" , (QFunctionPointer) ::glProgramUniform2iv }, |
735 | { "glProgramUniform2ui" , (QFunctionPointer) ::glProgramUniform2ui }, |
736 | { "glProgramUniform2uiv" , (QFunctionPointer) ::glProgramUniform2uiv }, |
737 | { "glProgramUniform3f" , (QFunctionPointer) ::glProgramUniform3f }, |
738 | { "glProgramUniform3fv" , (QFunctionPointer) ::glProgramUniform3fv }, |
739 | { "glProgramUniform3i" , (QFunctionPointer) ::glProgramUniform3i }, |
740 | { "glProgramUniform3iv" , (QFunctionPointer) ::glProgramUniform3iv }, |
741 | { "glProgramUniform3ui" , (QFunctionPointer) ::glProgramUniform3ui }, |
742 | { "glProgramUniform3uiv" , (QFunctionPointer) ::glProgramUniform3uiv }, |
743 | { "glProgramUniform4f" , (QFunctionPointer) ::glProgramUniform4f }, |
744 | { "glProgramUniform4fv" , (QFunctionPointer) ::glProgramUniform4fv }, |
745 | { "glProgramUniform4i" , (QFunctionPointer) ::glProgramUniform4i }, |
746 | { "glProgramUniform4iv" , (QFunctionPointer) ::glProgramUniform4iv }, |
747 | { "glProgramUniform4ui" , (QFunctionPointer) ::glProgramUniform4ui }, |
748 | { "glProgramUniform4uiv" , (QFunctionPointer) ::glProgramUniform4uiv }, |
749 | { "glProgramUniformMatrix2fv" , (QFunctionPointer) ::glProgramUniformMatrix2fv }, |
750 | { "glProgramUniformMatrix2x3fv" , (QFunctionPointer) ::glProgramUniformMatrix2x3fv }, |
751 | { "glProgramUniformMatrix2x4fv" , (QFunctionPointer) ::glProgramUniformMatrix2x4fv }, |
752 | { "glProgramUniformMatrix3fv" , (QFunctionPointer) ::glProgramUniformMatrix3fv }, |
753 | { "glProgramUniformMatrix3x2fv" , (QFunctionPointer) ::glProgramUniformMatrix3x2fv }, |
754 | { "glProgramUniformMatrix3x4fv" , (QFunctionPointer) ::glProgramUniformMatrix3x4fv }, |
755 | { "glProgramUniformMatrix4fv" , (QFunctionPointer) ::glProgramUniformMatrix4fv }, |
756 | { "glProgramUniformMatrix4x2fv" , (QFunctionPointer) ::glProgramUniformMatrix4x2fv }, |
757 | { "glProgramUniformMatrix4x3fv" , (QFunctionPointer) ::glProgramUniformMatrix4x3fv }, |
758 | { "glSampleMaski" , (QFunctionPointer) ::glSampleMaski }, |
759 | { "glTexStorage2DMultisample" , (QFunctionPointer) ::glTexStorage2DMultisample }, |
760 | { "glUseProgramStages" , (QFunctionPointer) ::glUseProgramStages }, |
761 | { "glValidateProgramPipeline" , (QFunctionPointer) ::glValidateProgramPipeline }, |
762 | { "glVertexAttribBinding" , (QFunctionPointer) ::glVertexAttribBinding }, |
763 | { "glVertexAttribFormat" , (QFunctionPointer) ::glVertexAttribFormat }, |
764 | { "glVertexAttribIFormat" , (QFunctionPointer) ::glVertexAttribIFormat }, |
765 | { "glVertexBindingDivisor" , (QFunctionPointer) ::glVertexBindingDivisor }, |
766 | #endif // QT_CONFIG(opengles31) |
767 | |
768 | #if QT_CONFIG(opengles32) |
769 | { "glBlendBarrier" , (QFunctionPointer) ::glBlendBarrier }, |
770 | { "glCopyImageSubData" , (QFunctionPointer) ::glCopyImageSubData }, |
771 | { "glDebugMessageControl" , (QFunctionPointer) ::glDebugMessageControl }, |
772 | { "glDebugMessageInsert" , (QFunctionPointer) ::glDebugMessageInsert }, |
773 | { "glDebugMessageCallback" , (QFunctionPointer) ::glDebugMessageCallback }, |
774 | { "glGetDebugMessageLog" , (QFunctionPointer) ::glGetDebugMessageLog }, |
775 | { "glPushDebugGroup" , (QFunctionPointer) ::glPushDebugGroup }, |
776 | { "glPopDebugGroup" , (QFunctionPointer) ::glPopDebugGroup }, |
777 | { "glObjectLabel" , (QFunctionPointer) ::glObjectLabel }, |
778 | { "glGetObjectLabel" , (QFunctionPointer) ::glGetObjectLabel }, |
779 | { "glObjectPtrLabel" , (QFunctionPointer) ::glObjectPtrLabel }, |
780 | { "glGetObjectPtrLabel" , (QFunctionPointer) ::glGetObjectPtrLabel }, |
781 | { "glGetPointerv" , (QFunctionPointer) ::glGetPointerv }, |
782 | { "glEnablei" , (QFunctionPointer) ::glEnablei }, |
783 | { "glDisablei" , (QFunctionPointer) ::glDisablei }, |
784 | { "glBlendEquationi" , (QFunctionPointer) ::glBlendEquationi }, |
785 | { "glBlendEquationSeparatei" , (QFunctionPointer) ::glBlendEquationSeparatei }, |
786 | { "glBlendFunci" , (QFunctionPointer) ::glBlendFunci }, |
787 | { "glBlendFuncSeparatei" , (QFunctionPointer) ::glBlendFuncSeparatei }, |
788 | { "glColorMaski" , (QFunctionPointer) ::glColorMaski }, |
789 | { "glIsEnabledi" , (QFunctionPointer) ::glIsEnabledi }, |
790 | { "glDrawElementsBaseVertex" , (QFunctionPointer) ::glDrawElementsBaseVertex }, |
791 | { "glDrawRangeElementsBaseVertex" , (QFunctionPointer) ::glDrawRangeElementsBaseVertex }, |
792 | { "glDrawElementsInstancedBaseVertex" , (QFunctionPointer) ::glDrawElementsInstancedBaseVertex }, |
793 | { "glFramebufferTexture" , (QFunctionPointer) ::glFramebufferTexture }, |
794 | { "glPrimitiveBoundingBox" , (QFunctionPointer) ::glPrimitiveBoundingBox }, |
795 | { "glGetGraphicsResetStatus" , (QFunctionPointer) ::glGetGraphicsResetStatus }, |
796 | { "glReadnPixels" , (QFunctionPointer) ::glReadnPixels }, |
797 | { "glGetnUniformfv" , (QFunctionPointer) ::glGetnUniformfv }, |
798 | { "glGetnUniformiv" , (QFunctionPointer) ::glGetnUniformiv }, |
799 | { "glGetnUniformuiv" , (QFunctionPointer) ::glGetnUniformuiv }, |
800 | { "glMinSampleShading" , (QFunctionPointer) ::glMinSampleShading }, |
801 | { "glPatchParameteri" , (QFunctionPointer) ::glPatchParameteri }, |
802 | { "glTexParameterIiv" , (QFunctionPointer) ::glTexParameterIiv }, |
803 | { "glTexParameterIuiv" , (QFunctionPointer) ::glTexParameterIuiv }, |
804 | { "glGetTexParameterIiv" , (QFunctionPointer) ::glGetTexParameterIiv }, |
805 | { "glGetTexParameterIuiv" , (QFunctionPointer) ::glGetTexParameterIuiv }, |
806 | { "glSamplerParameterIiv" , (QFunctionPointer) ::glSamplerParameterIiv }, |
807 | { "glSamplerParameterIuiv" , (QFunctionPointer) ::glSamplerParameterIuiv }, |
808 | { "glGetSamplerParameterIiv" , (QFunctionPointer) ::glGetSamplerParameterIiv }, |
809 | { "glGetSamplerParameterIuiv" , (QFunctionPointer) ::glGetSamplerParameterIuiv }, |
810 | { "glTexBuffer" , (QFunctionPointer) ::glTexBuffer }, |
811 | { "glTexBufferRange" , (QFunctionPointer) ::glTexBufferRange }, |
812 | { "glTexStorage3DMultisample" , (QFunctionPointer) ::glTexStorage3DMultisample }, |
813 | #endif // QT_CONFIG(opengles32) |
814 | }; |
815 | |
816 | for (size_t i = 0; i < sizeof(standardFuncs) / sizeof(StdFunc); ++i) { |
817 | if (!qstrcmp(procName, standardFuncs[i].name)) { |
818 | proc = standardFuncs[i].func; |
819 | break; |
820 | } |
821 | } |
822 | } |
823 | #endif |
824 | |
825 | return proc; |
826 | } |
827 | |
828 | QSurfaceFormat QEGLPlatformContext::format() const |
829 | { |
830 | return m_format; |
831 | } |
832 | |
833 | EGLContext QEGLPlatformContext::eglContext() const |
834 | { |
835 | return m_eglContext; |
836 | } |
837 | |
838 | EGLDisplay QEGLPlatformContext::eglDisplay() const |
839 | { |
840 | return m_eglDisplay; |
841 | } |
842 | |
843 | EGLConfig QEGLPlatformContext::eglConfig() const |
844 | { |
845 | return m_eglConfig; |
846 | } |
847 | |
848 | QT_END_NAMESPACE |
849 | |