50QOpenGLFunctions_2_0::~QOpenGLFunctions_2_0()
53 d_1_0_Core->refs.deref();
54 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
57 d_1_1_Core->refs.deref();
58 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
61 d_1_2_Core->refs.deref();
62 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
65 d_1_3_Core->refs.deref();
66 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
69 d_1_4_Core->refs.deref();
70 Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
73 d_1_5_Core->refs.deref();
74 Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
77 d_2_0_Core->refs.deref();
78 Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
80 if (d_1_0_Deprecated) {
81 d_1_0_Deprecated->refs.deref();
82 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
84 if (d_1_1_Deprecated) {
85 d_1_1_Deprecated->refs.deref();
86 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
88 if (d_1_2_Deprecated) {
89 d_1_2_Deprecated->refs.deref();
90 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
92 if (d_1_3_Deprecated) {
93 d_1_3_Deprecated->refs.deref();
94 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
96 if (d_1_4_Deprecated) {
97 d_1_4_Deprecated->refs.deref();
98 Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
102bool QOpenGLFunctions_2_0::initializeOpenGLFunctions()
104 if ( isInitialized() )
107 QOpenGLContext* context = QOpenGLContext::currentContext();
111 if (((owningContext() && owningContext() == context) || !owningContext())
112 && QOpenGLFunctions_2_0::isContextCompatible(context))
116 QOpenGLVersionFunctionsBackend* d =
nullptr;
117 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
118 d_1_0_Core =
static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
121 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
122 d_1_1_Core =
static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
125 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
126 d_1_2_Core =
static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
129 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
130 d_1_3_Core =
static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
133 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
134 d_1_4_Core =
static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
137 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
138 d_1_5_Core =
static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
141 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
142 d_2_0_Core =
static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
145 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
146 d_1_0_Deprecated =
static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
149 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
150 d_1_1_Deprecated =
static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
153 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
154 d_1_2_Deprecated =
static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
157 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
158 d_1_3_Deprecated =
static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
161 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
162 d_1_4_Deprecated =
static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
165 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
167 return isInitialized();