26 fp->owningContext =
nullptr;
27 fp->initialized =
false;
43#define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1
44#define QT_OPENGL_FUNCTION_NAMES(ret, name, args) \
46#define QT_OPENGL_IMPLEMENT(CLASS, FUNCTIONS) \
49 const char *names = FUNCTIONS(QT_OPENGL_FUNCTION_NAMES); \
50 const char *name = names; \
51 for (int i = 0; i < FUNCTIONS(QT_OPENGL_COUNT_FUNCTIONS); ++i) { \
52 functions[i] = context->getProcAddress(name); \
53 name += strlen(name) + 1; \
64#if !QT_CONFIG(opengles2)
69#define DELETE_BACKEND(X) \
70 if (backends[i] && !--backends[i]->refs) \
71 delete static_cast<QOpenGLFunctions_##X##Backend*>(backends[i]); \
83#if QT_CONFIG(opengles2)
96#define VERSION_ENUM(X) QOpenGLVersionFunctionsBackend::OpenGL_##X
97#define CREATE_BACKEND(X) \
98 case VERSION_ENUM(X): \
99 backends[VERSION_ENUM(X)] = new QOpenGLFunctions_##X##Backend(context); \
250 if (
d->owningContext)
251 d->removeExternalFunctions(
d->owningContext,
this);
260 d->initialized =
true;
267 if (!
d->owningContext) {
269 if (
d->owningContext)
270 d->insertExternalFunctions(
d->owningContext,
this);
281 return d->initialized;
297 return d->owningContext;
300#if !QT_CONFIG(opengles2)
static QAbstractOpenGLFunctionsPrivate * get(QAbstractOpenGLFunctions *q)
static QOpenGLVersionFunctionsBackend * functionsBackend(QOpenGLContext *context, QOpenGLVersionFunctionsBackend::Version v)
static void removeExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f)
static void insertExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f)
virtual ~QAbstractOpenGLFunctions()
Destroys a QAbstractOpenGLFunctions object.
QAbstractOpenGLFunctionsPrivate * d_ptr
QOpenGLContext * owningContext() const
void setOwningContext(const QOpenGLContext *context)
virtual bool initializeOpenGLFunctions()
bool isInitialized() const
QAbstractOpenGLFunctions()
Constructs a QAbstractOpenGLFunctions object.
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
QOpenGLContextVersionFunctionHelper * versionFunctions
static QOpenGLContextPrivate * get(QOpenGLContext *context)
QSet< QAbstractOpenGLFunctions * > externalFunctions
~QOpenGLContextVersionData() override
QHash< QOpenGLVersionProfile, QAbstractOpenGLFunctions * > functions
QOpenGLVersionFunctionsStorage functionsStorage
static QOpenGLContextVersionData * forContext(QOpenGLContext *context)
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
@ OpenGLVersionBackendCount
QOpenGLVersionFunctionsBackend ** backends
~QOpenGLVersionFunctionsStorage()
QOpenGLVersionFunctionsBackend * backend(QOpenGLContext *context, QOpenGLVersionFunctionsBackend::Version v)
QOpenGLVersionFunctionsStorage()
bool remove(const T &value)
iterator insert(const T &value)
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
#define QT_OPENGL_IMPLEMENT(CLASS, FUNCTIONS)
#define DELETE_BACKEND(X)
#define CREATE_BACKEND(X)
#define QT_OPENGL_1_4_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_3_1_FUNCTIONS(F)
#define QT_OPENGL_4_4_FUNCTIONS(F)
#define QT_OPENGL_4_5_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_3_0_FUNCTIONS(F)
#define QT_OPENGL_1_2_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_2_0_FUNCTIONS(F)
#define QT_OPENGL_2_1_FUNCTIONS(F)
#define QT_OPENGL_1_1_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_4_3_FUNCTIONS(F)
#define QT_OPENGL_3_0_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_1_5_FUNCTIONS(F)
#define QT_OPENGL_1_3_FUNCTIONS(F)
#define QT_OPENGL_1_4_FUNCTIONS(F)
#define QT_OPENGL_1_2_FUNCTIONS(F)
#define QT_OPENGL_1_1_FUNCTIONS(F)
#define QT_OPENGL_1_3_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_3_3_FUNCTIONS(F)
#define QT_OPENGL_4_5_FUNCTIONS(F)
#define QT_OPENGL_3_3_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_VERSIONS(F)
#define QT_OPENGL_2_0_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_4_1_FUNCTIONS(F)
#define QT_OPENGL_4_2_FUNCTIONS(F)
#define QT_OPENGL_3_2_FUNCTIONS(F)
#define QT_OPENGL_4_0_FUNCTIONS(F)
#define QT_OPENGL_1_0_DEPRECATED_FUNCTIONS(F)
#define QT_OPENGL_1_0_FUNCTIONS(F)