51QOpenGLFunctions_2_1::~QOpenGLFunctions_2_1()
54 d_1_0_Core->refs.deref();
55 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
58 d_1_1_Core->refs.deref();
59 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
62 d_1_2_Core->refs.deref();
63 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
66 d_1_3_Core->refs.deref();
67 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
70 d_1_4_Core->refs.deref();
71 Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
74 d_1_5_Core->refs.deref();
75 Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
78 d_2_0_Core->refs.deref();
79 Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
82 d_2_1_Core->refs.deref();
83 Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
85 if (d_1_0_Deprecated) {
86 d_1_0_Deprecated->refs.deref();
87 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
89 if (d_1_1_Deprecated) {
90 d_1_1_Deprecated->refs.deref();
91 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
93 if (d_1_2_Deprecated) {
94 d_1_2_Deprecated->refs.deref();
95 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
97 if (d_1_3_Deprecated) {
98 d_1_3_Deprecated->refs.deref();
99 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
101 if (d_1_4_Deprecated) {
102 d_1_4_Deprecated->refs.deref();
103 Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
107bool QOpenGLFunctions_2_1::initializeOpenGLFunctions()
109 if ( isInitialized() )
112 QOpenGLContext* context = QOpenGLContext::currentContext();
116 if (((owningContext() && owningContext() == context) || !owningContext())
117 && QOpenGLFunctions_2_1::isContextCompatible(context))
121 QOpenGLVersionFunctionsBackend* d =
nullptr;
122 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
123 d_1_0_Core =
static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
126 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
127 d_1_1_Core =
static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
130 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
131 d_1_2_Core =
static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
134 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
135 d_1_3_Core =
static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
138 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
139 d_1_4_Core =
static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
142 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
143 d_1_5_Core =
static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
146 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
147 d_2_0_Core =
static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
150 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
151 d_2_1_Core =
static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
154 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
155 d_1_0_Deprecated =
static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
158 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
159 d_1_1_Deprecated =
static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
162 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
163 d_1_2_Deprecated =
static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
166 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
167 d_1_3_Deprecated =
static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
170 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
171 d_1_4_Deprecated =
static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
174 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
176 return isInitialized();