Update QOpenGLFunctions docs
Mention QOpenGLContext::functions() which is used quite commonly in Qt itself and also some examples. Also, make it clear that new instances do not degrade performance since function resolving is done only once. Change-Id: I74ac194a0b3956a70e5078dd5a1bcdd277b5cc28 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>bb10
parent
e453484bca
commit
751a74c339
|
|
@ -126,6 +126,18 @@ QT_BEGIN_NAMESPACE
|
|||
glFuncs.glActiveTexture(GL_TEXTURE1);
|
||||
\endcode
|
||||
|
||||
An alternative approach is to query the context's associated
|
||||
QOpenGLFunctions instance. This is somewhat faster than the previous
|
||||
approach due to avoiding the creation of a new instance, but the difference
|
||||
is fairly small since the internal data structures are shared, and function
|
||||
resolving happens only once for a given context, regardless of the number of
|
||||
QOpenGLFunctions instances initialized for it.
|
||||
|
||||
\code
|
||||
QOpenGLFunctions *glFuncs = QOpenGLContext::currentContext()->functions();
|
||||
glFuncs->glActiveTexture(GL_TEXTURE1);
|
||||
\endcode
|
||||
|
||||
QOpenGLFunctions provides wrappers for all OpenGL ES 2.0
|
||||
functions, including the common subset of OpenGL 1.x and ES
|
||||
2.0. While such functions, for example glClear() or
|
||||
|
|
|
|||
Loading…
Reference in New Issue