57QOpenGLFunctions_4_0_Compatibility::~QOpenGLFunctions_4_0_Compatibility()
60 d_1_0_Core->refs.deref();
61 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
64 d_1_1_Core->refs.deref();
65 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
68 d_1_2_Core->refs.deref();
69 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
72 d_1_3_Core->refs.deref();
73 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
76 d_1_4_Core->refs.deref();
77 Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
80 d_1_5_Core->refs.deref();
81 Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
84 d_2_0_Core->refs.deref();
85 Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
88 d_2_1_Core->refs.deref();
89 Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
92 d_3_0_Core->refs.deref();
93 Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
96 d_3_1_Core->refs.deref();
97 Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
100 d_3_2_Core->refs.deref();
101 Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
104 d_3_3_Core->refs.deref();
105 Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
108 d_4_0_Core->refs.deref();
109 Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
111 if (d_1_0_Deprecated) {
112 d_1_0_Deprecated->refs.deref();
113 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
115 if (d_1_1_Deprecated) {
116 d_1_1_Deprecated->refs.deref();
117 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
119 if (d_1_2_Deprecated) {
120 d_1_2_Deprecated->refs.deref();
121 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
123 if (d_1_3_Deprecated) {
124 d_1_3_Deprecated->refs.deref();
125 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
127 if (d_1_4_Deprecated) {
128 d_1_4_Deprecated->refs.deref();
129 Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
131 if (d_3_3_Deprecated) {
132 d_3_3_Deprecated->refs.deref();
133 Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
137bool QOpenGLFunctions_4_0_Compatibility::initializeOpenGLFunctions()
139 if ( isInitialized() )
142 QOpenGLContext* context = QOpenGLContext::currentContext();
146 if (((owningContext() && owningContext() == context) || !owningContext())
147 && QOpenGLFunctions_4_0_Compatibility::isContextCompatible(context))
151 QOpenGLVersionFunctionsBackend* d =
nullptr;
152 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
153 d_1_0_Core =
static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
156 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
157 d_1_1_Core =
static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
160 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
161 d_1_2_Core =
static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
164 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
165 d_1_3_Core =
static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
168 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
169 d_1_4_Core =
static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
172 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
173 d_1_5_Core =
static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
176 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
177 d_2_0_Core =
static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
180 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
181 d_2_1_Core =
static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
184 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
185 d_3_0_Core =
static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
188 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
189 d_3_1_Core =
static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
192 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
193 d_3_2_Core =
static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
196 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
197 d_3_3_Core =
static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
200 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
201 d_4_0_Core =
static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
204 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
205 d_1_0_Deprecated =
static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
208 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
209 d_1_1_Deprecated =
static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
212 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
213 d_1_2_Deprecated =
static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
216 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
217 d_1_3_Deprecated =
static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
220 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
221 d_1_4_Deprecated =
static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
224 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_DeprecatedBackend::versionStatus());
225 d_3_3_Deprecated =
static_cast<QOpenGLFunctions_3_3_DeprecatedBackend*>(d);
228 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
230 return isInitialized();