58QOpenGLFunctions_4_1_Compatibility::~QOpenGLFunctions_4_1_Compatibility()
61 d_1_0_Core->refs.deref();
62 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
65 d_1_1_Core->refs.deref();
66 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
69 d_1_2_Core->refs.deref();
70 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
73 d_1_3_Core->refs.deref();
74 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
77 d_1_4_Core->refs.deref();
78 Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
81 d_1_5_Core->refs.deref();
82 Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
85 d_2_0_Core->refs.deref();
86 Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
89 d_2_1_Core->refs.deref();
90 Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
93 d_3_0_Core->refs.deref();
94 Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
97 d_3_1_Core->refs.deref();
98 Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
101 d_3_2_Core->refs.deref();
102 Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
105 d_3_3_Core->refs.deref();
106 Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
109 d_4_0_Core->refs.deref();
110 Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
113 d_4_1_Core->refs.deref();
114 Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
116 if (d_1_0_Deprecated) {
117 d_1_0_Deprecated->refs.deref();
118 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
120 if (d_1_1_Deprecated) {
121 d_1_1_Deprecated->refs.deref();
122 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
124 if (d_1_2_Deprecated) {
125 d_1_2_Deprecated->refs.deref();
126 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
128 if (d_1_3_Deprecated) {
129 d_1_3_Deprecated->refs.deref();
130 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
132 if (d_1_4_Deprecated) {
133 d_1_4_Deprecated->refs.deref();
134 Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
136 if (d_3_3_Deprecated) {
137 d_3_3_Deprecated->refs.deref();
138 Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
142bool QOpenGLFunctions_4_1_Compatibility::initializeOpenGLFunctions()
144 if ( isInitialized() )
147 QOpenGLContext* context = QOpenGLContext::currentContext();
151 if (((owningContext() && owningContext() == context) || !owningContext())
152 && QOpenGLFunctions_4_1_Compatibility::isContextCompatible(context))
156 QOpenGLVersionFunctionsBackend* d =
nullptr;
157 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
158 d_1_0_Core =
static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
161 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
162 d_1_1_Core =
static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
165 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
166 d_1_2_Core =
static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
169 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
170 d_1_3_Core =
static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
173 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
174 d_1_4_Core =
static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
177 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
178 d_1_5_Core =
static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
181 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
182 d_2_0_Core =
static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
185 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
186 d_2_1_Core =
static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
189 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
190 d_3_0_Core =
static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
193 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
194 d_3_1_Core =
static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
197 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
198 d_3_2_Core =
static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
201 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
202 d_3_3_Core =
static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
205 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
206 d_4_0_Core =
static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
209 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
210 d_4_1_Core =
static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
213 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
214 d_1_0_Deprecated =
static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
217 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
218 d_1_1_Deprecated =
static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
221 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
222 d_1_2_Deprecated =
static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
225 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
226 d_1_3_Deprecated =
static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
229 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
230 d_1_4_Deprecated =
static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
233 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_DeprecatedBackend::versionStatus());
234 d_3_3_Deprecated =
static_cast<QOpenGLFunctions_3_3_DeprecatedBackend*>(d);
237 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
239 return isInitialized();