OpenGL: Add a set of version and context specific OpenGL classes

This commit adds part of the output of utils/glgen and some simple
modifications to QOpenGLContext to allow easy access to classes
containing functions specific to a given OpenGL context and version.

This allows compile-time detection of mis-use of OpenGL features.
For example, trying to use glBegin(GL_TRIANGLES) with an OpenGL 3.2
Core Profile context will be detected by the compiler rather than at
runtime.

These capabilities make it much easier to add functionality to Qt and
applications that relies upon core features of OpenGL from specific
versions e.g. geometry shaders.

Change-Id: Ieb584a489792595f831bc77dee84935c03bb5a64
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
bb10
Sean Harmer 2012-09-22 16:34:21 +01:00 committed by The Qt Project
parent 4b1332783e
commit 10aa64d74c
55 changed files with 85644 additions and 2 deletions

View File

@ -54,11 +54,163 @@
#include <QtGui/QScreen>
#include <private/qopenglextensions_p.h>
#include <private/qopenglversionfunctionsfactory_p.h>
#include <QDebug>
QT_BEGIN_NAMESPACE
class QOpenGLVersionProfilePrivate
{
public:
QOpenGLVersionProfilePrivate()
: majorVersion(0),
minorVersion(0),
profile(QSurfaceFormat::NoProfile)
{}
int majorVersion;
int minorVersion;
QSurfaceFormat::OpenGLContextProfile profile;
};
/*!
\class QOpenGLVersionProfile
\inmodule QtGui
\since 5.1
\brief The QOpenGLVersionProfile class represents the version and if applicable
the profile of an OpenGL context.
An object of this class can be passed to QOpenGLContext::versionFunctions() to
request a functions object for a specific version and profile of OpenGL.
It also contains some helper functions to check if a version supports profiles
or is a legacy version.
*/
/*!
Creates a default invalid QOpenGLVersionProfile object.
*/
QOpenGLVersionProfile::QOpenGLVersionProfile()
: d(new QOpenGLVersionProfilePrivate)
{
}
/*!
Creates a QOpenGLVersionProfile object initialised with the version and profile
from \a format.
*/
QOpenGLVersionProfile::QOpenGLVersionProfile(const QSurfaceFormat &format)
: d(new QOpenGLVersionProfilePrivate)
{
d->majorVersion = format.majorVersion();
d->minorVersion = format.minorVersion();
d->profile = format.profile();
}
/*!
Constructs a copy of \a other.
*/
QOpenGLVersionProfile::QOpenGLVersionProfile(const QOpenGLVersionProfile &other)
: d(new QOpenGLVersionProfilePrivate)
{
*d = *(other.d);
}
/*!
Destroys the QOpenGLVersionProfile object.
*/
QOpenGLVersionProfile::~QOpenGLVersionProfile()
{
delete d;
}
/*!
Assigns the version and profile of \a rhs to this QOpenGLVersionProfile object.
*/
QOpenGLVersionProfile &QOpenGLVersionProfile::operator=(const QOpenGLVersionProfile &rhs)
{
if (this == &rhs)
return *this;
*d = *(rhs.d);
return *this;
}
/*!
Returns a QPair<int,int> where the components represent the major and minor OpenGL
version numbers respectively.
\sa setVersion()
*/
QPair<int, int> QOpenGLVersionProfile::version() const
{
return qMakePair( d->majorVersion, d->minorVersion);
}
/*!
Sets the major and minor version numbers to \a majorVersion and \a minorVersion respectively.
\sa version()
*/
void QOpenGLVersionProfile::setVersion(int majorVersion, int minorVersion)
{
d->majorVersion = majorVersion;
d->minorVersion = minorVersion;
}
/*!
Returns the OpenGL profile. Only make sense if profiles are supported by this version.
\sa setProfile(), supportsProfiles()
*/
QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const
{
return d->profile;
}
/*!
Sets the profile. Only make sense if profiles are supported by this version.
\sa profile(), supportsProfiles()
*/
void QOpenGLVersionProfile::setProfile(QSurfaceFormat::OpenGLContextProfile profile)
{
d->profile = profile;
}
/*!
Returns true if profiles are supported by the OpenGL version returned by version(). Only
OpenGL versions >= 3.2 support profiles.
\sa profile(), version()
*/
bool QOpenGLVersionProfile::hasProfiles() const
{
return ( d->majorVersion > 3
|| (d->majorVersion == 3 && d->minorVersion > 1));
}
/*!
Returns true is the OpenGL version returned by version() contains deprecated functions
and does not support profiles i.e. if the OpenGL version is <= 3.1.
*/
bool QOpenGLVersionProfile::isLegacyVersion() const
{
return (d->majorVersion < 3 || (d->majorVersion == 3 && d->minorVersion == 0));
}
/*!
Returns true if the version number is valid. Note that for a default constructed
QOpenGLVersionProfile object this function will return false.
\sa setVersion(), version()
*/
bool QOpenGLVersionProfile::isValid() const
{
return d->majorVersion > 0 && d->minorVersion >= 0;
}
class QGuiGLThreadContext
{
public:
@ -367,6 +519,10 @@ void QOpenGLContext::destroy()
d->platformGLContext = 0;
delete d->functions;
d->functions = 0;
qDeleteAll(d->versionFunctions);
d->versionFunctions.clear();
qDeleteAll(d->versionFunctionsBackend);
d->versionFunctionsBackend.clear();
}
/*!
@ -424,6 +580,97 @@ QOpenGLFunctions *QOpenGLContext::functions() const
return d->functions;
}
/*!
\fn T *QOpenGLContext::versionFunctions() const
Returns a pointer to an object that provides access to all functions for
the version and profile of this context. Before using any of the functions
they must be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions().
Usually one would use the template version of this function to automatically
have the result cast to the correct type.
\code
QOpenGLFunctions_3_3_Core* funcs = 0;
funcs = context->versionFunctions<QOpenGLFunctions_3_3_Core>();
if (!funcs) {
qWarning() << "Could not obtain required OpenGL context version";
exit(1);
}
funcs->initializeOpenGLFunctions(context);
\endcode
It is possible to request a functions object for a different version and profile
than that for which the context was created. To do this either use the template
version of this function specifying the desired functions object type as the
template parameter or by passing in a QOpenGLVersionProfile object as an argument
to the non-template function.
Note that requests for function objects of other versions or profiles can fail and
in doing so will return a null pointer. Situations in which creation of the functions
object can fail are if the request cannot be satisfied due to asking for functions
that are not in the version or profile of this context. For example:
\list
\li Requesting a 3.3 core profile functions object would succeed.
\li Requesting a 3.3 compatibility profile functions object would fail. We would fail
to resolve the deprecated functions.
\li Requesting a 4.3 core profile functions object would fail. We would fail to resolve
the new core functions introduced in versions 4.0-4.3.
\li Requesting a 3.1 functions object would succeed. There is nothing in 3.1 that is not
also in 3.3 core.
\endlist
Note that if creating a functions object via this method that the QOpenGLContext
retains ownership of the object. This is to allow the object to be cached and shared.
*/
/*!
Returns a pointer to an object that provides access to all functions for
the version of the current context. Before using any of the functions
they must be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions().
Usually one would use the template version of this function to automatically
have the result cast to the correct type.
\sa T *QOpenGLContext::versionFunctions()
*/
QAbstractOpenGLFunctions *QOpenGLContext::versionFunctions(const QOpenGLVersionProfile &versionProfile) const
{
Q_D(const QOpenGLContext);
const QSurfaceFormat f = format();
// Ensure we have a valid version and profile. Default to context's if none specified
QOpenGLVersionProfile vp = versionProfile;
if (!vp.isValid())
vp = QOpenGLVersionProfile(f);
// Check that context is compatible with requested version
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < vp.version())
return 0;
// If this context only offers core profile functions then we can't create
// function objects for legacy or compatibility profile requests
if (((vp.hasProfiles() && vp.profile() != QSurfaceFormat::CoreProfile) || vp.isLegacyVersion())
&& f.profile() == QSurfaceFormat::CoreProfile)
return 0;
// Create object if suitable one not cached
QAbstractOpenGLFunctions* funcs = 0;
if (!d->versionFunctions.contains(vp)) {
funcs = QOpenGLVersionFunctionsFactory::create(vp);
if (funcs) {
funcs->setOwningContext(this);
d->versionFunctions.insert(vp, funcs);
}
} else {
funcs = d->versionFunctions.value(vp);
}
return funcs;
}
/*!
Returns the set of OpenGL extensions supported by this context.
@ -701,6 +948,34 @@ void QOpenGLContext::deleteQGLContext()
}
}
/*!
\internal
*/
QOpenGLVersionFunctionsBackend *QOpenGLContext::functionsBackend(const QOpenGLVersionStatus &v) const
{
Q_D(const QOpenGLContext);
return d->versionFunctionsBackend.value(v, 0);
}
/*!
\internal
*/
void QOpenGLContext::insertFunctionsBackend(const QOpenGLVersionStatus &v,
QOpenGLVersionFunctionsBackend *backend)
{
Q_D(QOpenGLContext);
d->versionFunctionsBackend.insert(v, backend);
}
/*!
\internal
*/
void QOpenGLContext::removeFunctionsBackend(const QOpenGLVersionStatus &v)
{
Q_D(QOpenGLContext);
d->versionFunctionsBackend.remove(v);
}
/*!
\class QOpenGLContextGroup
\since 5.0

View File

@ -58,6 +58,10 @@
#endif
#include <QtGui/qopengl.h>
#include <QtGui/qopenglversionfunctions.h>
#include <QtCore/qhash.h>
#include <QtCore/qpair.h>
QT_BEGIN_NAMESPACE
@ -69,6 +73,50 @@ class QPlatformOpenGLContext;
class QScreen;
class QSurface;
class QOpenGLVersionProfilePrivate;
class Q_GUI_EXPORT QOpenGLVersionProfile
{
public:
QOpenGLVersionProfile();
explicit QOpenGLVersionProfile(const QSurfaceFormat &format);
QOpenGLVersionProfile(const QOpenGLVersionProfile &other);
~QOpenGLVersionProfile();
QOpenGLVersionProfile &operator=(const QOpenGLVersionProfile &rhs);
QPair<int, int> version() const;
void setVersion(int majorVersion, int minorVersion);
QSurfaceFormat::OpenGLContextProfile profile() const;
void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
bool hasProfiles() const;
bool isLegacyVersion() const;
bool isValid() const;
private:
QOpenGLVersionProfilePrivate* d;
};
inline uint qHash(const QOpenGLVersionProfile &v, uint seed)
{
return qHash(static_cast<int>(v.profile() * 1000)
+ v.version().first * 100 + v.version().second * 10, seed);
}
inline bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs)
{
if (lhs.profile() != rhs.profile())
return false;
return lhs.version() == rhs.version();
}
inline bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs)
{
return !operator==(lhs, rhs);
}
class Q_GUI_EXPORT QOpenGLContextGroup : public QObject
{
Q_OBJECT
@ -127,6 +175,15 @@ public:
QOpenGLFunctions *functions() const;
QAbstractOpenGLFunctions *versionFunctions(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile()) const;
template<class TYPE>
TYPE *versionFunctions() const
{
QOpenGLVersionProfile v = TYPE::versionProfile();
return static_cast<TYPE*>(versionFunctions(v));
}
QSet<QByteArray> extensions() const;
bool hasExtension(const QByteArray &extension) const;
@ -147,11 +204,17 @@ private:
friend class QOpenGL2PaintEngineExPrivate;
friend class QSGDistanceFieldGlyphCache;
friend class QWidgetPrivate;
friend class QAbstractOpenGLFunctionsPrivate;
void *qGLContextHandle() const;
void setQGLContextHandle(void *handle,void (*qGLContextDeleteFunction)(void *));
void deleteQGLContext();
QOpenGLVersionFunctionsBackend* functionsBackend(const QOpenGLVersionStatus &v) const;
void insertFunctionsBackend(const QOpenGLVersionStatus &v,
QOpenGLVersionFunctionsBackend *backend);
void removeFunctionsBackend(const QOpenGLVersionStatus &v);
void destroy();
};

View File

@ -213,6 +213,9 @@ public:
//QWidgetPrivate::deleteTLSysExtra()
}
mutable QHash<QOpenGLVersionProfile, QAbstractOpenGLFunctions *> versionFunctions;
mutable QHash<QOpenGLVersionStatus, QOpenGLVersionFunctionsBackend *> versionFunctionsBackend;
void *qGLContextHandle;
void (*qGLContextDeleteFunction)(void *handle);

View File

@ -27,7 +27,9 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglshadercache_p.h \
opengl/qopenglshadercache_meego_p.h \
opengl/qtriangulator_p.h \
opengl/qrbtree_p.h
opengl/qrbtree_p.h \
opengl/qopenglversionfunctions.h \
opengl/qopenglversionfunctionsfactory_p.h
SOURCES += opengl/qopengl.cpp \
opengl/qopenglfunctions.cpp \
@ -43,6 +45,62 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglcustomshaderstage.cpp \
opengl/qtriangulatingstroker.cpp \
opengl/qopengltextureglyphcache.cpp \
opengl/qtriangulator.cpp
opengl/qtriangulator.cpp \
opengl/qopenglversionfunctions.cpp \
opengl/qopenglversionfunctionsfactory.cpp
!contains(QT_CONFIG, opengles2) {
HEADERS += opengl/qopenglfunctions_1_0.h \
opengl/qopenglfunctions_1_1.h \
opengl/qopenglfunctions_1_2.h \
opengl/qopenglfunctions_1_3.h \
opengl/qopenglfunctions_1_4.h \
opengl/qopenglfunctions_1_5.h \
opengl/qopenglfunctions_2_0.h \
opengl/qopenglfunctions_2_1.h \
opengl/qopenglfunctions_3_0.h \
opengl/qopenglfunctions_3_1.h \
opengl/qopenglfunctions_3_2_core.h \
opengl/qopenglfunctions_3_3_core.h \
opengl/qopenglfunctions_4_0_core.h \
opengl/qopenglfunctions_4_1_core.h \
opengl/qopenglfunctions_4_2_core.h \
opengl/qopenglfunctions_4_3_core.h \
opengl/qopenglfunctions_3_2_compatibility.h \
opengl/qopenglfunctions_3_3_compatibility.h \
opengl/qopenglfunctions_4_0_compatibility.h \
opengl/qopenglfunctions_4_1_compatibility.h \
opengl/qopenglfunctions_4_2_compatibility.h \
opengl/qopenglfunctions_4_3_compatibility.h
SOURCES += opengl/qopenglfunctions_1_0.cpp \
opengl/qopenglfunctions_1_1.cpp \
opengl/qopenglfunctions_1_2.cpp \
opengl/qopenglfunctions_1_3.cpp \
opengl/qopenglfunctions_1_4.cpp \
opengl/qopenglfunctions_1_5.cpp \
opengl/qopenglfunctions_2_0.cpp \
opengl/qopenglfunctions_2_1.cpp \
opengl/qopenglfunctions_3_0.cpp \
opengl/qopenglfunctions_3_1.cpp \
opengl/qopenglfunctions_3_2_core.cpp \
opengl/qopenglfunctions_3_3_core.cpp \
opengl/qopenglfunctions_4_0_core.cpp \
opengl/qopenglfunctions_4_1_core.cpp \
opengl/qopenglfunctions_4_2_core.cpp \
opengl/qopenglfunctions_4_3_core.cpp \
opengl/qopenglfunctions_3_2_compatibility.cpp \
opengl/qopenglfunctions_3_3_compatibility.cpp \
opengl/qopenglfunctions_4_0_compatibility.cpp \
opengl/qopenglfunctions_4_1_compatibility.cpp \
opengl/qopenglfunctions_4_2_compatibility.cpp \
opengl/qopenglfunctions_4_3_compatibility.cpp
}
contains(QT_CONFIG, opengles2) {
HEADERS += opengl/qopenglfunctions_es2.h
SOURCES += opengl/qopenglfunctions_es2.cpp
}
}

View File

@ -108,6 +108,135 @@ typedef GLfloat GLdouble;
QT_BEGIN_NAMESPACE
// When all else fails we provide sensible fallbacks - this is needed to
// allow compilation on OS X 10.6
#if !defined(QT_OPENGL_ES_2)
// OS X 10.6 doesn't define these which are needed below
// OS X 10.7 and later defien them in gl3.h
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
// This block is copied from glext.h and defines the types needed by
// a few extension classes.
#include <stddef.h>
#ifndef GL_VERSION_2_0
/* GL type for program/shader text */
typedef char GLchar;
#endif
#ifndef GL_VERSION_1_5
/* GL types for handling large vertex buffer objects */
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
#endif
#ifndef GL_ARB_vertex_buffer_object
/* GL types for handling large vertex buffer objects */
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
#endif
#ifndef GL_ARB_shader_objects
/* GL types for program/shader text and shader object handles */
typedef char GLcharARB;
typedef unsigned int GLhandleARB;
#endif
/* GL type for "half" precision (s10e5) float data in host memory */
#ifndef GL_ARB_half_float_pixel
typedef unsigned short GLhalfARB;
#endif
#ifndef GL_NV_half_float
typedef unsigned short GLhalfNV;
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glxext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GL_EXT_timer_query extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#endif
#ifndef GL_EXT_timer_query
typedef int64_t GLint64EXT;
typedef uint64_t GLuint64EXT;
#endif
#ifndef GL_ARB_sync
typedef int64_t GLint64;
typedef uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#endif
#ifndef GL_ARB_cl_event
/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
struct _cl_context;
struct _cl_event;
#endif
#ifndef GL_ARB_debug_output
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
#endif
#ifndef GL_AMD_debug_output
typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
#endif
#ifndef GL_KHR_debug
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
#endif
#ifndef GL_NV_vdpau_interop
typedef GLintptr GLvdpauSurfaceNV;
#endif
// End of block copied from glext.h
#endif
// Types that aren't defined in all system's gl.h files.
typedef ptrdiff_t qopengl_GLintptr;
typedef ptrdiff_t qopengl_GLsizeiptr;

View File

@ -0,0 +1,141 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_0.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_0
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_0 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_0::QOpenGLFunctions_1_0()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_0_Deprecated(0)
{
}
QOpenGLFunctions_1_0::~QOpenGLFunctions_1_0()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
}
bool QOpenGLFunctions_1_0::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_0::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_0::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 0))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_0::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 0);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,167 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_1.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_1
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_1 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_1::QOpenGLFunctions_1_1()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
{
}
QOpenGLFunctions_1_1::~QOpenGLFunctions_1_1()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
}
bool QOpenGLFunctions_1_1::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_1::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_1::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 1))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_1::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 1);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,193 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_2.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_2
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_2 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_2::QOpenGLFunctions_1_2()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
{
}
QOpenGLFunctions_1_2::~QOpenGLFunctions_1_2()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
}
bool QOpenGLFunctions_1_2::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_2::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_2::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 2))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_2::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 2);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_3.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_3
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_3 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_3::QOpenGLFunctions_1_3()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
{
}
QOpenGLFunctions_1_3::~QOpenGLFunctions_1_3()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
}
bool QOpenGLFunctions_1_3::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_3::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_3::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 3))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_3::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 3);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,245 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_4.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_4
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_4 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_4::QOpenGLFunctions_1_4()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
{
}
QOpenGLFunctions_1_4::~QOpenGLFunctions_1_4()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
}
bool QOpenGLFunctions_1_4::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_4::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_4::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 4))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_4::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 4);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,258 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_1_5.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_5
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_1_5 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_1_5::QOpenGLFunctions_1_5()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
{
}
QOpenGLFunctions_1_5::~QOpenGLFunctions_1_5()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
}
bool QOpenGLFunctions_1_5::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_1_5::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_1_5::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(1, 5))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_1_5::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(1, 5);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,284 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_2_0.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_2_0
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_2_0 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_2_0::QOpenGLFunctions_2_0()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
{
}
QOpenGLFunctions_2_0::~QOpenGLFunctions_2_0()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
}
bool QOpenGLFunctions_2_0::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_2_0::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_2_0::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(2, 0))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_2_0::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(2, 0);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_2_1.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_2_1
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_2_1 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_2_1::QOpenGLFunctions_2_1()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
{
}
QOpenGLFunctions_2_1::~QOpenGLFunctions_2_1()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
}
bool QOpenGLFunctions_2_1::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_2_1::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_2_1::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(2, 1))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_2_1::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(2, 1);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,323 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_0.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_0
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_0 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_0::QOpenGLFunctions_3_0()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_3_0::~QOpenGLFunctions_3_0()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_3_0::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_0::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_0::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 0))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_0::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 0);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,242 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_1.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_1
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_1 class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_1::QOpenGLFunctions_3_1()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
{
}
QOpenGLFunctions_3_1::~QOpenGLFunctions_3_1()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
}
bool QOpenGLFunctions_3_1::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_1::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_1::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 1))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_1::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 1);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,350 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_2_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_2_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_2_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_2_Compatibility::QOpenGLFunctions_3_2_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_3_2_Compatibility::~QOpenGLFunctions_3_2_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_3_2_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_2_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_2_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 2))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_2_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 2);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,256 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_2_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_2_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_2_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_2_Core::QOpenGLFunctions_3_2_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
{
}
QOpenGLFunctions_3_2_Core::~QOpenGLFunctions_3_2_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
}
bool QOpenGLFunctions_3_2_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_2_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_2_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 2))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_2_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 2);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,363 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_3_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_3_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_3_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_3_Compatibility::QOpenGLFunctions_3_3_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_3_3_Compatibility::~QOpenGLFunctions_3_3_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_3_3_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_3_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_3_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 3))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_3_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 3);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,269 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_3_3_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_3_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_3_3_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_3_3_Core::QOpenGLFunctions_3_3_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
{
}
QOpenGLFunctions_3_3_Core::~QOpenGLFunctions_3_3_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
}
bool QOpenGLFunctions_3_3_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_3_3_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_3_3_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(3, 3))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_3_3_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(3, 3);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,376 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_0_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_0_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_0_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_0_Compatibility::QOpenGLFunctions_4_0_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_4_0_Compatibility::~QOpenGLFunctions_4_0_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_4_0_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_0_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_0_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 0))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_0_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 0);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,282 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_0_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_0_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_0_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_0_Core::QOpenGLFunctions_4_0_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
{
}
QOpenGLFunctions_4_0_Core::~QOpenGLFunctions_4_0_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
}
bool QOpenGLFunctions_4_0_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_0_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_0_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 0))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_0_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 0);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,389 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_1_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_1_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_1_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_1_Compatibility::QOpenGLFunctions_4_1_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_4_1_Compatibility::~QOpenGLFunctions_4_1_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_4_1_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_1_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_1_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 1))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_1_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 1);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,295 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_1_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_1_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_1_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_1_Core::QOpenGLFunctions_4_1_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
{
}
QOpenGLFunctions_4_1_Core::~QOpenGLFunctions_4_1_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
}
bool QOpenGLFunctions_4_1_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_1_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_1_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 1))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_1_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 1);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,402 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_2_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_2_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_2_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_2_Compatibility::QOpenGLFunctions_4_2_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
, d_4_2_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_4_2_Compatibility::~QOpenGLFunctions_4_2_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
if (d_4_2_Core && !d_4_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_2_Core->context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
delete d_4_2_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_4_2_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_2_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus(), d);
}
d_4_2_Core = static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_2_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 2))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_2_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 2);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,308 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_2_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_2_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_2_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_2_Core::QOpenGLFunctions_4_2_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
, d_4_2_Core(0)
{
}
QOpenGLFunctions_4_2_Core::~QOpenGLFunctions_4_2_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
if (d_4_2_Core && !d_4_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_2_Core->context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
delete d_4_2_Core;
}
}
bool QOpenGLFunctions_4_2_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_2_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus(), d);
}
d_4_2_Core = static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_2_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 2))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_2_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 2);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,415 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_3_compatibility.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_3_Compatibility
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_3_Compatibility class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_3_Compatibility::QOpenGLFunctions_4_3_Compatibility()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
, d_4_2_Core(0)
, d_4_3_Core(0)
, d_1_0_Deprecated(0)
, d_1_1_Deprecated(0)
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
, d_2_0_Deprecated(0)
, d_3_0_Deprecated(0)
{
}
QOpenGLFunctions_4_3_Compatibility::~QOpenGLFunctions_4_3_Compatibility()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
if (d_4_2_Core && !d_4_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_2_Core->context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
delete d_4_2_Core;
}
if (d_4_3_Core && !d_4_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_3_Core->context, QOpenGLFunctions_4_3_CoreBackend::versionStatus());
delete d_4_3_Core;
}
if (d_1_0_Deprecated && !d_1_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Deprecated->context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
delete d_1_0_Deprecated;
}
if (d_1_1_Deprecated && !d_1_1_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Deprecated->context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
delete d_1_1_Deprecated;
}
if (d_1_2_Deprecated && !d_1_2_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Deprecated->context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
delete d_1_2_Deprecated;
}
if (d_1_3_Deprecated && !d_1_3_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Deprecated->context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
delete d_1_3_Deprecated;
}
if (d_1_4_Deprecated && !d_1_4_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Deprecated->context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
delete d_1_4_Deprecated;
}
if (d_2_0_Deprecated && !d_2_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Deprecated->context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
delete d_2_0_Deprecated;
}
if (d_3_0_Deprecated && !d_3_0_Deprecated->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Deprecated->context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
delete d_3_0_Deprecated;
}
}
bool QOpenGLFunctions_4_3_Compatibility::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_3_Compatibility::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus(), d);
}
d_4_2_Core = static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_3_CoreBackend::versionStatus(), d);
}
d_4_3_Core = static_cast<QOpenGLFunctions_4_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d);
}
d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d);
}
d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d);
}
d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d);
}
d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d);
}
d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus(), d);
}
d_2_0_Deprecated = static_cast<QOpenGLFunctions_2_0_DeprecatedBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_DeprecatedBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus(), d);
}
d_3_0_Deprecated = static_cast<QOpenGLFunctions_3_0_DeprecatedBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_3_Compatibility::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 3))
return false;
if (f.profile() == QSurfaceFormat::CoreProfile)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_3_Compatibility::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 3);
v.setProfile(QSurfaceFormat::CompatibilityProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,321 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglfunctions_4_3_core.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_3_Core
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_4_3_Core class provides all functions for this version and profile of OpenGL.
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_4_3_Core::QOpenGLFunctions_4_3_Core()
: QAbstractOpenGLFunctions()
, d_1_0_Core(0)
, d_1_1_Core(0)
, d_1_2_Core(0)
, d_1_3_Core(0)
, d_1_4_Core(0)
, d_1_5_Core(0)
, d_2_0_Core(0)
, d_2_1_Core(0)
, d_3_0_Core(0)
, d_3_1_Core(0)
, d_3_2_Core(0)
, d_3_3_Core(0)
, d_4_0_Core(0)
, d_4_1_Core(0)
, d_4_2_Core(0)
, d_4_3_Core(0)
{
}
QOpenGLFunctions_4_3_Core::~QOpenGLFunctions_4_3_Core()
{
if (d_1_0_Core && !d_1_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
delete d_1_0_Core;
}
if (d_1_1_Core && !d_1_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
delete d_1_1_Core;
}
if (d_1_2_Core && !d_1_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
delete d_1_2_Core;
}
if (d_1_3_Core && !d_1_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
delete d_1_3_Core;
}
if (d_1_4_Core && !d_1_4_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
delete d_1_4_Core;
}
if (d_1_5_Core && !d_1_5_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
delete d_1_5_Core;
}
if (d_2_0_Core && !d_2_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
delete d_2_0_Core;
}
if (d_2_1_Core && !d_2_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
delete d_2_1_Core;
}
if (d_3_0_Core && !d_3_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
delete d_3_0_Core;
}
if (d_3_1_Core && !d_3_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
delete d_3_1_Core;
}
if (d_3_2_Core && !d_3_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
delete d_3_2_Core;
}
if (d_3_3_Core && !d_3_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
delete d_3_3_Core;
}
if (d_4_0_Core && !d_4_0_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
delete d_4_0_Core;
}
if (d_4_1_Core && !d_4_1_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_1_Core->context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
delete d_4_1_Core;
}
if (d_4_2_Core && !d_4_2_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_2_Core->context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
delete d_4_2_Core;
}
if (d_4_3_Core && !d_4_3_Core->refs.deref()) {
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_3_Core->context, QOpenGLFunctions_4_3_CoreBackend::versionStatus());
delete d_4_3_Core;
}
}
bool QOpenGLFunctions_4_3_Core::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is capable of resolving all needed functions
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_4_3_Core::isContextCompatible(context))
{
// Associate with private implementation, creating if necessary
// Function pointers in the backends are resolved at creation time
QOpenGLVersionFunctionsBackend* d = 0;
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d);
}
d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d);
}
d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d);
}
d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d);
}
d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_4_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d);
}
d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_1_5_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d);
}
d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d);
}
d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_2_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d);
}
d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d);
}
d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d);
}
d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d);
}
d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_3_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d);
}
d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_0_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d);
}
d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_1_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus(), d);
}
d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_2_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus(), d);
}
d_4_2_Core = static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);
d->refs.ref();
d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_3_CoreBackend::versionStatus());
if (!d) {
d = new QOpenGLFunctions_4_3_CoreBackend(context);
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_3_CoreBackend::versionStatus(), d);
}
d_4_3_Core = static_cast<QOpenGLFunctions_4_3_CoreBackend*>(d);
d->refs.ref();
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_4_3_Core::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(4, 3))
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_4_3_Core::versionProfile()
{
QOpenGLVersionProfile v;
v.setVersion(4, 3);
v.setProfile(QSurfaceFormat::CoreProfile);
return v;
}
QT_END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,103 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qopenglfunctions_es2.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_ES2
\inmodule QtGui
\since 5.1
\brief The QOpenGLFunctions_ES2 class provides all functions for OpenGL ES 2
\sa QAbstractOpenGLFunctions
*/
QOpenGLFunctions_ES2::QOpenGLFunctions_ES2()
: QAbstractOpenGLFunctions()
, d_es2(0)
{
}
QOpenGLFunctions_ES2::~QOpenGLFunctions_ES2()
{
}
bool QOpenGLFunctions_ES2::initializeOpenGLFunctions()
{
if ( isInitialized() )
return true;
QOpenGLContext* context = QOpenGLContext::currentContext();
// If owned by a context object make sure it is current.
// Also check that current context is compatible
if (((owningContext() && owningContext() == context) || !owningContext())
&& QOpenGLFunctions_ES2::isContextCompatible(context))
{
// Nothing to do, just flag that we are initialized
QAbstractOpenGLFunctions::initializeOpenGLFunctions();
}
return isInitialized();
}
bool QOpenGLFunctions_ES2::isContextCompatible(QOpenGLContext *context)
{
Q_ASSERT(context);
QSurfaceFormat f = context->format();
const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());
if (v < qMakePair(2, 0))
return false;
if (f.renderableType() != QSurfaceFormat::OpenGLES)
return false;
return true;
}
QOpenGLVersionProfile QOpenGLFunctions_ES2::versionProfile()
{
QOpenGLVersionProfile v;
return v;
}
QT_END_NAMESPACE

View File

@ -0,0 +1,931 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QOPENGLVERSIONFUNCTIONS_ES2_H
#define QOPENGLVERSIONFUNCTIONS_ES2_H
#ifndef QT_NO_OPENGL
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>
QT_BEGIN_NAMESPACE
class QOpenGLFunctions_ES2Private;
class Q_GUI_EXPORT QOpenGLFunctions_ES2 : public QAbstractOpenGLFunctions
{
public:
QOpenGLFunctions_ES2();
~QOpenGLFunctions_ES2();
bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
// OpenGL ES2 core functions
void glActiveTexture(GLenum texture);
void glAttachShader(GLuint program, GLuint shader);
void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
void glBindBuffer(GLenum target, GLuint buffer);
void glBindFramebuffer(GLenum target, GLuint framebuffer);
void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
void glBindTexture(GLenum target, GLuint texture);
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void glBlendEquation(GLenum mode);
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
void glBlendFunc(GLenum sfactor, GLenum dfactor);
void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GLenum glCheckFramebufferStatus(GLenum target);
void glClear(GLbitfield mask);
void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void glClearDepthf(GLclampf depth);
void glClearStencil(GLint s);
void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
void glCompileShader(GLuint shader);
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GLuint glCreateProgram(void);
GLuint glCreateShader(GLenum type);
void glCullFace(GLenum mode);
void glDeleteBuffers(GLsizei n, const GLuint* buffers);
void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
void glDeleteProgram(GLuint program);
void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
void glDeleteShader(GLuint shader);
void glDeleteTextures(GLsizei n, const GLuint* textures);
void glDepthFunc(GLenum func);
void glDepthMask(GLboolean flag);
void glDepthRangef(GLclampf zNear, GLclampf zFar);
void glDetachShader(GLuint program, GLuint shader);
void glDisable(GLenum cap);
void glDisableVertexAttribArray(GLuint index);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
void glEnable(GLenum cap);
void glEnableVertexAttribArray(GLuint index);
void glFinish(void);
void glFlush(void);
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void glFrontFace(GLenum mode);
void glGenBuffers(GLsizei n, GLuint* buffers);
void glGenerateMipmap(GLenum target);
void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
void glGenTextures(GLsizei n, GLuint* textures);
void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
int glGetAttribLocation(GLuint program, const GLchar* name);
void glGetBooleanv(GLenum pname, GLboolean* params);
void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
GLenum glGetError(void);
void glGetFloatv(GLenum pname, GLfloat* params);
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
void glGetIntegerv(GLenum pname, GLint* params);
void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
const GLubyte* glGetString(GLenum name);
void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
void glGetUniformiv(GLuint program, GLint location, GLint* params);
int glGetUniformLocation(GLuint program, const GLchar* name);
void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
void glHint(GLenum target, GLenum mode);
GLboolean glIsBuffer(GLuint buffer);
GLboolean glIsEnabled(GLenum cap);
GLboolean glIsFramebuffer(GLuint framebuffer);
GLboolean glIsProgram(GLuint program);
GLboolean glIsRenderbuffer(GLuint renderbuffer);
GLboolean glIsShader(GLuint shader);
GLboolean glIsTexture(GLuint texture);
void glLineWidth(GLfloat width);
void glLinkProgram(GLuint program);
void glPixelStorei(GLenum pname, GLint param);
void glPolygonOffset(GLfloat factor, GLfloat units);
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
void glReleaseShaderCompiler(void);
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void glSampleCoverage(GLclampf value, GLboolean invert);
void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
void glShaderSource(GLuint shader, GLsizei count, const GLchar* *string, const GLint* length);
void glStencilFunc(GLenum func, GLint ref, GLuint mask);
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
void glStencilMask(GLuint mask);
void glStencilMaskSeparate(GLenum face, GLuint mask);
void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
void glTexParameteri(GLenum target, GLenum pname, GLint param);
void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
void glUniform1f(GLint location, GLfloat x);
void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform1i(GLint location, GLint x);
void glUniform1iv(GLint location, GLsizei count, const GLint* v);
void glUniform2f(GLint location, GLfloat x, GLfloat y);
void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform2i(GLint location, GLint x, GLint y);
void glUniform2iv(GLint location, GLsizei count, const GLint* v);
void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform3i(GLint location, GLint x, GLint y, GLint z);
void glUniform3iv(GLint location, GLsizei count, const GLint* v);
void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
void glUniform4iv(GLint location, GLsizei count, const GLint* v);
void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUseProgram(GLuint program);
void glValidateProgram(GLuint program);
void glVertexAttrib1f(GLuint indx, GLfloat x);
void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
private:
friend class QOpenGLContext;
static bool isContextCompatible(QOpenGLContext *context);
static QOpenGLVersionProfile versionProfile();
// For future expansion - not used
QOpenGLFunctions_ES2Private* d_es2;
};
// OpenGL ES2 core functions
inline void QOpenGLFunctions_ES2::glActiveTexture(GLenum texture)
{
::glActiveTexture(texture);
}
inline void QOpenGLFunctions_ES2::glAttachShader(GLuint program, GLuint shader)
{
::glAttachShader(program, shader);
}
inline void QOpenGLFunctions_ES2::glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
{
::glBindAttribLocation(program, index, name);
}
inline void QOpenGLFunctions_ES2::glBindBuffer(GLenum target, GLuint buffer)
{
::glBindBuffer(target, buffer);
}
inline void QOpenGLFunctions_ES2::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
::glBindFramebuffer(target, framebuffer);
}
inline void QOpenGLFunctions_ES2::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
{
::glBindRenderbuffer(target, renderbuffer);
}
inline void QOpenGLFunctions_ES2::glBindTexture(GLenum target, GLuint texture)
{
::glBindTexture(target, texture);
}
inline void QOpenGLFunctions_ES2::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
::glBlendColor(red, green, blue, alpha);
}
inline void QOpenGLFunctions_ES2::glBlendEquation(GLenum mode)
{
::glBlendEquation(mode);
}
inline void QOpenGLFunctions_ES2::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
::glBlendEquationSeparate(modeRGB, modeAlpha);
}
inline void QOpenGLFunctions_ES2::glBlendFunc(GLenum sfactor, GLenum dfactor)
{
::glBlendFunc(sfactor, dfactor);
}
inline void QOpenGLFunctions_ES2::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{
::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}
inline void QOpenGLFunctions_ES2::glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
{
::glBufferData(target, size, data, usage);
}
inline void QOpenGLFunctions_ES2::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
{
::glBufferSubData(target, offset, size, data);
}
inline GLenum QOpenGLFunctions_ES2::glCheckFramebufferStatus(GLenum target)
{
return ::glCheckFramebufferStatus(target);
}
inline void QOpenGLFunctions_ES2::glClear(GLbitfield mask)
{
::glClear(mask);
}
inline void QOpenGLFunctions_ES2::glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
::glClearColor(red, green, blue, alpha);
}
inline void QOpenGLFunctions_ES2::glClearDepthf(GLclampf depth)
{
::glClearDepthf(depth);
}
inline void QOpenGLFunctions_ES2::glClearStencil(GLint s)
{
::glClearStencil(s);
}
inline void QOpenGLFunctions_ES2::glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
::glColorMask(red, green, blue, alpha);
}
inline void QOpenGLFunctions_ES2::glCompileShader(GLuint shader)
{
::glCompileShader(shader);
}
inline void QOpenGLFunctions_ES2::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
{
::glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
}
inline void QOpenGLFunctions_ES2::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
{
::glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
inline void QOpenGLFunctions_ES2::glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
}
inline void QOpenGLFunctions_ES2::glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
inline GLuint QOpenGLFunctions_ES2::glCreateProgram(void)
{
return ::glCreateProgram();
}
inline GLuint QOpenGLFunctions_ES2::glCreateShader(GLenum type)
{
return ::glCreateShader(type);
}
inline void QOpenGLFunctions_ES2::glCullFace(GLenum mode)
{
::glCullFace(mode);
}
inline void QOpenGLFunctions_ES2::glDeleteBuffers(GLsizei n, const GLuint* buffers)
{
::glDeleteBuffers(n, buffers);
}
inline void QOpenGLFunctions_ES2::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
{
::glDeleteFramebuffers(n, framebuffers);
}
inline void QOpenGLFunctions_ES2::glDeleteProgram(GLuint program)
{
::glDeleteProgram(program);
}
inline void QOpenGLFunctions_ES2::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
{
::glDeleteRenderbuffers(n, renderbuffers);
}
inline void QOpenGLFunctions_ES2::glDeleteShader(GLuint shader)
{
::glDeleteShader(shader);
}
inline void QOpenGLFunctions_ES2::glDeleteTextures(GLsizei n, const GLuint* textures)
{
::glDeleteTextures(n, textures);
}
inline void QOpenGLFunctions_ES2::glDepthFunc(GLenum func)
{
::glDepthFunc(func);
}
inline void QOpenGLFunctions_ES2::glDepthMask(GLboolean flag)
{
::glDepthMask(flag);
}
inline void QOpenGLFunctions_ES2::glDepthRangef(GLclampf zNear, GLclampf zFar)
{
::glDepthRangef(zNear, zFar);
}
inline void QOpenGLFunctions_ES2::glDetachShader(GLuint program, GLuint shader)
{
::glDetachShader(program, shader);
}
inline void QOpenGLFunctions_ES2::glDisable(GLenum cap)
{
::glDisable(cap);
}
inline void QOpenGLFunctions_ES2::glDisableVertexAttribArray(GLuint index)
{
::glDisableVertexAttribArray(index);
}
inline void QOpenGLFunctions_ES2::glDrawArrays(GLenum mode, GLint first, GLsizei count)
{
::glDrawArrays(mode, first, count);
}
inline void QOpenGLFunctions_ES2::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
{
::glDrawElements(mode, count, type, indices);
}
inline void QOpenGLFunctions_ES2::glEnable(GLenum cap)
{
::glEnable(cap);
}
inline void QOpenGLFunctions_ES2::glEnableVertexAttribArray(GLuint index)
{
::glEnableVertexAttribArray(index);
}
inline void QOpenGLFunctions_ES2::glFinish(void)
{
::glFinish();
}
inline void QOpenGLFunctions_ES2::glFlush(void)
{
::glFlush();
}
inline void QOpenGLFunctions_ES2::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
::glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
}
inline void QOpenGLFunctions_ES2::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
::glFramebufferTexture2D(target, attachment, textarget, texture, level);
}
inline void QOpenGLFunctions_ES2::glFrontFace(GLenum mode)
{
::glFrontFace(mode);
}
inline void QOpenGLFunctions_ES2::glGenBuffers(GLsizei n, GLuint* buffers)
{
::glGenBuffers(n, buffers);
}
inline void QOpenGLFunctions_ES2::glGenerateMipmap(GLenum target)
{
::glGenerateMipmap(target);
}
inline void QOpenGLFunctions_ES2::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
{
::glGenFramebuffers(n, framebuffers);
}
inline void QOpenGLFunctions_ES2::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
{
::glGenRenderbuffers(n, renderbuffers);
}
inline void QOpenGLFunctions_ES2::glGenTextures(GLsizei n, GLuint* textures)
{
::glGenTextures(n, textures);
}
inline void QOpenGLFunctions_ES2::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
{
::glGetActiveAttrib(program, index, bufsize, length, size, type, name);
}
inline void QOpenGLFunctions_ES2::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
{
::glGetActiveUniform(program, index, bufsize, length, size, type, name);
}
inline void QOpenGLFunctions_ES2::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
{
::glGetAttachedShaders(program, maxcount, count, shaders);
}
inline int QOpenGLFunctions_ES2::glGetAttribLocation(GLuint program, const GLchar* name)
{
return ::glGetAttribLocation(program, name);
}
inline void QOpenGLFunctions_ES2::glGetBooleanv(GLenum pname, GLboolean* params)
{
::glGetBooleanv(pname, params);
}
inline void QOpenGLFunctions_ES2::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
{
::glGetBufferParameteriv(target, pname, params);
}
inline GLenum QOpenGLFunctions_ES2::glGetError(void)
{
return ::glGetError();
}
inline void QOpenGLFunctions_ES2::glGetFloatv(GLenum pname, GLfloat* params)
{
::glGetFloatv(pname, params);
}
inline void QOpenGLFunctions_ES2::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
{
::glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetIntegerv(GLenum pname, GLint* params)
{
::glGetIntegerv(pname, params);
}
inline void QOpenGLFunctions_ES2::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
{
::glGetProgramiv(program, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
{
::glGetProgramInfoLog(program, bufsize, length, infolog);
}
inline void QOpenGLFunctions_ES2::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
{
::glGetRenderbufferParameteriv(target, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
{
::glGetShaderiv(shader, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
{
::glGetShaderInfoLog(shader, bufsize, length, infolog);
}
inline void QOpenGLFunctions_ES2::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
{
::glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
}
inline void QOpenGLFunctions_ES2::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
{
::glGetShaderSource(shader, bufsize, length, source);
}
inline const GLubyte* QOpenGLFunctions_ES2::glGetString(GLenum name)
{
return ::glGetString(name);
}
inline void QOpenGLFunctions_ES2::glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
{
::glGetTexParameterfv(target, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
{
::glGetTexParameteriv(target, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
{
::glGetUniformfv(program, location, params);
}
inline void QOpenGLFunctions_ES2::glGetUniformiv(GLuint program, GLint location, GLint* params)
{
::glGetUniformiv(program, location, params);
}
inline int QOpenGLFunctions_ES2::glGetUniformLocation(GLuint program, const GLchar* name)
{
return ::glGetUniformLocation(program, name);
}
inline void QOpenGLFunctions_ES2::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
{
::glGetVertexAttribfv(index, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
{
::glGetVertexAttribiv(index, pname, params);
}
inline void QOpenGLFunctions_ES2::glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
{
::glGetVertexAttribPointerv(index, pname, pointer);
}
inline void QOpenGLFunctions_ES2::glHint(GLenum target, GLenum mode)
{
::glHint(target, mode);
}
inline GLboolean QOpenGLFunctions_ES2::glIsBuffer(GLuint buffer)
{
return ::glIsBuffer(buffer);
}
inline GLboolean QOpenGLFunctions_ES2::glIsEnabled(GLenum cap)
{
return ::glIsEnabled(cap);
}
inline GLboolean QOpenGLFunctions_ES2::glIsFramebuffer(GLuint framebuffer)
{
return ::glIsFramebuffer(framebuffer);
}
inline GLboolean QOpenGLFunctions_ES2::glIsProgram(GLuint program)
{
return ::glIsProgram(program);
}
inline GLboolean QOpenGLFunctions_ES2::glIsRenderbuffer(GLuint renderbuffer)
{
return ::glIsRenderbuffer(renderbuffer);
}
inline GLboolean QOpenGLFunctions_ES2::glIsShader(GLuint shader)
{
return ::glIsShader(shader);
}
inline GLboolean QOpenGLFunctions_ES2::glIsTexture(GLuint texture)
{
return ::glIsTexture(texture);
}
inline void QOpenGLFunctions_ES2::glLineWidth(GLfloat width)
{
::glLineWidth(width);
}
inline void QOpenGLFunctions_ES2::glLinkProgram(GLuint program)
{
::glLinkProgram(program);
}
inline void QOpenGLFunctions_ES2::glPixelStorei(GLenum pname, GLint param)
{
::glPixelStorei(pname, param);
}
inline void QOpenGLFunctions_ES2::glPolygonOffset(GLfloat factor, GLfloat units)
{
::glPolygonOffset(factor, units);
}
inline void QOpenGLFunctions_ES2::glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
{
::glReadPixels(x, y, width, height, format, type, pixels);
}
inline void QOpenGLFunctions_ES2::glReleaseShaderCompiler(void)
{
::glReleaseShaderCompiler();
}
inline void QOpenGLFunctions_ES2::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{
::glRenderbufferStorage(target, internalformat, width, height);
}
inline void QOpenGLFunctions_ES2::glSampleCoverage(GLclampf value, GLboolean invert)
{
::glSampleCoverage(value, invert);
}
inline void QOpenGLFunctions_ES2::glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
::glScissor(x, y, width, height);
}
inline void QOpenGLFunctions_ES2::glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
{
::glShaderBinary(n, shaders, binaryformat, binary, length);
}
inline void QOpenGLFunctions_ES2::glShaderSource(GLuint shader, GLsizei count, const GLchar* *string, const GLint* length)
{
::glShaderSource(shader, count, string, length);
}
inline void QOpenGLFunctions_ES2::glStencilFunc(GLenum func, GLint ref, GLuint mask)
{
::glStencilFunc(func, ref, mask);
}
inline void QOpenGLFunctions_ES2::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
::glStencilFuncSeparate(face, func, ref, mask);
}
inline void QOpenGLFunctions_ES2::glStencilMask(GLuint mask)
{
::glStencilMask(mask);
}
inline void QOpenGLFunctions_ES2::glStencilMaskSeparate(GLenum face, GLuint mask)
{
::glStencilMaskSeparate(face, mask);
}
inline void QOpenGLFunctions_ES2::glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
::glStencilOp(fail, zfail, zpass);
}
inline void QOpenGLFunctions_ES2::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
{
::glStencilOpSeparate(face, fail, zfail, zpass);
}
inline void QOpenGLFunctions_ES2::glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
{
::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}
inline void QOpenGLFunctions_ES2::glTexParameterf(GLenum target, GLenum pname, GLfloat param)
{
::glTexParameterf(target, pname, param);
}
inline void QOpenGLFunctions_ES2::glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
{
::glTexParameterfv(target, pname, params);
}
inline void QOpenGLFunctions_ES2::glTexParameteri(GLenum target, GLenum pname, GLint param)
{
::glTexParameteri(target, pname, param);
}
inline void QOpenGLFunctions_ES2::glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
{
::glTexParameteriv(target, pname, params);
}
inline void QOpenGLFunctions_ES2::glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
{
::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
}
inline void QOpenGLFunctions_ES2::glUniform1f(GLint location, GLfloat x)
{
::glUniform1f(location, x);
}
inline void QOpenGLFunctions_ES2::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
{
::glUniform1fv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform1i(GLint location, GLint x)
{
::glUniform1i(location, x);
}
inline void QOpenGLFunctions_ES2::glUniform1iv(GLint location, GLsizei count, const GLint* v)
{
::glUniform1iv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform2f(GLint location, GLfloat x, GLfloat y)
{
::glUniform2f(location, x, y);
}
inline void QOpenGLFunctions_ES2::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
{
::glUniform2fv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform2i(GLint location, GLint x, GLint y)
{
::glUniform2i(location, x, y);
}
inline void QOpenGLFunctions_ES2::glUniform2iv(GLint location, GLsizei count, const GLint* v)
{
::glUniform2iv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
{
::glUniform3f(location, x, y, z);
}
inline void QOpenGLFunctions_ES2::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
{
::glUniform3fv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform3i(GLint location, GLint x, GLint y, GLint z)
{
::glUniform3i(location, x, y, z);
}
inline void QOpenGLFunctions_ES2::glUniform3iv(GLint location, GLsizei count, const GLint* v)
{
::glUniform3iv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
::glUniform4f(location, x, y, z, w);
}
inline void QOpenGLFunctions_ES2::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
{
::glUniform4fv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
{
::glUniform4i(location, x, y, z, w);
}
inline void QOpenGLFunctions_ES2::glUniform4iv(GLint location, GLsizei count, const GLint* v)
{
::glUniform4iv(location, count, v);
}
inline void QOpenGLFunctions_ES2::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
::glUniformMatrix2fv(location, count, transpose, value);
}
inline void QOpenGLFunctions_ES2::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
::glUniformMatrix3fv(location, count, transpose, value);
}
inline void QOpenGLFunctions_ES2::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
::glUniformMatrix4fv(location, count, transpose, value);
}
inline void QOpenGLFunctions_ES2::glUseProgram(GLuint program)
{
::glUseProgram(program);
}
inline void QOpenGLFunctions_ES2::glValidateProgram(GLuint program)
{
::glValidateProgram(program);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib1f(GLuint indx, GLfloat x)
{
::glVertexAttrib1f(indx, x);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
{
::glVertexAttrib1fv(indx, values);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
{
::glVertexAttrib2f(indx, x, y);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
{
::glVertexAttrib2fv(indx, values);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
{
::glVertexAttrib3f(indx, x, y, z);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
{
::glVertexAttrib3fv(indx, values);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
::glVertexAttrib4f(indx, x, y, z, w);
}
inline void QOpenGLFunctions_ES2::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
{
::glVertexAttrib4fv(indx, values);
}
inline void QOpenGLFunctions_ES2::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
{
::glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
}
inline void QOpenGLFunctions_ES2::glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
::glViewport(x, y, width, height);
}
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,153 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#include "qopenglversionfunctionsfactory_p.h"
#if !defined(QT_OPENGL_ES_2)
#include "qopenglfunctions_4_3_core.h"
#include "qopenglfunctions_4_3_compatibility.h"
#include "qopenglfunctions_4_2_core.h"
#include "qopenglfunctions_4_2_compatibility.h"
#include "qopenglfunctions_4_1_core.h"
#include "qopenglfunctions_4_1_compatibility.h"
#include "qopenglfunctions_4_0_core.h"
#include "qopenglfunctions_4_0_compatibility.h"
#include "qopenglfunctions_3_3_core.h"
#include "qopenglfunctions_3_3_compatibility.h"
#include "qopenglfunctions_3_2_core.h"
#include "qopenglfunctions_3_2_compatibility.h"
#include "qopenglfunctions_3_1.h"
#include "qopenglfunctions_3_0.h"
#include "qopenglfunctions_2_1.h"
#include "qopenglfunctions_2_0.h"
#include "qopenglfunctions_1_5.h"
#include "qopenglfunctions_1_4.h"
#include "qopenglfunctions_1_3.h"
#include "qopenglfunctions_1_2.h"
#include "qopenglfunctions_1_1.h"
#include "qopenglfunctions_1_0.h"
#else
#include "qopenglfunctions_es2.h"
#endif
QT_BEGIN_NAMESPACE
QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVersionProfile &versionProfile)
{
#if !defined(QT_OPENGL_ES_2)
const int major = versionProfile.version().first;
const int minor = versionProfile.version().second;
if (versionProfile.hasProfiles()) {
switch (versionProfile.profile()) {
case QSurfaceFormat::CoreProfile:
if (major == 4 && minor == 3)
return new QOpenGLFunctions_4_3_Core;
else if (major == 4 && minor == 2)
return new QOpenGLFunctions_4_2_Core;
else if (major == 4 && minor == 1)
return new QOpenGLFunctions_4_1_Core;
else if (major == 4 && minor == 0)
return new QOpenGLFunctions_4_0_Core;
else if (major == 3 && minor == 3)
return new QOpenGLFunctions_3_3_Core;
else if (major == 3 && minor == 2)
return new QOpenGLFunctions_3_2_Core;
break;
case QSurfaceFormat::CompatibilityProfile:
if (major == 4 && minor == 3)
return new QOpenGLFunctions_4_3_Compatibility;
else if (major == 4 && minor == 2)
return new QOpenGLFunctions_4_2_Compatibility;
else if (major == 4 && minor == 1)
return new QOpenGLFunctions_4_1_Compatibility;
else if (major == 4 && minor == 0)
return new QOpenGLFunctions_4_0_Compatibility;
else if (major == 3 && minor == 3)
return new QOpenGLFunctions_3_3_Compatibility;
else if (major == 3 && minor == 2)
return new QOpenGLFunctions_3_2_Compatibility;
break;
case QSurfaceFormat::NoProfile:
default:
break;
};
} else {
if (major == 3 && minor == 1)
return new QOpenGLFunctions_3_1;
else if (major == 3 && minor == 0)
return new QOpenGLFunctions_3_0;
else if (major == 2 && minor == 1)
return new QOpenGLFunctions_2_1;
else if (major == 2 && minor == 0)
return new QOpenGLFunctions_2_0;
else if (major == 1 && minor == 5)
return new QOpenGLFunctions_1_5;
else if (major == 1 && minor == 4)
return new QOpenGLFunctions_1_4;
else if (major == 1 && minor == 3)
return new QOpenGLFunctions_1_3;
else if (major == 1 && minor == 2)
return new QOpenGLFunctions_1_2;
else if (major == 1 && minor == 1)
return new QOpenGLFunctions_1_1;
else if (major == 1 && minor == 0)
return new QOpenGLFunctions_1_0;
}
return 0;
#else
Q_UNUSED(versionProfile);
return new QOpenGLFunctions_ES2;
#endif
}
QT_END_NAMESPACE

View File

@ -0,0 +1,73 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
** glgen is Copyright (C) 2012 Klaralvdalens Datakonsult AB (KDAB)
**
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
**
****************************************************************************/
#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H
#define QOPENGLVERSIONFUNCTIONFACTORY_P_H
#ifndef QT_NO_OPENGL
#include <QtCore/QtGlobal>
#include <QtGui/qopenglcontext.h>
QT_BEGIN_NAMESPACE
class QAbstractOpenGLFunctions;
class QOpenGLVersionFunctionsFactory
{
public:
static QAbstractOpenGLFunctions *create(const QOpenGLVersionProfile &versionProfile);
};
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
#endif