Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qopenglfunctions_1_3.cpp
Go to the documentation of this file.
1// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3/***************************************************************************
4** This file was generated by glgen version 0.1
5** Command line was: glgen
6**
7** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
8**
9** This is an auto-generated file.
10** Do not edit! All changes made to it will be lost.
11**
12****************************************************************************/
13// Qt-Security score:significant reason:default
14
16#include "qopenglcontext.h"
17
19
20/*!
21 \class QOpenGLFunctions_1_3
22 \inmodule QtOpenGL
23 \since 5.1
24 \wrapper
25 \brief The QOpenGLFunctions_1_3 class provides all functions for OpenGL 1.3 specification.
26
27 This class is a wrapper for functions from OpenGL 1.3 specification.
28 See reference pages on \l {http://www.opengl.org/sdk/docs/}{opengl.org}
29 for function documentation.
30
31 \sa QAbstractOpenGLFunctions
32*/
33
34QOpenGLFunctions_1_3::QOpenGLFunctions_1_3()
35 : QAbstractOpenGLFunctions()
36 , d_1_0_Core(nullptr)
37 , d_1_1_Core(nullptr)
38 , d_1_2_Core(nullptr)
39 , d_1_3_Core(nullptr)
40 , d_1_0_Deprecated(nullptr)
41 , d_1_1_Deprecated(nullptr)
42 , d_1_2_Deprecated(nullptr)
43 , d_1_3_Deprecated(nullptr)
44{
45}
46
47QOpenGLFunctions_1_3::~QOpenGLFunctions_1_3()
48{
49 if (d_1_0_Core) {
50 d_1_0_Core->refs.deref();
51 Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
52 }
53 if (d_1_1_Core) {
54 d_1_1_Core->refs.deref();
55 Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
56 }
57 if (d_1_2_Core) {
58 d_1_2_Core->refs.deref();
59 Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
60 }
61 if (d_1_3_Core) {
62 d_1_3_Core->refs.deref();
63 Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
64 }
65 if (d_1_0_Deprecated) {
66 d_1_0_Deprecated->refs.deref();
67 Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
68 }
69 if (d_1_1_Deprecated) {
70 d_1_1_Deprecated->refs.deref();
71 Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
72 }
73 if (d_1_2_Deprecated) {
74 d_1_2_Deprecated->refs.deref();
75 Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
76 }
77 if (d_1_3_Deprecated) {
78 d_1_3_Deprecated->refs.deref();
79 Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
80 }
81}
82
83bool QOpenGLFunctions_1_3::initializeOpenGLFunctions()
84{
85 if ( isInitialized() )
86 return true;
87
88 QOpenGLContext* context = QOpenGLContext::currentContext();
89
90 // If owned by a context object make sure it is current.
91 // Also check that current context is capable of resolving all needed functions
92 if (((owningContext() && owningContext() == context) || !owningContext())
93 && QOpenGLFunctions_1_3::isContextCompatible(context))
94 {
95 // Associate with private implementation, creating if necessary
96 // Function pointers in the backends are resolved at creation time
97 QOpenGLVersionFunctionsBackend* d = nullptr;
98 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
99 d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
100 d->refs.ref();
101
102 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
103 d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
104 d->refs.ref();
105
106 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
107 d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
108 d->refs.ref();
109
110 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
111 d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
112 d->refs.ref();
113
114 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
115 d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
116 d->refs.ref();
117
118 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
119 d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
120 d->refs.ref();
121
122 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
123 d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
124 d->refs.ref();
125
126 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
127 d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
128 d->refs.ref();
129
130 QAbstractOpenGLFunctions::initializeOpenGLFunctions();
131 }
132 return isInitialized();
133}
134
135bool QOpenGLFunctions_1_3::isContextCompatible(QOpenGLContext *context)
136{
137 Q_ASSERT(context);
138 QSurfaceFormat f = context->format();
139 const auto v = std::pair(f.majorVersion(), f.minorVersion());
140 if (v < std::pair(1, 3))
141 return false;
142
143 if (f.profile() == QSurfaceFormat::CoreProfile)
144 return false;
145
146 return true;
147}
148
149QOpenGLVersionProfile QOpenGLFunctions_1_3::versionProfile()
150{
151 QOpenGLVersionProfile v;
152 v.setVersion(1, 3);
153 return v;
154}
155
156QT_END_NAMESPACE
Combined button and popup list for selecting options.