Qt 4.8
Macros | Functions
qglextensions.cpp File Reference
#include "qgl_p.h"
#include <qglframebufferobject.h>

Go to the source code of this file.

Macros

#define qt_gl_getProcAddress(ctx, name)   qt_gl_getProcAddress_search((ctx), name, name "ARB", name "EXT", 0)
 
#define qt_gl_getProcAddressARB(ctx, name)   qt_gl_getProcAddress_search((ctx), name "ARB", name, name "EXT", 0)
 
#define qt_gl_getProcAddressEXT(ctx, name)   qt_gl_getProcAddress_search((ctx), name "EXT", name, name "ARB", 0)
 
#define qt_gl_getProcAddressOES(ctx, name)   qt_gl_getProcAddress_search((ctx), name "OES", name, name "EXT", name "ARB")
 

Functions

static void * qt_gl_getProcAddress_search (QGLContext *ctx, const char *name1, const char *name2, const char *name3, const char *name4)
 
bool qt_resolve_buffer_extensions (QGLContext *ctx)
 
bool qt_resolve_eglimage_gl_extensions (QGLContext *ctx)
 
bool qt_resolve_frag_program_extensions (QGLContext *ctx)
 
bool qt_resolve_framebufferobject_extensions (QGLContext *ctx)
 
bool qt_resolve_glsl_extensions (QGLContext *ctx)
 
bool qt_resolve_stencil_face_extension (QGLContext *ctx)
 
bool qt_resolve_version_1_3_functions (QGLContext *ctx)
 
bool qt_resolve_version_2_0_functions (QGLContext *ctx)
 

Macro Definition Documentation

◆ qt_gl_getProcAddress

#define qt_gl_getProcAddress (   ctx,
  name 
)    qt_gl_getProcAddress_search((ctx), name, name "ARB", name "EXT", 0)

Definition at line 83 of file qglextensions.cpp.

◆ qt_gl_getProcAddressARB

#define qt_gl_getProcAddressARB (   ctx,
  name 
)    qt_gl_getProcAddress_search((ctx), name "ARB", name, name "EXT", 0)

Definition at line 87 of file qglextensions.cpp.

Referenced by qt_resolve_buffer_extensions().

◆ qt_gl_getProcAddressEXT

#define qt_gl_getProcAddressEXT (   ctx,
  name 
)    qt_gl_getProcAddress_search((ctx), name "EXT", name, name "ARB", 0)

Definition at line 85 of file qglextensions.cpp.

Referenced by qt_resolve_framebufferobject_extensions().

◆ qt_gl_getProcAddressOES

#define qt_gl_getProcAddressOES (   ctx,
  name 
)    qt_gl_getProcAddress_search((ctx), name "OES", name, name "EXT", name "ARB")

Definition at line 89 of file qglextensions.cpp.

Function Documentation

◆ qt_gl_getProcAddress_search()

static void* qt_gl_getProcAddress_search ( QGLContext ctx,
const char *  name1,
const char *  name2,
const char *  name3,
const char *  name4 
)
static

Definition at line 48 of file qglextensions.cpp.

50 {
51  void *addr;
52 
53  addr = ctx->getProcAddress(QLatin1String(name1));
54  if (addr)
55  return addr;
56 
57  addr = ctx->getProcAddress(QLatin1String(name2));
58  if (addr)
59  return addr;
60 
61  addr = ctx->getProcAddress(QLatin1String(name3));
62  if (addr)
63  return addr;
64 
65  if (name4)
66  return ctx->getProcAddress(QLatin1String(name4));
67 
68  return 0;
69 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379

◆ qt_resolve_buffer_extensions()

bool qt_resolve_buffer_extensions ( QGLContext ctx)

Definition at line 193 of file qglextensions.cpp.

Referenced by QGL2PaintEngineEx::begin(), QGLBuffer::create(), and QGLBuffer::release().

194 {
195  if (!QGLContextPrivate::extensionFuncs(ctx).qt_bufferFuncsResolved) {
196 #if defined(QGL_RESOLVE_BUFFER_FUNCS)
197  glBindBuffer = (_glBindBuffer) qt_gl_getProcAddressARB(ctx, "glBindBuffer");
198  glDeleteBuffers = (_glDeleteBuffers) qt_gl_getProcAddressARB(ctx, "glDeleteBuffers");
199  glGenBuffers = (_glGenBuffers) qt_gl_getProcAddressARB(ctx, "glGenBuffers");
200  glBufferData = (_glBufferData) qt_gl_getProcAddressARB(ctx, "glBufferData");
201  glBufferSubData = (_glBufferSubData) qt_gl_getProcAddressARB(ctx, "glBufferSubData");
202  glGetBufferSubData = (_glGetBufferSubData) qt_gl_getProcAddressARB(ctx, "glGetBufferSubData");
204 #endif
205 
206 #ifdef QT_OPENGL_ES_2
208  if (extensions.match("GL_OES_mapbuffer")) {
209  glMapBufferARB = (_glMapBufferARB) qt_gl_getProcAddressARB(ctx, "glMapBufferOES");
210  glUnmapBufferARB = (_glUnmapBufferARB) qt_gl_getProcAddressARB(ctx, "glUnmapBufferOES");
211  }
212 #else
215 #endif
216 
218  }
219 
220 #if defined(QGL_RESOLVE_BUFFER_FUNCS)
221  return glBindBuffer
222  && glDeleteBuffers
223  && glGenBuffers
224  && glBufferData
225  && glBufferSubData
227  // glGetBufferSubData() is optional
228 #else
229  return true;
230 #endif
231 }
GLvoid *(APIENTRY * _glMapBufferARB)(GLenum, GLenum)
#define qt_gl_getProcAddressARB(ctx, name)
#define glBufferSubData
Q_GUI_EXPORT QString extensions()
Definition: qegl.cpp:785
#define glGetBufferParameteriv
void(APIENTRY * _glBindBuffer)(GLenum, GLuint)
void(APIENTRY * _glGetBufferParameteriv)(GLenum, GLenum, GLint *)
#define glGenBuffers
void(APIENTRY * _glBufferSubData)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)
void(APIENTRY * _glBufferData)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)
#define glMapBufferARB
#define glGetBufferSubData
void(APIENTRY * _glGetBufferSubData)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)
#define glDeleteBuffers
void(APIENTRY * _glGenBuffers)(GLsizei, GLuint *)
bool match(const char *str) const
Definition: qgl_p.h:906
void(APIENTRY * _glDeleteBuffers)(GLsizei, const GLuint *)
#define glUnmapBufferARB
#define glBindBuffer
static QGLExtensionFuncs & extensionFuncs(const QGLContext *ctx)
Definition: qgl_p.h:467
GLboolean(APIENTRY * _glUnmapBufferARB)(GLenum)
#define glBufferData

◆ qt_resolve_eglimage_gl_extensions()

bool qt_resolve_eglimage_gl_extensions ( QGLContext ctx)

Definition at line 234 of file qglextensions.cpp.

Referenced by QMeeGoExtensions::initialize().

235 {
237  return true;
241 }
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
void(APIENTRY * _glEGLImageTargetRenderbufferStorageOES)(GLenum, EGLImageKHR)
void(APIENTRY * _glEGLImageTargetTexture2DOES)(GLenum, EGLImageKHR)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
#define glEGLImageTargetRenderbufferStorageOES
#define glEGLImageTargetTexture2DOES

◆ qt_resolve_frag_program_extensions()

bool qt_resolve_frag_program_extensions ( QGLContext ctx)

Definition at line 172 of file qglextensions.cpp.

Referenced by QOpenGLPaintEngine::begin().

173 {
174  if (glProgramStringARB != 0)
175  return true;
176 
177  // ARB_fragment_program
178  glProgramStringARB = (_glProgramStringARB) ctx->getProcAddress(QLatin1String("glProgramStringARB"));
179  glBindProgramARB = (_glBindProgramARB) ctx->getProcAddress(QLatin1String("glBindProgramARB"));
180  glDeleteProgramsARB = (_glDeleteProgramsARB) ctx->getProcAddress(QLatin1String("glDeleteProgramsARB"));
181  glGenProgramsARB = (_glGenProgramsARB) ctx->getProcAddress(QLatin1String("glGenProgramsARB"));
183 
184  return glProgramStringARB
189 }
#define glDeleteProgramsARB
void(APIENTRY * _glProgramLocalParameter4fvARB)(GLenum, GLuint, const GLfloat *)
void(APIENTRY * _glDeleteProgramsARB)(GLsizei, const GLuint *)
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
#define glGenProgramsARB
void(APIENTRY * _glGenProgramsARB)(GLsizei, GLuint *)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void(APIENTRY * _glBindProgramARB)(GLenum, GLuint)
void(APIENTRY * _glProgramStringARB)(GLenum, GLenum, GLsizei, const GLvoid *)
#define glProgramLocalParameter4fvARB
#define glProgramStringARB
#define glBindProgramARB

◆ qt_resolve_framebufferobject_extensions()

bool qt_resolve_framebufferobject_extensions ( QGLContext ctx)

Definition at line 93 of file qglextensions.cpp.

Referenced by QGL2PaintEngineEx::begin(), QGLFramebufferObject::bindDefault(), and QGLFramebufferObjectPrivate::init().

94 {
95 #if defined(QT_OPENGL_ES_2)
96  static bool have_resolved = false;
97  if (have_resolved)
98  return true;
99  have_resolved = true;
100 #else
101  if (glIsRenderbuffer != 0)
102  return true;
103 #endif
104 
105  if (ctx == 0) {
106  qWarning("QGLFramebufferObject: Unable to resolve framebuffer object extensions -"
107  " make sure there is a current context when creating the framebuffer object.");
108  return false;
109  }
110 
111 
114  (_glRenderbufferStorageMultisampleEXT) qt_gl_getProcAddressEXT(ctx, "glRenderbufferStorageMultisample");
115 
116 #if !defined(QT_OPENGL_ES_2)
117  glIsRenderbuffer = (_glIsRenderbuffer) qt_gl_getProcAddressEXT(ctx, "glIsRenderbuffer");
118  if (!glIsRenderbuffer)
119  return false; // Not much point searching for anything else.
120  glBindRenderbuffer = (_glBindRenderbuffer) qt_gl_getProcAddressEXT(ctx, "glBindRenderbuffer");
121  glDeleteRenderbuffers = (_glDeleteRenderbuffers) qt_gl_getProcAddressEXT(ctx, "glDeleteRenderbuffers");
122  glGenRenderbuffers = (_glGenRenderbuffers) qt_gl_getProcAddressEXT(ctx, "glGenRenderbuffers");
123  glRenderbufferStorage = (_glRenderbufferStorage) qt_gl_getProcAddressEXT(ctx, "glRenderbufferStorage");
125  (_glGetRenderbufferParameteriv) qt_gl_getProcAddressEXT(ctx, "glGetRenderbufferParameteriv");
126  glIsFramebuffer = (_glIsFramebuffer) qt_gl_getProcAddressEXT(ctx, "glIsFramebuffer");
127  glBindFramebuffer = (_glBindFramebuffer) qt_gl_getProcAddressEXT(ctx, "glBindFramebuffer");
128  glDeleteFramebuffers = (_glDeleteFramebuffers) qt_gl_getProcAddressEXT(ctx, "glDeleteFramebuffers");
129  glGenFramebuffers = (_glGenFramebuffers) qt_gl_getProcAddressEXT(ctx, "glGenFramebuffers");
134  (_glGetFramebufferAttachmentParameteriv) qt_gl_getProcAddressEXT(ctx, "glGetFramebufferAttachmentParameteriv");
135  glGenerateMipmap = (_glGenerateMipmap) qt_gl_getProcAddressEXT(ctx, "glGenerateMipmap");
136 
137  return glIsRenderbuffer != 0;
138 #else
139  return true;
140 #endif
141 }
void(APIENTRY * _glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
#define glIsFramebuffer
GLenum(APIENTRY * _glCheckFramebufferStatus)(GLenum target)
GLboolean(APIENTRY * _glIsFramebuffer)(GLuint framebuffer)
void(APIENTRY * _glDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers)
void(APIENTRY * _glBindFramebuffer)(GLenum target, GLuint framebuffer)
#define glGetFramebufferAttachmentParameteriv
#define glGenRenderbuffers
void(APIENTRY * _glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params)
#define glBindFramebuffer
#define glRenderbufferStorageMultisampleEXT
#define glDeleteRenderbuffers
#define qt_gl_getProcAddressEXT(ctx, name)
#define glBlitFramebufferEXT
void(APIENTRY * _glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
void(APIENTRY * _glBindRenderbuffer)(GLenum target, GLuint renderbuffer)
#define glCheckFramebufferStatus
#define glDeleteFramebuffers
void(APIENTRY * _glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
void(APIENTRY * _glGenerateMipmap)(GLenum target)
#define glIsRenderbuffer
void(APIENTRY * _glBlitFramebufferEXT)(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, GLbitfield mask, GLenum filter)
Q_CORE_EXPORT void qWarning(const char *,...)
#define glGenFramebuffers
void(APIENTRY * _glGenRenderbuffers)(GLsizei n, GLuint *renderbuffers)
#define glGetRenderbufferParameteriv
#define glBindRenderbuffer
GLboolean(APIENTRY * _glIsRenderbuffer)(GLuint renderbuffer)
void(APIENTRY * _glGenFramebuffers)(GLsizei n, GLuint *framebuffers)
void(APIENTRY * _glDeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers)
#define glFramebufferRenderbuffer
void(APIENTRY * _glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
#define glFramebufferTexture2D
void(APIENTRY * _glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
#define glGenerateMipmap
Definition: glfunctions.h:70
#define glRenderbufferStorage

◆ qt_resolve_glsl_extensions()

bool qt_resolve_glsl_extensions ( QGLContext ctx)

Definition at line 244 of file qglextensions.cpp.

Referenced by QGLShaderPrivate::create(), QGLShaderProgram::hasOpenGLShaderPrograms(), QGLShader::hasOpenGLShaders(), QGLShaderProgram::init(), and qt_resolve_version_2_0_functions().

245 {
246 
247 #if defined(QT_OPENGL_ES_2)
248  // The GLSL shader functions are always present in OpenGL/ES 2.0.
249  // The only exceptions are glGetProgramBinaryOES and glProgramBinaryOES.
250  if (!QGLContextPrivate::extensionFuncs(ctx).qt_glslResolved) {
251  glGetProgramBinaryOES = (_glGetProgramBinaryOES) ctx->getProcAddress(QLatin1String("glGetProgramBinaryOES"));
252  glProgramBinaryOES = (_glProgramBinaryOES) ctx->getProcAddress(QLatin1String("glProgramBinaryOES"));
253  QGLContextPrivate::extensionFuncs(ctx).qt_glslResolved = true;
254  }
255  return true;
256 #else
257  if (glCreateShader)
258  return true;
259 
260  // Geometry shaders are optional...
265 
266  // Must at least have the FragmentShader extension to continue.
268  return false;
269 
270  glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShader"));
271  if (glCreateShader) {
272  glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSource"));
273  glShaderBinary = (_glShaderBinary) ctx->getProcAddress(QLatin1String("glShaderBinary"));
274  glCompileShader = (_glCompileShader) ctx->getProcAddress(QLatin1String("glCompileShader"));
275  glDeleteShader = (_glDeleteShader) ctx->getProcAddress(QLatin1String("glDeleteShader"));
276  glIsShader = (_glIsShader) ctx->getProcAddress(QLatin1String("glIsShader"));
277 
278  glCreateProgram = (_glCreateProgram) ctx->getProcAddress(QLatin1String("glCreateProgram"));
279  glAttachShader = (_glAttachShader) ctx->getProcAddress(QLatin1String("glAttachShader"));
280  glDetachShader = (_glDetachShader) ctx->getProcAddress(QLatin1String("glDetachShader"));
281  glLinkProgram = (_glLinkProgram) ctx->getProcAddress(QLatin1String("glLinkProgram"));
282  glUseProgram = (_glUseProgram) ctx->getProcAddress(QLatin1String("glUseProgram"));
283  glDeleteProgram = (_glDeleteProgram) ctx->getProcAddress(QLatin1String("glDeleteProgram"));
284  glIsProgram = (_glIsProgram) ctx->getProcAddress(QLatin1String("glIsProgram"));
285 
286  glGetShaderInfoLog = (_glGetShaderInfoLog) ctx->getProcAddress(QLatin1String("glGetShaderInfoLog"));
287  glGetShaderiv = (_glGetShaderiv) ctx->getProcAddress(QLatin1String("glGetShaderiv"));
288  glGetShaderSource = (_glGetShaderSource) ctx->getProcAddress(QLatin1String("glGetShaderSource"));
289  glGetProgramiv = (_glGetProgramiv) ctx->getProcAddress(QLatin1String("glGetProgramiv"));
290  glGetProgramInfoLog = (_glGetProgramInfoLog) ctx->getProcAddress(QLatin1String("glGetProgramInfoLog"));
291 
293  glUniform4fv = (_glUniform4fv) ctx->getProcAddress(QLatin1String("glUniform4fv"));
294  glUniform3fv = (_glUniform3fv) ctx->getProcAddress(QLatin1String("glUniform3fv"));
295  glUniform2fv = (_glUniform2fv) ctx->getProcAddress(QLatin1String("glUniform2fv"));
296  glUniform1fv = (_glUniform1fv) ctx->getProcAddress(QLatin1String("glUniform1fv"));
297  glUniform1i = (_glUniform1i) ctx->getProcAddress(QLatin1String("glUniform1i"));
298  glUniform1iv = (_glUniform1iv) ctx->getProcAddress(QLatin1String("glUniform1iv"));
299  glUniformMatrix2fv = (_glUniformMatrix2fv) ctx->getProcAddress(QLatin1String("glUniformMatrix2fv"));
300  glUniformMatrix3fv = (_glUniformMatrix3fv) ctx->getProcAddress(QLatin1String("glUniformMatrix3fv"));
301  glUniformMatrix4fv = (_glUniformMatrix4fv) ctx->getProcAddress(QLatin1String("glUniformMatrix4fv"));
308 
310  glGetAttribLocation = (_glGetAttribLocation) ctx->getProcAddress(QLatin1String("glGetAttribLocation"));
311  glVertexAttrib1fv = (_glVertexAttrib1fv) ctx->getProcAddress(QLatin1String("glVertexAttrib1fv"));
312  glVertexAttrib2fv = (_glVertexAttrib2fv) ctx->getProcAddress(QLatin1String("glVertexAttrib2fv"));
313  glVertexAttrib3fv = (_glVertexAttrib3fv) ctx->getProcAddress(QLatin1String("glVertexAttrib3fv"));
314  glVertexAttrib4fv = (_glVertexAttrib4fv) ctx->getProcAddress(QLatin1String("glVertexAttrib4fv"));
318 
319  } else {
320  // We may not have the standard shader functions, but we might
321  // have the older ARB functions instead.
322  glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
323  glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSourceARB"));
324  glShaderBinary = (_glShaderBinary) ctx->getProcAddress(QLatin1String("glShaderBinaryARB"));
325  glCompileShader = (_glCompileShader) ctx->getProcAddress(QLatin1String("glCompileShaderARB"));
326  glDeleteShader = (_glDeleteShader) ctx->getProcAddress(QLatin1String("glDeleteObjectARB"));
327  glIsShader = 0;
328 
329  glCreateProgram = (_glCreateProgram) ctx->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
330  glAttachShader = (_glAttachShader) ctx->getProcAddress(QLatin1String("glAttachObjectARB"));
331  glDetachShader = (_glDetachShader) ctx->getProcAddress(QLatin1String("glDetachObjectARB"));
332  glLinkProgram = (_glLinkProgram) ctx->getProcAddress(QLatin1String("glLinkProgramARB"));
333  glUseProgram = (_glUseProgram) ctx->getProcAddress(QLatin1String("glUseProgramObjectARB"));
334  glDeleteProgram = (_glDeleteProgram) ctx->getProcAddress(QLatin1String("glDeleteObjectARB"));
335  glIsProgram = 0;
336 
338  glGetShaderiv = (_glGetShaderiv) ctx->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
339  glGetShaderSource = (_glGetShaderSource) ctx->getProcAddress(QLatin1String("glGetShaderSourceARB"));
340  glGetProgramiv = (_glGetProgramiv) ctx->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
342 
343  glGetUniformLocation = (_glGetUniformLocation) ctx->getProcAddress(QLatin1String("glGetUniformLocationARB"));
344  glUniform4fv = (_glUniform4fv) ctx->getProcAddress(QLatin1String("glUniform4fvARB"));
345  glUniform3fv = (_glUniform3fv) ctx->getProcAddress(QLatin1String("glUniform3fvARB"));
346  glUniform2fv = (_glUniform2fv) ctx->getProcAddress(QLatin1String("glUniform2fvARB"));
347  glUniform1fv = (_glUniform1fv) ctx->getProcAddress(QLatin1String("glUniform1fvARB"));
348  glUniform1i = (_glUniform1i) ctx->getProcAddress(QLatin1String("glUniform1iARB"));
349  glUniform1iv = (_glUniform1iv) ctx->getProcAddress(QLatin1String("glUniform1ivARB"));
350  glUniformMatrix2fv = (_glUniformMatrix2fv) ctx->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
351  glUniformMatrix3fv = (_glUniformMatrix3fv) ctx->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
352  glUniformMatrix4fv = (_glUniformMatrix4fv) ctx->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
353  glUniformMatrix2x3fv = (_glUniformMatrix2x3fv) ctx->getProcAddress(QLatin1String("glUniformMatrix2x3fvARB"));
354  glUniformMatrix2x4fv = (_glUniformMatrix2x4fv) ctx->getProcAddress(QLatin1String("glUniformMatrix2x4fvARB"));
355  glUniformMatrix3x2fv = (_glUniformMatrix3x2fv) ctx->getProcAddress(QLatin1String("glUniformMatrix3x2fvARB"));
356  glUniformMatrix3x4fv = (_glUniformMatrix3x4fv) ctx->getProcAddress(QLatin1String("glUniformMatrix3x4fvARB"));
357  glUniformMatrix4x2fv = (_glUniformMatrix4x2fv) ctx->getProcAddress(QLatin1String("glUniformMatrix4x2fvARB"));
358  glUniformMatrix4x3fv = (_glUniformMatrix4x3fv) ctx->getProcAddress(QLatin1String("glUniformMatrix4x3fvARB"));
359 
360  glBindAttribLocation = (_glBindAttribLocation) ctx->getProcAddress(QLatin1String("glBindAttribLocationARB"));
361  glGetAttribLocation = (_glGetAttribLocation) ctx->getProcAddress(QLatin1String("glGetAttribLocationARB"));
362  glVertexAttrib1fv = (_glVertexAttrib1fv) ctx->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
363  glVertexAttrib2fv = (_glVertexAttrib2fv) ctx->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
364  glVertexAttrib3fv = (_glVertexAttrib3fv) ctx->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
365  glVertexAttrib4fv = (_glVertexAttrib4fv) ctx->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
366  glVertexAttribPointer = (_glVertexAttribPointer) ctx->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
367  glDisableVertexAttribArray = (_glDisableVertexAttribArray) ctx->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
368  glEnableVertexAttribArray = (_glEnableVertexAttribArray) ctx->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
369  }
370 
371  // Note: glShaderBinary(), glIsShader(), glIsProgram(), and
372  // glUniformMatrixNxMfv() are optional, but all other functions
373  // are required.
374 
375  return glCreateShader &&
376  glShaderSource &&
377  glCompileShader &&
378  glDeleteProgram &&
379  glCreateProgram &&
380  glAttachShader &&
381  glDetachShader &&
382  glLinkProgram &&
383  glUseProgram &&
384  glDeleteProgram &&
386  glGetShaderiv &&
388  glGetProgramiv &&
391  glUniform1fv &&
392  glUniform2fv &&
393  glUniform3fv &&
394  glUniform4fv &&
395  glUniform1i &&
396  glUniform1iv &&
409 #endif
410 }
void(APIENTRY * _glUniformMatrix4x2fv)(GLint, GLsizei, GLboolean, const GLfloat *)
void(APIENTRY * _glUniformMatrix4x3fv)(GLint, GLsizei, GLboolean, const GLfloat *)
#define glCreateProgram
#define glUseProgram
#define glUniform3fv
#define glFramebufferTextureEXT
void(APIENTRY * _glUniformMatrix2x3fv)(GLint, GLsizei, GLboolean, const GLfloat *)
#define glShaderBinary
void(APIENTRY * _glUniformMatrix4fv)(GLint, GLsizei, GLboolean, const GLfloat *)
GLint(APIENTRY * _glGetAttribLocation)(GLuint, const char *)
#define glUniform1iv
GLuint(APIENTRY * _glCreateShader)(GLenum)
#define glGetShaderSource
#define glIsShader
#define glUniform2fv
void(APIENTRY * _glShaderSource)(GLuint, GLsizei, const char **, const GLint *)
#define glFramebufferTextureFaceEXT
#define glBindAttribLocation
void(APIENTRY * _glUniform4fv)(GLint, GLsizei, const GLfloat *)
#define glVertexAttribPointer
Definition: glfunctions.h:71
#define glVertexAttrib3fv
#define glVertexAttrib2fv
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
void(APIENTRY * _glUniform3fv)(GLint, GLsizei, const GLfloat *)
#define glEnableVertexAttribArray
void(APIENTRY * _glAttachShader)(GLuint, GLuint)
#define glVertexAttrib1fv
void(APIENTRY * _glUseProgram)(GLuint)
void(APIENTRY * _glGetProgramBinaryOES)(GLuint, GLsizei, GLsizei *, GLenum *, void *)
void(APIENTRY * _glGetShaderSource)(GLuint, GLsizei, GLsizei *, char *)
void(APIENTRY * _glUniformMatrix2fv)(GLint, GLsizei, GLboolean, const GLfloat *)
#define glUniformMatrix3x2fv
#define glGetAttribLocation
void(APIENTRY * _glBindAttribLocation)(GLuint, GLuint, const char *)
#define glFramebufferTextureLayerEXT
#define glVertexAttrib4fv
#define glShaderSource
void(APIENTRY * _glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)
void(APIENTRY * _glDetachShader)(GLuint, GLuint)
#define glUniformMatrix3fv
#define glLinkProgram
void(APIENTRY * _glUniform1fv)(GLint, GLsizei, const GLfloat *)
void(APIENTRY * _glUniformMatrix2x4fv)(GLint, GLsizei, GLboolean, const GLfloat *)
void(APIENTRY * _glUniformMatrix3x2fv)(GLint, GLsizei, GLboolean, const GLfloat *)
void(APIENTRY * _glLinkProgram)(GLuint)
GLboolean(APIENTRY * _glIsShader)(GLuint)
#define glUniformMatrix2x3fv
void(APIENTRY * _glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)
#define glIsProgram
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void(APIENTRY * _glFramebufferTextureEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level)
#define glAttachShader
void(APIENTRY * _glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
#define glGetShaderInfoLog
#define glUniformMatrix2x4fv
#define glUniformMatrix4x2fv
#define glUniform4fv
#define glGetProgramiv
void(APIENTRY * _glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value)
void(APIENTRY * _glGetProgramiv)(GLuint, GLenum, GLint *)
void(APIENTRY * _glUniform1iv)(GLint, GLsizei, const GLint *)
void(APIENTRY * _glDeleteProgram)(GLuint)
void(APIENTRY * _glVertexAttrib3fv)(GLuint, const GLfloat *)
void(APIENTRY * _glShaderBinary)(GLint, const GLuint *, GLenum, const void *, GLint)
void(APIENTRY * _glGetShaderiv)(GLuint, GLenum, GLint *)
void(APIENTRY * _glVertexAttrib4fv)(GLuint, const GLfloat *)
#define glUniform1i
#define glUniformMatrix3x4fv
GLboolean(APIENTRY * _glIsProgram)(GLuint)
#define glDetachShader
void(APIENTRY * _glDeleteShader)(GLuint)
#define glDisableVertexAttribArray
#define glUniformMatrix4fv
#define glProgramParameteriEXT
void(APIENTRY * _glUniformMatrix3x4fv)(GLint, GLsizei, GLboolean, const GLfloat *)
void(APIENTRY * _glCompileShader)(GLuint)
#define glCreateShader
#define glDeleteProgram
void(APIENTRY * _glDisableVertexAttribArray)(GLuint)
void(APIENTRY * _glVertexAttrib2fv)(GLuint, const GLfloat *)
void(APIENTRY * _glProgramBinaryOES)(GLuint, GLenum, const void *, GLint)
#define glGetUniformLocation
void(APIENTRY * _glGetProgramInfoLog)(GLuint, GLsizei, GLsizei *, char *)
static Extensions glExtensions()
Definition: qgl.cpp:5781
#define glGetShaderiv
#define glCompileShader
void(APIENTRY * _glGetShaderInfoLog)(GLuint, GLsizei, GLsizei *, char *)
void(APIENTRY * _glUniform2fv)(GLint, GLsizei, const GLfloat *)
void(APIENTRY * _glEnableVertexAttribArray)(GLuint)
GLuint(APIENTRY * _glCreateProgram)()
void(APIENTRY * _glVertexAttrib1fv)(GLuint, const GLfloat *)
void(APIENTRY * _glUniform1i)(GLint, GLint)
#define glUniformMatrix4x3fv
#define glUniformMatrix2fv
void(APIENTRY * _glUniformMatrix3fv)(GLint, GLsizei, GLboolean, const GLfloat *)
static QGLExtensionFuncs & extensionFuncs(const QGLContext *ctx)
Definition: qgl_p.h:467
#define glUniform1fv
#define glGetProgramInfoLog
GLuint(APIENTRY * _glGetUniformLocation)(GLuint, const char *)
#define glDeleteShader

◆ qt_resolve_stencil_face_extension()

bool qt_resolve_stencil_face_extension ( QGLContext ctx)

Definition at line 158 of file qglextensions.cpp.

Referenced by QOpenGLPaintEngine::begin().

159 {
160  if (glActiveStencilFaceEXT != 0)
161  return true;
162 
165 
166  return glActiveStencilFaceEXT;
167 }
void(APIENTRY * _glActiveStencilFaceEXT)(GLenum)
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
#define glActiveStencilFaceEXT
static QGLFormat defaultFormat()
Definition: qgl.cpp:1518

◆ qt_resolve_version_1_3_functions()

bool qt_resolve_version_1_3_functions ( QGLContext ctx)

Definition at line 144 of file qglextensions.cpp.

Referenced by QOpenGLPaintEngine::begin(), and qt_resolve_version_2_0_functions().

145 {
146  if (glMultiTexCoord4f != 0)
147  return true;
148 
150  glMultiTexCoord4f = (_glMultiTexCoord4f) ctx->getProcAddress(QLatin1String("glMultiTexCoord4f"));
151 
152  glActiveTexture = (_glActiveTexture) ctx->getProcAddress(QLatin1String("glActiveTexture"));
154 }
#define glMultiTexCoord4f
void(APIENTRY * _glMultiTexCoord4f)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat)
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
#define glActiveTexture
Definition: glfunctions.h:69
void(APIENTRY * _glActiveTexture)(GLenum)
static QGLFormat defaultFormat()
Definition: qgl.cpp:1518

◆ qt_resolve_version_2_0_functions()

bool qt_resolve_version_2_0_functions ( QGLContext ctx)

Definition at line 413 of file qglextensions.cpp.

Referenced by QGL2PaintEngineEx::begin().

414 {
415  bool gl2supported = true;
416  if (!qt_resolve_glsl_extensions(ctx))
417  gl2supported = false;
418 
420  gl2supported = false;
421 
423  return gl2supported;
424 
425  glBlendColor = (_glBlendColor) ctx->getProcAddress(QLatin1String("glBlendColor"));
426  glStencilOpSeparate = (_glStencilOpSeparate) ctx->getProcAddress(QLatin1String("glStencilOpSeparate"));
428  gl2supported = false;
429 
430  return gl2supported;
431 }
bool qt_resolve_version_1_3_functions(QGLContext *ctx)
#define glStencilOpSeparate
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
bool qt_resolve_glsl_extensions(QGLContext *ctx)
void(APIENTRY * _glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
#define glBlendColor
void(APIENTRY * _glBlendColor)(GLclampf, GLclampf, GLclampf, GLclampf)