qopenglfunctions_1_2.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_1_2.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32**-
33** This file was generated by glgen version 0.1-
34** Command line was: glgen-
35**-
36** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)-
37**-
38** This is an auto-generated file.-
39** Do not edit! All changes made to it will be lost.-
40**-
41****************************************************************************/-
42-
43#include "qopenglfunctions_1_2.h"-
44#include "qopenglcontext.h"-
45-
46QT_BEGIN_NAMESPACE-
47-
48/*!-
49 \class QOpenGLFunctions_1_2-
50 \inmodule QtGui-
51 \since 5.1-
52 \wrapper-
53 \brief The QOpenGLFunctions_1_2 class provides all functions for OpenGL 1.2 specification.-
54-
55 This class is a wrapper for functions from OpenGL 1.2 specification.-
56 See reference pages on \l {http://www.opengl.org/sdk/docs/}{opengl.org}-
57 for function documentation.-
58-
59 \sa QAbstractOpenGLFunctions-
60*/-
61-
62QOpenGLFunctions_1_2::QOpenGLFunctions_1_2()-
63 : QAbstractOpenGLFunctions()-
64 , d_1_0_Core(0)-
65 , d_1_1_Core(0)-
66 , d_1_2_Core(0)-
67 , d_1_0_Deprecated(0)-
68 , d_1_1_Deprecated(0)-
69 , d_1_2_Deprecated(0)-
70{-
71}
never executed: end of block
0
72-
73QOpenGLFunctions_1_2::~QOpenGLFunctions_1_2()-
74{-
75 if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
d_1_0_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_0_Core->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
76 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());-
77 delete d_1_0_Core;-
78 }
never executed: end of block
0
79 if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
d_1_1_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_1_Core->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
80 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());-
81 delete d_1_1_Core;-
82 }
never executed: end of block
0
83 if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
d_1_2_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_2_Core->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
84 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());-
85 delete d_1_2_Core;-
86 }
never executed: end of block
0
87 if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
d_1_0_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_0_Depreca...->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
88 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());-
89 delete d_1_0_Deprecated;-
90 }
never executed: end of block
0
91 if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
d_1_1_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_1_Depreca...->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
92 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());-
93 delete d_1_1_Deprecated;-
94 }
never executed: end of block
0
95 if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
d_1_2_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
!d_1_2_Depreca...->refs.deref()Description
TRUEnever evaluated
FALSEnever evaluated
0
96 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());-
97 delete d_1_2_Deprecated;-
98 }
never executed: end of block
0
99}
never executed: end of block
0
100-
101bool QOpenGLFunctions_1_2::initializeOpenGLFunctions()-
102{-
103 if ( isInitialized() )
isInitialized()Description
TRUEnever evaluated
FALSEnever evaluated
0
104 return true;
never executed: return true;
0
105-
106 QOpenGLContext* context = QOpenGLContext::currentContext();-
107-
108 // If owned by a context object make sure it is current.-
109 // Also check that current context is capable of resolving all needed functions-
110 if (((owningContext() && owningContext() == context) || !owningContext())
owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
owningContext() == contextDescription
TRUEnever evaluated
FALSEnever evaluated
!owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
0
111 && QOpenGLFunctions_1_2::isContextCompatible(context))
QOpenGLFunctio...tible(context)Description
TRUEnever evaluated
FALSEnever evaluated
0
112 {-
113 // Associate with private implementation, creating if necessary-
114 // Function pointers in the backends are resolved at creation time-
115 QOpenGLVersionFunctionsBackend* d = 0;-
116 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());-
117 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
118 d = new QOpenGLFunctions_1_0_CoreBackend(context);-
119 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);-
120 }
never executed: end of block
0
121 d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);-
122 d->refs.ref();-
123-
124 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());-
125 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
126 d = new QOpenGLFunctions_1_1_CoreBackend(context);-
127 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);-
128 }
never executed: end of block
0
129 d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);-
130 d->refs.ref();-
131-
132 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());-
133 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
134 d = new QOpenGLFunctions_1_2_CoreBackend(context);-
135 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);-
136 }
never executed: end of block
0
137 d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);-
138 d->refs.ref();-
139-
140 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());-
141 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
142 d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);-
143 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);-
144 }
never executed: end of block
0
145 d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);-
146 d->refs.ref();-
147-
148 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());-
149 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
150 d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);-
151 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);-
152 }
never executed: end of block
0
153 d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);-
154 d->refs.ref();-
155-
156 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());-
157 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
158 d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);-
159 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);-
160 }
never executed: end of block
0
161 d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);-
162 d->refs.ref();-
163-
164 QAbstractOpenGLFunctions::initializeOpenGLFunctions();-
165 }
never executed: end of block
0
166 return isInitialized();
never executed: return isInitialized();
0
167}-
168-
169bool QOpenGLFunctions_1_2::isContextCompatible(QOpenGLContext *context)-
170{-
171 Q_ASSERT(context);-
172 QSurfaceFormat f = context->format();-
173 const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());-
174 if (v < qMakePair(1, 2))
v < qMakePair(1, 2)Description
TRUEnever evaluated
FALSEnever evaluated
0
175 return false;
never executed: return false;
0
176-
177 if (f.profile() == QSurfaceFormat::CoreProfile)
f.profile() ==...t::CoreProfileDescription
TRUEnever evaluated
FALSEnever evaluated
0
178 return false;
never executed: return false;
0
179-
180 return true;
never executed: return true;
0
181}-
182-
183QOpenGLVersionProfile QOpenGLFunctions_1_2::versionProfile()-
184{-
185 QOpenGLVersionProfile v;-
186 v.setVersion(1, 2);-
187 return v;
never executed: return v;
0
188}-
189-
190QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9