qopenglfunctions_1_1.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_1_1.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_1.h"-
44#include "qopenglcontext.h"-
45-
46QT_BEGIN_NAMESPACE-
47-
48/*!-
49 \class QOpenGLFunctions_1_1-
50 \inmodule QtGui-
51 \since 5.1-
52 \wrapper-
53 \brief The QOpenGLFunctions_1_1 class provides all functions for OpenGL 1.1 specification.-
54-
55 This class is a wrapper for functions from OpenGL 1.1 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_1::QOpenGLFunctions_1_1()-
63 : QAbstractOpenGLFunctions()-
64 , d_1_0_Core(0)-
65 , d_1_1_Core(0)-
66 , d_1_0_Deprecated(0)-
67 , d_1_1_Deprecated(0)-
68{-
69}
never executed: end of block
0
70-
71QOpenGLFunctions_1_1::~QOpenGLFunctions_1_1()-
72{-
73 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
74 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());-
75 delete d_1_0_Core;-
76 }
never executed: end of block
0
77 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
78 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());-
79 delete d_1_1_Core;-
80 }
never executed: end of block
0
81 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
82 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());-
83 delete d_1_0_Deprecated;-
84 }
never executed: end of block
0
85 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
86 QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());-
87 delete d_1_1_Deprecated;-
88 }
never executed: end of block
0
89}
never executed: end of block
0
90-
91bool QOpenGLFunctions_1_1::initializeOpenGLFunctions()-
92{-
93 if ( isInitialized() )
isInitialized()Description
TRUEnever evaluated
FALSEnever evaluated
0
94 return true;
never executed: return true;
0
95-
96 QOpenGLContext* context = QOpenGLContext::currentContext();-
97-
98 // If owned by a context object make sure it is current.-
99 // Also check that current context is capable of resolving all needed functions-
100 if (((owningContext() && owningContext() == context) || !owningContext())
owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
owningContext() == contextDescription
TRUEnever evaluated
FALSEnever evaluated
!owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
0
101 && QOpenGLFunctions_1_1::isContextCompatible(context))
QOpenGLFunctio...tible(context)Description
TRUEnever evaluated
FALSEnever evaluated
0
102 {-
103 // Associate with private implementation, creating if necessary-
104 // Function pointers in the backends are resolved at creation time-
105 QOpenGLVersionFunctionsBackend* d = 0;-
106 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());-
107 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
108 d = new QOpenGLFunctions_1_0_CoreBackend(context);-
109 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);-
110 }
never executed: end of block
0
111 d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);-
112 d->refs.ref();-
113-
114 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());-
115 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
116 d = new QOpenGLFunctions_1_1_CoreBackend(context);-
117 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);-
118 }
never executed: end of block
0
119 d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);-
120 d->refs.ref();-
121-
122 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());-
123 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
124 d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);-
125 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);-
126 }
never executed: end of block
0
127 d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);-
128 d->refs.ref();-
129-
130 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());-
131 if (!d) {
!dDescription
TRUEnever evaluated
FALSEnever evaluated
0
132 d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);-
133 QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);-
134 }
never executed: end of block
0
135 d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);-
136 d->refs.ref();-
137-
138 QAbstractOpenGLFunctions::initializeOpenGLFunctions();-
139 }
never executed: end of block
0
140 return isInitialized();
never executed: return isInitialized();
0
141}-
142-
143bool QOpenGLFunctions_1_1::isContextCompatible(QOpenGLContext *context)-
144{-
145 Q_ASSERT(context);-
146 QSurfaceFormat f = context->format();-
147 const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());-
148 if (v < qMakePair(1, 1))
v < qMakePair(1, 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
149 return false;
never executed: return false;
0
150-
151 if (f.profile() == QSurfaceFormat::CoreProfile)
f.profile() ==...t::CoreProfileDescription
TRUEnever evaluated
FALSEnever evaluated
0
152 return false;
never executed: return false;
0
153-
154 return true;
never executed: return true;
0
155}-
156-
157QOpenGLVersionProfile QOpenGLFunctions_1_1::versionProfile()-
158{-
159 QOpenGLVersionProfile v;-
160 v.setVersion(1, 1);-
161 return v;
never executed: return v;
0
162}-
163-
164QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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