59QOpenGLFunctions_4_2_Compatibility::~QOpenGLFunctions_4_2_Compatibility()
62 d_1_0_Core->refs.deref();
63 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
66 d_1_1_Core->refs.deref();
67 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
70 d_1_2_Core->refs.deref();
71 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
74 d_1_3_Core->refs.deref();
75 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
78 d_1_4_Core->refs.deref();
79 Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
82 d_1_5_Core->refs.deref();
83 Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
86 d_2_0_Core->refs.deref();
87 Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
90 d_2_1_Core->refs.deref();
91 Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
94 d_3_0_Core->refs.deref();
95 Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
98 d_3_1_Core->refs.deref();
99 Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
102 d_3_2_Core->refs.deref();
103 Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
106 d_3_3_Core->refs.deref();
107 Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
110 d_4_0_Core->refs.deref();
111 Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
114 d_4_1_Core->refs.deref();
115 Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
118 d_4_2_Core->refs.deref();
119 Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
121 if (d_1_0_Deprecated) {
122 d_1_0_Deprecated->refs.deref();
123 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
125 if (d_1_1_Deprecated) {
126 d_1_1_Deprecated->refs.deref();
127 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
129 if (d_1_2_Deprecated) {
130 d_1_2_Deprecated->refs.deref();
131 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
133 if (d_1_3_Deprecated) {
134 d_1_3_Deprecated->refs.deref();
135 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
137 if (d_1_4_Deprecated) {
138 d_1_4_Deprecated->refs.deref();
139 Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
141 if (d_3_3_Deprecated) {
142 d_3_3_Deprecated->refs.deref();
143 Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
147bool QOpenGLFunctions_4_2_Compatibility::initializeOpenGLFunctions()
149 if ( isInitialized() )
152 QOpenGLContext* context = QOpenGLContext::currentContext();
156 if (((owningContext() && owningContext() == context) || !owningContext())
157 && QOpenGLFunctions_4_2_Compatibility::isContextCompatible(context))
161 QOpenGLVersionFunctionsBackend* d =
nullptr;
162 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
163 d_1_0_Core =
static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
166 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
167 d_1_1_Core =
static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
170 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
171 d_1_2_Core =
static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
174 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
175 d_1_3_Core =
static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
178 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
179 d_1_4_Core =
static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
182 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
183 d_1_5_Core =
static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
186 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
187 d_2_0_Core =
static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
190 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
191 d_2_1_Core =
static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
194 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
195 d_3_0_Core =
static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
198 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
199 d_3_1_Core =
static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
202 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
203 d_3_2_Core =
static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
206 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
207 d_3_3_Core =
static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
210 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
211 d_4_0_Core =
static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
214 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
215 d_4_1_Core =
static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
218 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
219 d_4_2_Core =
static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);
222 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
223 d_1_0_Deprecated =
static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
226 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
227 d_1_1_Deprecated =
static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
230 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
231 d_1_2_Deprecated =
static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
234 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
235 d_1_3_Deprecated =
static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
238 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
239 d_1_4_Deprecated =
static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
242 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_DeprecatedBackend::versionStatus());
243 d_3_3_Deprecated =
static_cast<QOpenGLFunctions_3_3_DeprecatedBackend*>(d);
246 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
248 return isInitialized();