Initial import from qtquick2.

Branched from the monolithic repo, Qt qtquick2 branch, at commit
a4a585d2ee907746682846ae6e8a48e19deef469
This commit is contained in:
Qt by Nokia 2011-04-27 14:13:26 +02:00 committed by axis
parent 38be0d1383
commit eae8fb8599
33 changed files with 465 additions and 152 deletions

View File

@ -35,6 +35,9 @@ plugin { #Qt plugins
INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
# As declarative now uses OpenGL in the API, force include it to avoid having to update all projects
contains(QT, declarative): QT += opengl
# As order does matter for static libs, we reorder the QT variable here # As order does matter for static libs, we reorder the QT variable here
TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core meegographicssystemhelper TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core meegographicssystemhelper
for(QTLIB, $$list($$TMPLIBS)) { for(QTLIB, $$list($$TMPLIBS)) {
@ -48,6 +51,7 @@ for(QTLIB, $$list($$QT_UNKNOWN)) {
!contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB") !contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB")
} }
QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) { for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {

View File

@ -260,7 +260,8 @@ void QUnifiedTimer::restartAnimationTimer()
} else if (!driver->isRunning() || isPauseTimerActive) { } else if (!driver->isRunning() || isPauseTimerActive) {
driver->start(); driver->start();
isPauseTimerActive = false; isPauseTimerActive = false;
} } else if (runningLeafAnimations == 0)
driver->stop();
} }
void QUnifiedTimer::setTimingInterval(int interval) void QUnifiedTimer::setTimingInterval(int interval)
@ -389,19 +390,49 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish()
return closestTimeToFinish; return closestTimeToFinish;
} }
void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d) void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d)
{ {
if (driver->isRunning()) { if (driver != &defaultDriver) {
qWarning("QUnifiedTimer: Cannot change animation driver while animations are running"); qWarning("QUnifiedTimer: animation driver already installed...");
return; return;
} }
if (driver && driver != &defaultDriver) if (driver->isRunning()) {
delete driver; driver->stop();
d->start();
}
driver = d; driver = d;
} }
void QUnifiedTimer::uninstallAnimationDriver(QAnimationDriver *d)
{
if (driver != d) {
qWarning("QUnifiedTimer: trying to uninstall a driver that is not installed...");
return;
}
driver = &defaultDriver;
if (d->isRunning()) {
d->stop();
driver->start();
}
}
/*!
Returns true if \a d is the currently installed animation driver
and is not the default animation driver (which can never be uninstalled).
*/
bool QUnifiedTimer::canUninstallAnimationDriver(QAnimationDriver *d)
{
return d == driver && driver != &defaultDriver;
}
/*! /*!
\class QAnimationDriver \class QAnimationDriver
@ -424,6 +455,12 @@ QAnimationDriver::QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent)
{ {
} }
QAnimationDriver::~QAnimationDriver()
{
QUnifiedTimer *timer = QUnifiedTimer::instance(true);
if (timer->canUninstallAnimationDriver(this))
uninstall();
}
/*! /*!
Advances the animation based on the current time. This function should Advances the animation based on the current time. This function should
@ -453,6 +490,15 @@ void QAnimationDriver::install()
timer->installAnimationDriver(this); timer->installAnimationDriver(this);
} }
/*!
Uninstalls this animation driver.
*/
void QAnimationDriver::uninstall()
{
QUnifiedTimer *timer = QUnifiedTimer::instance(true);
timer->uninstallAnimationDriver(this);
}
bool QAnimationDriver::isRunning() const bool QAnimationDriver::isRunning() const
{ {
return d_func()->running; return d_func()->running;

View File

@ -141,9 +141,12 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
public: public:
QAnimationDriver(QObject *parent = 0); QAnimationDriver(QObject *parent = 0);
~QAnimationDriver();
void advance(); void advance();
void install(); void install();
void uninstall();
bool isRunning() const; bool isRunning() const;

View File

@ -180,10 +180,15 @@ public:
static void updateAnimationTimer(); static void updateAnimationTimer();
void installAnimationDriver(QAnimationDriver *driver); void installAnimationDriver(QAnimationDriver *driver);
void uninstallAnimationDriver(QAnimationDriver *driver);
bool canUninstallAnimationDriver(QAnimationDriver *driver);
void restartAnimationTimer(); void restartAnimationTimer();
void updateAnimationsTime(); void updateAnimationsTime();
//useful for profiling/debugging
int runningAnimationCount() { return animations.count(); }
protected: protected:
void timerEvent(QTimerEvent *); void timerEvent(QTimerEvent *);

View File

@ -171,17 +171,27 @@ private:
Q_GLOBAL_STATIC(QMutex, processManagerGlobalMutex) Q_GLOBAL_STATIC(QMutex, processManagerGlobalMutex)
static QProcessManager *processManager() { static QProcessManager *processManagerInstance = 0;
static QProcessManager *processManager()
{
// The constructor of QProcessManager should be called only once // The constructor of QProcessManager should be called only once
// so we cannot use Q_GLOBAL_STATIC directly for QProcessManager // so we cannot use Q_GLOBAL_STATIC directly for QProcessManager
QMutex *mutex = processManagerGlobalMutex(); QMutex *mutex = processManagerGlobalMutex();
QMutexLocker locker(mutex); QMutexLocker locker(mutex);
static QProcessManager processManager;
return &processManager; if (!processManagerInstance)
QProcessPrivate::initializeProcessManager();
Q_ASSERT(processManagerInstance);
return processManagerInstance;
} }
QProcessManager::QProcessManager() QProcessManager::QProcessManager()
{ {
// can only be called from main thread
Q_ASSERT(!qApp || qApp->thread() == QThread::currentThread());
#if defined (QPROCESS_DEBUG) #if defined (QPROCESS_DEBUG)
qDebug() << "QProcessManager::QProcessManager()"; qDebug() << "QProcessManager::QProcessManager()";
#endif #endif
@ -197,6 +207,8 @@ QProcessManager::QProcessManager()
action.sa_handler = qt_sa_sigchld_handler; action.sa_handler = qt_sa_sigchld_handler;
action.sa_flags = SA_NOCLDSTOP; action.sa_flags = SA_NOCLDSTOP;
::sigaction(SIGCHLD, &action, &qt_sa_old_sigchld_handler); ::sigaction(SIGCHLD, &action, &qt_sa_old_sigchld_handler);
processManagerInstance = this;
} }
QProcessManager::~QProcessManager() QProcessManager::~QProcessManager()
@ -221,6 +233,8 @@ QProcessManager::~QProcessManager()
if (currentAction.sa_handler == qt_sa_sigchld_handler) { if (currentAction.sa_handler == qt_sa_sigchld_handler) {
::sigaction(SIGCHLD, &qt_sa_old_sigchld_handler, 0); ::sigaction(SIGCHLD, &qt_sa_old_sigchld_handler, 0);
} }
processManagerInstance = 0;
} }
void QProcessManager::run() void QProcessManager::run()
@ -1287,7 +1301,15 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
void QProcessPrivate::initializeProcessManager() void QProcessPrivate::initializeProcessManager()
{ {
(void) processManager(); if (qApp && qApp->thread() != QThread::currentThread()) {
// The process manager must be initialized in the main thread
// Note: The call below will re-enter this function, but in the right thread,
// so the else statement below will be executed.
QMetaObject::invokeMethod(qApp, "_q_initializeProcessManager", Qt::BlockingQueuedConnection);
} else {
static QProcessManager processManager;
Q_UNUSED(processManager);
}
} }
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -392,6 +392,16 @@ void QCoreApplicationPrivate::createEventDispatcher()
#endif #endif
} }
void QCoreApplicationPrivate::_q_initializeProcessManager()
{
#ifndef QT_NO_PROCESS
# ifdef Q_OS_UNIX
QProcessPrivate::initializeProcessManager();
# endif
#endif
}
QThread *QCoreApplicationPrivate::theMainThread = 0; QThread *QCoreApplicationPrivate::theMainThread = 0;
QThread *QCoreApplicationPrivate::mainThread() QThread *QCoreApplicationPrivate::mainThread()
{ {
@ -656,12 +666,6 @@ void QCoreApplication::init()
} }
#endif #endif
#if defined(Q_OS_UNIX) && !(defined(QT_NO_PROCESS))
// Make sure the process manager thread object is created in the main
// thread.
QProcessPrivate::initializeProcessManager();
#endif
#ifdef QT_EVAL #ifdef QT_EVAL
extern void qt_core_eval_init(uint); extern void qt_core_eval_init(uint);
qt_core_eval_init(d->application_type); qt_core_eval_init(d->application_type);
@ -2728,3 +2732,5 @@ int QCoreApplication::loopLevel()
*/ */
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qcoreapplication.cpp"

View File

@ -205,6 +205,7 @@ protected:
QCoreApplication(QCoreApplicationPrivate &p); QCoreApplication(QCoreApplicationPrivate &p);
private: private:
Q_PRIVATE_SLOT(d_func(), void _q_initializeProcessManager())
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event); static bool sendSpontaneousEvent(QObject *receiver, QEvent *event);
bool notifyInternal(QObject *receiver, QEvent *event); bool notifyInternal(QObject *receiver, QEvent *event);

View File

@ -85,6 +85,8 @@ public:
bool sendThroughObjectEventFilters(QObject *, QEvent *); bool sendThroughObjectEventFilters(QObject *, QEvent *);
bool notify_helper(QObject *, QEvent *); bool notify_helper(QObject *, QEvent *);
void _q_initializeProcessManager();
virtual QString appName() const; virtual QString appName() const;
virtual void createEventDispatcher(); virtual void createEventDispatcher();
static void removePostedEvent(QEvent *); static void removePostedEvent(QEvent *);

View File

@ -334,7 +334,6 @@ static int qCocoaViewCount = 0;
// //
// Qt will then forward the update to the children. // Qt will then forward the update to the children.
if (qwidget->isWindow()) { if (qwidget->isWindow()) {
qwidget->update(qwidget->rect());
qwidgetprivate->syncBackingStore(qwidget->rect()); qwidgetprivate->syncBackingStore(qwidget->rect());
} }
} }

View File

@ -42,6 +42,8 @@
#include <qsessionmanager.h> #include <qsessionmanager.h>
#include <private/qobject_p.h> #include <private/qobject_p.h>
#include <qapplication.h>
#ifndef QT_NO_SESSIONMANAGER #ifndef QT_NO_SESSIONMANAGER
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -100,7 +100,9 @@ QMacCGContext::QMacCGContext(QPainter *p)
int devType = p->device()->devType(); int devType = p->device()->devType();
if (pe->type() == QPaintEngine::Raster if (pe->type() == QPaintEngine::Raster
&& (devType == QInternal::Widget || devType == QInternal::Pixmap)) { && (devType == QInternal::Widget ||
devType == QInternal::Pixmap ||
devType == QInternal::Image)) {
extern CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice); extern CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice);
CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pe->paintDevice()); CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pe->paintDevice());

View File

@ -311,14 +311,7 @@ private:
virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints); virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
enum HintStyle { virtual void setDefaultHintStyle(HintStyle style);
HintNone,
HintLight,
HintMedium,
HintFull
};
void setDefaultHintStyle(HintStyle style);
HintStyle defaultHintStyle() const { return default_hint_style; } HintStyle defaultHintStyle() const { return default_hint_style; }
protected: protected:

View File

@ -248,6 +248,14 @@ public:
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily); static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily);
enum HintStyle {
HintNone,
HintLight,
HintMedium,
HintFull
};
virtual void setDefaultHintStyle(HintStyle) { }
QAtomicInt ref; QAtomicInt ref;
QFontDef fontDef; QFontDef fontDef;
uint cache_cost; // amount of mem used in kb by the font uint cache_cost; // amount of mem used in kb by the font

View File

@ -62,7 +62,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace { class CustomFontFileLoader; } namespace { class CustomFontFileLoader; }
class Q_AUTOTEST_EXPORT QRawFontPrivate class Q_GUI_EXPORT QRawFontPrivate
{ {
public: public:
QRawFontPrivate() QRawFontPrivate()

View File

@ -714,17 +714,13 @@ QStaticTextItem::~QStaticTextItem()
{ {
if (m_userData != 0 && !m_userData->ref.deref()) if (m_userData != 0 && !m_userData->ref.deref())
delete m_userData; delete m_userData;
if (!m_fontEngine->ref.deref()) m_fontEngine->ref.deref();
delete m_fontEngine;
} }
void QStaticTextItem::setFontEngine(QFontEngine *fe) void QStaticTextItem::setFontEngine(QFontEngine *fe)
{ {
if (m_fontEngine != 0) { if (m_fontEngine != 0)
if (!m_fontEngine->ref.deref()) m_fontEngine->ref.deref();
delete m_fontEngine;
}
m_fontEngine = fe; m_fontEngine = fe;
if (m_fontEngine != 0) if (m_fontEngine != 0)
m_fontEngine->ref.ref(); m_fontEngine->ref.ref();

View File

@ -1564,6 +1564,19 @@ QVertexSet<T> QTriangulator<T>::triangulate()
template <typename T> template <typename T>
QVertexSet<T> QTriangulator<T>::polyline() QVertexSet<T> QTriangulator<T>::polyline()
{ {
for (int i = 0; i < m_vertices.size(); ++i) {
Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21));
Q_ASSERT(qAbs(m_vertices.at(i).y) < (1 << 21));
}
if (!(m_hint & (QVectorPath::OddEvenFill | QVectorPath::WindingFill)))
m_hint |= QVectorPath::OddEvenFill;
if (m_hint & QVectorPath::NonConvexShapeMask) {
ComplexToSimple c2s(this);
c2s.decompose();
}
QVertexSet<T> result; QVertexSet<T> result;
result.indices = m_indices; result.indices = m_indices;
result.vertices.resize(2 * m_vertices.size()); result.vertices.resize(2 * m_vertices.size());
@ -3084,7 +3097,7 @@ QPolylineSet qPolyline(const QVectorPath &path,
} else { } else {
QTriangulator<quint16> triangulator; QTriangulator<quint16> triangulator;
triangulator.initialize(path, matrix, lod); triangulator.initialize(path, matrix, lod);
QVertexSet<quint16> vertexSet = triangulator.triangulate(); QVertexSet<quint16> vertexSet = triangulator.polyline();
polyLineSet.vertices = vertexSet.vertices; polyLineSet.vertices = vertexSet.vertices;
polyLineSet.indices.setDataUshort(vertexSet.indices); polyLineSet.indices.setDataUshort(vertexSet.indices);
} }
@ -3104,7 +3117,7 @@ QPolylineSet qPolyline(const QPainterPath &path,
} else { } else {
QTriangulator<quint16> triangulator; QTriangulator<quint16> triangulator;
triangulator.initialize(path, matrix, lod); triangulator.initialize(path, matrix, lod);
QVertexSet<quint16> vertexSet = triangulator.triangulate(); QVertexSet<quint16> vertexSet = triangulator.polyline();
polyLineSet.vertices = vertexSet.vertices; polyLineSet.vertices = vertexSet.vertices;
polyLineSet.indices.setDataUshort(vertexSet.indices); polyLineSet.indices.setDataUshort(vertexSet.indices);
} }

View File

@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QVertexIndexVector class Q_OPENGL_EXPORT QVertexIndexVector
{ {
public: public:
enum Type { enum Type {
@ -111,7 +111,7 @@ private:
QVector<quint16> indices16; QVector<quint16> indices16;
}; };
struct QTriangleSet struct Q_OPENGL_EXPORT QTriangleSet
{ {
inline QTriangleSet() { } inline QTriangleSet() { }
inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { } inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { }
@ -122,14 +122,14 @@ struct QTriangleSet
QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...]
}; };
struct QPolylineSet struct Q_OPENGL_EXPORT QPolylineSet
{ {
inline QPolylineSet() { } inline QPolylineSet() { }
inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { } inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { }
QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;} QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;}
QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...] QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...]
QVertexIndexVector indices; QVertexIndexVector indices; // End of polyline is marked with -1.
}; };
// The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size // The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size
@ -139,9 +139,9 @@ struct QPolylineSet
// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher. // 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher.
QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform()); QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform());
QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QTriangleSet Q_OPENGL_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QPolylineSet Q_OPENGL_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -43,6 +43,7 @@
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include "qgl.h" #include "qgl.h"
#include <qdebug.h> #include <qdebug.h>
#include <qglfunctions.h>
#if defined(Q_WS_X11) #if defined(Q_WS_X11)
#include "private/qt_x11_p.h" #include "private/qt_x11_p.h"
@ -1663,6 +1664,7 @@ const QGLContext *qt_gl_transfer_context(const QGLContext *ctx)
QGLContextPrivate::QGLContextPrivate(QGLContext *context) QGLContextPrivate::QGLContextPrivate(QGLContext *context)
: internal_context(false) : internal_context(false)
, q_ptr(context) , q_ptr(context)
, functions(0)
{ {
group = new QGLContextGroup(context); group = new QGLContextGroup(context);
texture_destroyer = new QGLTextureDestroyer; texture_destroyer = new QGLTextureDestroyer;
@ -1671,6 +1673,8 @@ QGLContextPrivate::QGLContextPrivate(QGLContext *context)
QGLContextPrivate::~QGLContextPrivate() QGLContextPrivate::~QGLContextPrivate()
{ {
delete functions;
if (!group->m_refs.deref()) { if (!group->m_refs.deref()) {
Q_ASSERT(group->context() == q_ptr); Q_ASSERT(group->context() == q_ptr);
delete group; delete group;
@ -2710,6 +2714,19 @@ int QGLContextPrivate::maxTextureSize()
#endif #endif
} }
/*!
Returns a QGLFunctions object that is initialized for this context.
*/
QGLFunctions *QGLContext::functions() const
{
QGLContextPrivate *d = const_cast<QGLContextPrivate *>(d_func());
if (!d->functions) {
d->functions = new QGLFunctions(this);
d->functions->initializeGLFunctions(this);
}
return d->functions;
}
/*! /*!
Generates and binds a 2D GL texture to the current context, based Generates and binds a 2D GL texture to the current context, based
on \a image. The generated texture id is returned and can be used in on \a image. The generated texture id is returned and can be used in
@ -3792,6 +3809,20 @@ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFl
d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget); d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget);
} }
/*!
\internal
*/
QGLWidget::QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format, QWidget *parent, const QGLWidget *shareWidget, Qt::WindowFlags f)
: QWidget(dd, parent, f | Qt::MSWindowsOwnDC)
{
Q_D(QGLWidget);
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_NoSystemBackground);
setAutoFillBackground(true); // for compatibility
d->init(new QGLContext(format, this), shareWidget);
}
/*! /*!
Constructs an OpenGL widget with parent \a parent. Constructs an OpenGL widget with parent \a parent.

View File

@ -307,6 +307,8 @@ Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &); Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
#endif #endif
class QGLFunctions;
class Q_OPENGL_EXPORT QGLContext class Q_OPENGL_EXPORT QGLContext
{ {
Q_DECLARE_PRIVATE(QGLContext) Q_DECLARE_PRIVATE(QGLContext)
@ -332,6 +334,8 @@ public:
virtual void swapBuffers() const; virtual void swapBuffers() const;
QGLFunctions *functions() const;
enum BindOption { enum BindOption {
NoBindOption = 0x0000, NoBindOption = 0x0000,
InvertedYBindOption = 0x0001, InvertedYBindOption = 0x0001,
@ -466,6 +470,7 @@ private:
friend class QX11GLPixmapData; friend class QX11GLPixmapData;
friend class QX11GLSharedContexts; friend class QX11GLSharedContexts;
friend class QGLContextResourceBase; friend class QGLContextResourceBase;
friend class QSGDistanceFieldGlyphCache;
private: private:
Q_DISABLE_COPY(QGLContext) Q_DISABLE_COPY(QGLContext)
}; };
@ -589,6 +594,11 @@ protected:
virtual void glDraw(); virtual void glDraw();
int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove
QGLWidget(QGLWidgetPrivate &dd,
const QGLFormat &format = QGLFormat(),
QWidget *parent = 0,
const QGLWidget* shareWidget = 0,
Qt::WindowFlags f = 0);
private: private:
Q_DISABLE_COPY(QGLWidget) Q_DISABLE_COPY(QGLWidget)

View File

@ -159,7 +159,7 @@ public:
QGLFormat::OpenGLContextProfile profile; QGLFormat::OpenGLContextProfile profile;
}; };
class QGLWidgetPrivate : public QWidgetPrivate class Q_OPENGL_EXPORT QGLWidgetPrivate : public QWidgetPrivate
{ {
Q_DECLARE_PUBLIC(QGLWidget) Q_DECLARE_PUBLIC(QGLWidget)
public: public:
@ -441,6 +441,8 @@ public:
QHash<QGLContextResourceBase *, void *> m_resources; QHash<QGLContextResourceBase *, void *> m_resources;
QGLTextureDestroyer *texture_destroyer; QGLTextureDestroyer *texture_destroyer;
QGLFunctions *functions;
bool vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT]; bool vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT];
static inline QGLContextGroup *contextGroup(const QGLContext *ctx) { return ctx->d_ptr->group; } static inline QGLContextGroup *contextGroup(const QGLContext *ctx) { return ctx->d_ptr->group; }
@ -499,7 +501,7 @@ private:
QGLContext *m_ctx; QGLContext *m_ctx;
}; };
class QGLTextureDestroyer : public QObject class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -1348,7 +1348,7 @@ void QGLFunctions::initializeGLFunctions(const QGLContext *context)
#ifndef QT_OPENGL_ES_2 #ifndef QT_OPENGL_ES_2
static void qglfResolveActiveTexture(GLenum texture) static void QGLF_APIENTRY qglfResolveActiveTexture(GLenum texture)
{ {
typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture); typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture);
@ -1368,7 +1368,7 @@ static void qglfResolveActiveTexture(GLenum texture)
funcs->activeTexture = qglfResolveActiveTexture; funcs->activeTexture = qglfResolveActiveTexture;
} }
static void qglfResolveAttachShader(GLuint program, GLuint shader) static void QGLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader)
{ {
typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader); typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
@ -1388,7 +1388,7 @@ static void qglfResolveAttachShader(GLuint program, GLuint shader)
funcs->attachShader = qglfResolveAttachShader; funcs->attachShader = qglfResolveAttachShader;
} }
static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name) static void QGLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
{ {
typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name); typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
@ -1408,7 +1408,7 @@ static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const ch
funcs->bindAttribLocation = qglfResolveBindAttribLocation; funcs->bindAttribLocation = qglfResolveBindAttribLocation;
} }
static void qglfResolveBindBuffer(GLenum target, GLuint buffer) static void QGLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer)
{ {
typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer); typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
@ -1438,7 +1438,7 @@ static void qglfResolveBindBuffer(GLenum target, GLuint buffer)
funcs->bindBuffer = qglfResolveBindBuffer; funcs->bindBuffer = qglfResolveBindBuffer;
} }
static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer) static void QGLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
{ {
typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer); typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
@ -1468,7 +1468,7 @@ static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
funcs->bindFramebuffer = qglfResolveBindFramebuffer; funcs->bindFramebuffer = qglfResolveBindFramebuffer;
} }
static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer) static void QGLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
{ {
typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer); typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
@ -1498,7 +1498,7 @@ static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
funcs->bindRenderbuffer = qglfResolveBindRenderbuffer; funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
} }
static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) static void QGLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{ {
typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
@ -1528,7 +1528,7 @@ static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, G
funcs->blendColor = qglfResolveBlendColor; funcs->blendColor = qglfResolveBlendColor;
} }
static void qglfResolveBlendEquation(GLenum mode) static void QGLF_APIENTRY qglfResolveBlendEquation(GLenum mode)
{ {
typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode); typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode);
@ -1558,7 +1558,7 @@ static void qglfResolveBlendEquation(GLenum mode)
funcs->blendEquation = qglfResolveBlendEquation; funcs->blendEquation = qglfResolveBlendEquation;
} }
static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) static void QGLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{ {
typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
@ -1588,7 +1588,7 @@ static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate; funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
} }
static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) static void QGLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{ {
typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
@ -1618,7 +1618,7 @@ static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum sr
funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate; funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
} }
static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage) static void QGLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
{ {
typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage); typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
@ -1648,7 +1648,7 @@ static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void
funcs->bufferData = qglfResolveBufferData; funcs->bufferData = qglfResolveBufferData;
} }
static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data) static void QGLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
{ {
typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data); typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
@ -1678,7 +1678,7 @@ static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLs
funcs->bufferSubData = qglfResolveBufferSubData; funcs->bufferSubData = qglfResolveBufferSubData;
} }
static GLenum qglfResolveCheckFramebufferStatus(GLenum target) static GLenum QGLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target)
{ {
typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target); typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
@ -1708,7 +1708,7 @@ static GLenum qglfResolveCheckFramebufferStatus(GLenum target)
return GLenum(0); return GLenum(0);
} }
static void qglfResolveCompileShader(GLuint shader) static void QGLF_APIENTRY qglfResolveCompileShader(GLuint shader)
{ {
typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader); typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
@ -1728,7 +1728,7 @@ static void qglfResolveCompileShader(GLuint shader)
funcs->compileShader = qglfResolveCompileShader; funcs->compileShader = qglfResolveCompileShader;
} }
static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) static void QGLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
{ {
typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
@ -1758,7 +1758,7 @@ static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum i
funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D; funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
} }
static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) static void QGLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
{ {
typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
@ -1788,7 +1788,7 @@ static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint
funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D; funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
} }
static GLuint qglfResolveCreateProgram() static GLuint QGLF_APIENTRY qglfResolveCreateProgram()
{ {
typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)(); typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)();
@ -1808,7 +1808,7 @@ static GLuint qglfResolveCreateProgram()
return GLuint(0); return GLuint(0);
} }
static GLuint qglfResolveCreateShader(GLenum type) static GLuint QGLF_APIENTRY qglfResolveCreateShader(GLenum type)
{ {
typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type); typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type);
@ -1828,7 +1828,7 @@ static GLuint qglfResolveCreateShader(GLenum type)
return GLuint(0); return GLuint(0);
} }
static void qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers) static void QGLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
{ {
typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers); typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
@ -1858,7 +1858,7 @@ static void qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
funcs->deleteBuffers = qglfResolveDeleteBuffers; funcs->deleteBuffers = qglfResolveDeleteBuffers;
} }
static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) static void QGLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
{ {
typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers); typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
@ -1888,7 +1888,7 @@ static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers; funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
} }
static void qglfResolveDeleteProgram(GLuint program) static void QGLF_APIENTRY qglfResolveDeleteProgram(GLuint program)
{ {
typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program); typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
@ -1908,7 +1908,7 @@ static void qglfResolveDeleteProgram(GLuint program)
funcs->deleteProgram = qglfResolveDeleteProgram; funcs->deleteProgram = qglfResolveDeleteProgram;
} }
static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) static void QGLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
{ {
typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers); typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
@ -1938,7 +1938,7 @@ static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffer
funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers; funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
} }
static void qglfResolveDeleteShader(GLuint shader) static void QGLF_APIENTRY qglfResolveDeleteShader(GLuint shader)
{ {
typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader); typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
@ -1958,7 +1958,7 @@ static void qglfResolveDeleteShader(GLuint shader)
funcs->deleteShader = qglfResolveDeleteShader; funcs->deleteShader = qglfResolveDeleteShader;
} }
static void qglfResolveDetachShader(GLuint program, GLuint shader) static void QGLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader)
{ {
typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader); typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
@ -1978,7 +1978,7 @@ static void qglfResolveDetachShader(GLuint program, GLuint shader)
funcs->detachShader = qglfResolveDetachShader; funcs->detachShader = qglfResolveDetachShader;
} }
static void qglfResolveDisableVertexAttribArray(GLuint index) static void QGLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index)
{ {
typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index); typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
@ -1998,7 +1998,7 @@ static void qglfResolveDisableVertexAttribArray(GLuint index)
funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray; funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
} }
static void qglfResolveEnableVertexAttribArray(GLuint index) static void QGLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index)
{ {
typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index); typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
@ -2018,7 +2018,7 @@ static void qglfResolveEnableVertexAttribArray(GLuint index)
funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray; funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
} }
static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) static void QGLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{ {
typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
@ -2048,7 +2048,7 @@ static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment,
funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer; funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
} }
static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) static void QGLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{ {
typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
@ -2078,7 +2078,7 @@ static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GL
funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D; funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
} }
static void qglfResolveGenBuffers(GLsizei n, GLuint* buffers) static void QGLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
{ {
typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers); typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
@ -2108,7 +2108,7 @@ static void qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
funcs->genBuffers = qglfResolveGenBuffers; funcs->genBuffers = qglfResolveGenBuffers;
} }
static void qglfResolveGenerateMipmap(GLenum target) static void QGLF_APIENTRY qglfResolveGenerateMipmap(GLenum target)
{ {
typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target); typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
@ -2138,7 +2138,7 @@ static void qglfResolveGenerateMipmap(GLenum target)
funcs->generateMipmap = qglfResolveGenerateMipmap; funcs->generateMipmap = qglfResolveGenerateMipmap;
} }
static void qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers) static void QGLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
{ {
typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers); typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
@ -2168,7 +2168,7 @@ static void qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
funcs->genFramebuffers = qglfResolveGenFramebuffers; funcs->genFramebuffers = qglfResolveGenFramebuffers;
} }
static void qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers) static void QGLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
{ {
typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers); typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
@ -2198,7 +2198,7 @@ static void qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
funcs->genRenderbuffers = qglfResolveGenRenderbuffers; funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
} }
static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) static void QGLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
{ {
typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
@ -2218,7 +2218,7 @@ static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei buf
funcs->getActiveAttrib = qglfResolveGetActiveAttrib; funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
} }
static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) static void QGLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
{ {
typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
@ -2238,7 +2238,7 @@ static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bu
funcs->getActiveUniform = qglfResolveGetActiveUniform; funcs->getActiveUniform = qglfResolveGetActiveUniform;
} }
static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) static void QGLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
{ {
typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
@ -2258,7 +2258,7 @@ static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsi
funcs->getAttachedShaders = qglfResolveGetAttachedShaders; funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
} }
static int qglfResolveGetAttribLocation(GLuint program, const char* name) static int QGLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name)
{ {
typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name); typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
@ -2278,7 +2278,7 @@ static int qglfResolveGetAttribLocation(GLuint program, const char* name)
return int(0); return int(0);
} }
static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
@ -2308,7 +2308,7 @@ static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint*
funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv; funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
} }
static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
@ -2338,7 +2338,7 @@ static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum
funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv; funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
} }
static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
@ -2358,7 +2358,7 @@ static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
funcs->getProgramiv = qglfResolveGetProgramiv; funcs->getProgramiv = qglfResolveGetProgramiv;
} }
static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) static void QGLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
{ {
typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog); typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
@ -2378,7 +2378,7 @@ static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsize
funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog; funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
} }
static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
@ -2408,7 +2408,7 @@ static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, G
funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv; funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
} }
static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
@ -2428,7 +2428,7 @@ static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
funcs->getShaderiv = qglfResolveGetShaderiv; funcs->getShaderiv = qglfResolveGetShaderiv;
} }
static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) static void QGLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
{ {
typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog); typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
@ -2448,14 +2448,14 @@ static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei*
funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog; funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
} }
static void qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) static void QGLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
{ {
Q_UNUSED(shadertype); Q_UNUSED(shadertype);
Q_UNUSED(precisiontype); Q_UNUSED(precisiontype);
range[0] = range[1] = precision[0] = 0; range[0] = range[1] = precision[0] = 0;
} }
static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) static void QGLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
{ {
typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
@ -2485,7 +2485,7 @@ static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precis
funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision); funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
} }
static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) static void QGLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
{ {
typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source); typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
@ -2505,7 +2505,7 @@ static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei*
funcs->getShaderSource = qglfResolveGetShaderSource; funcs->getShaderSource = qglfResolveGetShaderSource;
} }
static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params) static void QGLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params); typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
@ -2525,7 +2525,7 @@ static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* par
funcs->getUniformfv = qglfResolveGetUniformfv; funcs->getUniformfv = qglfResolveGetUniformfv;
} }
static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params) static void QGLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params); typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
@ -2545,7 +2545,7 @@ static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint* param
funcs->getUniformiv = qglfResolveGetUniformiv; funcs->getUniformiv = qglfResolveGetUniformiv;
} }
static int qglfResolveGetUniformLocation(GLuint program, const char* name) static int QGLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name)
{ {
typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name); typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
@ -2565,7 +2565,7 @@ static int qglfResolveGetUniformLocation(GLuint program, const char* name)
return int(0); return int(0);
} }
static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) static void QGLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params); typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
@ -2585,7 +2585,7 @@ static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* pa
funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv; funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
} }
static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) static void QGLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
{ {
typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params); typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
@ -2605,7 +2605,7 @@ static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* para
funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv; funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
} }
static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) static void QGLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
{ {
typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer); typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
@ -2625,7 +2625,7 @@ static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void*
funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv; funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
} }
static GLboolean qglfResolveIsBuffer(GLuint buffer) static GLboolean QGLF_APIENTRY qglfResolveIsBuffer(GLuint buffer)
{ {
typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer); typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
@ -2655,7 +2655,7 @@ static GLboolean qglfResolveIsBuffer(GLuint buffer)
return GLboolean(0); return GLboolean(0);
} }
static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer) static GLboolean QGLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer)
{ {
typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer); typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
@ -2685,12 +2685,12 @@ static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer)
return GLboolean(0); return GLboolean(0);
} }
static GLboolean qglfSpecialIsProgram(GLuint program) static GLboolean QGLF_APIENTRY qglfSpecialIsProgram(GLuint program)
{ {
return program != 0; return program != 0;
} }
static GLboolean qglfResolveIsProgram(GLuint program) static GLboolean QGLF_APIENTRY qglfResolveIsProgram(GLuint program)
{ {
typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program); typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program);
@ -2710,7 +2710,7 @@ static GLboolean qglfResolveIsProgram(GLuint program)
return funcs->isProgram(program); return funcs->isProgram(program);
} }
static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer) static GLboolean QGLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer)
{ {
typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer); typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
@ -2740,12 +2740,12 @@ static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer)
return GLboolean(0); return GLboolean(0);
} }
static GLboolean qglfSpecialIsShader(GLuint shader) static GLboolean QGLF_APIENTRY qglfSpecialIsShader(GLuint shader)
{ {
return shader != 0; return shader != 0;
} }
static GLboolean qglfResolveIsShader(GLuint shader) static GLboolean QGLF_APIENTRY qglfResolveIsShader(GLuint shader)
{ {
typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader); typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader);
@ -2765,7 +2765,7 @@ static GLboolean qglfResolveIsShader(GLuint shader)
return funcs->isShader(shader); return funcs->isShader(shader);
} }
static void qglfResolveLinkProgram(GLuint program) static void QGLF_APIENTRY qglfResolveLinkProgram(GLuint program)
{ {
typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program); typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
@ -2785,11 +2785,11 @@ static void qglfResolveLinkProgram(GLuint program)
funcs->linkProgram = qglfResolveLinkProgram; funcs->linkProgram = qglfResolveLinkProgram;
} }
static void qglfSpecialReleaseShaderCompiler() static void QGLF_APIENTRY qglfSpecialReleaseShaderCompiler()
{ {
} }
static void qglfResolveReleaseShaderCompiler() static void QGLF_APIENTRY qglfResolveReleaseShaderCompiler()
{ {
typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)(); typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)();
@ -2809,7 +2809,7 @@ static void qglfResolveReleaseShaderCompiler()
funcs->releaseShaderCompiler(); funcs->releaseShaderCompiler();
} }
static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) static void QGLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{ {
typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
@ -2839,7 +2839,7 @@ static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat,
funcs->renderbufferStorage = qglfResolveRenderbufferStorage; funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
} }
static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert) static void QGLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
{ {
typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert); typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
@ -2869,7 +2869,7 @@ static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
funcs->sampleCoverage = qglfResolveSampleCoverage; funcs->sampleCoverage = qglfResolveSampleCoverage;
} }
static void qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length) static void QGLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
{ {
typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length); typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
@ -2889,7 +2889,7 @@ static void qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binar
funcs->shaderBinary = qglfResolveShaderBinary; funcs->shaderBinary = qglfResolveShaderBinary;
} }
static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) static void QGLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
{ {
typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length); typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
@ -2909,7 +2909,7 @@ static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char** s
funcs->shaderSource = qglfResolveShaderSource; funcs->shaderSource = qglfResolveShaderSource;
} }
static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) static void QGLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{ {
typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
@ -2939,7 +2939,7 @@ static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref,
funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate; funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
} }
static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask) static void QGLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
{ {
typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask); typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
@ -2969,7 +2969,7 @@ static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate; funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
} }
static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) static void QGLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
{ {
typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
@ -2999,7 +2999,7 @@ static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail,
funcs->stencilOpSeparate = qglfResolveStencilOpSeparate; funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
} }
static void qglfResolveUniform1f(GLint location, GLfloat x) static void QGLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x)
{ {
typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x); typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
@ -3019,7 +3019,7 @@ static void qglfResolveUniform1f(GLint location, GLfloat x)
funcs->uniform1f = qglfResolveUniform1f; funcs->uniform1f = qglfResolveUniform1f;
} }
static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v) static void QGLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v); typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
@ -3039,7 +3039,7 @@ static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat*
funcs->uniform1fv = qglfResolveUniform1fv; funcs->uniform1fv = qglfResolveUniform1fv;
} }
static void qglfResolveUniform1i(GLint location, GLint x) static void QGLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x)
{ {
typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x); typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
@ -3059,7 +3059,7 @@ static void qglfResolveUniform1i(GLint location, GLint x)
funcs->uniform1i = qglfResolveUniform1i; funcs->uniform1i = qglfResolveUniform1i;
} }
static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v) static void QGLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v); typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
@ -3079,7 +3079,7 @@ static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
funcs->uniform1iv = qglfResolveUniform1iv; funcs->uniform1iv = qglfResolveUniform1iv;
} }
static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y) static void QGLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
{ {
typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y); typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
@ -3099,7 +3099,7 @@ static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
funcs->uniform2f = qglfResolveUniform2f; funcs->uniform2f = qglfResolveUniform2f;
} }
static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v) static void QGLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v); typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
@ -3119,7 +3119,7 @@ static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat*
funcs->uniform2fv = qglfResolveUniform2fv; funcs->uniform2fv = qglfResolveUniform2fv;
} }
static void qglfResolveUniform2i(GLint location, GLint x, GLint y) static void QGLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y)
{ {
typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y); typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
@ -3139,7 +3139,7 @@ static void qglfResolveUniform2i(GLint location, GLint x, GLint y)
funcs->uniform2i = qglfResolveUniform2i; funcs->uniform2i = qglfResolveUniform2i;
} }
static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v) static void QGLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v); typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
@ -3159,7 +3159,7 @@ static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
funcs->uniform2iv = qglfResolveUniform2iv; funcs->uniform2iv = qglfResolveUniform2iv;
} }
static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) static void QGLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
{ {
typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z); typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
@ -3179,7 +3179,7 @@ static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z
funcs->uniform3f = qglfResolveUniform3f; funcs->uniform3f = qglfResolveUniform3f;
} }
static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v) static void QGLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v); typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
@ -3199,7 +3199,7 @@ static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat*
funcs->uniform3fv = qglfResolveUniform3fv; funcs->uniform3fv = qglfResolveUniform3fv;
} }
static void qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z) static void QGLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
{ {
typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z); typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
@ -3219,7 +3219,7 @@ static void qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
funcs->uniform3i = qglfResolveUniform3i; funcs->uniform3i = qglfResolveUniform3i;
} }
static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v) static void QGLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v); typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
@ -3239,7 +3239,7 @@ static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
funcs->uniform3iv = qglfResolveUniform3iv; funcs->uniform3iv = qglfResolveUniform3iv;
} }
static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) static void QGLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{ {
typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
@ -3259,7 +3259,7 @@ static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z
funcs->uniform4f = qglfResolveUniform4f; funcs->uniform4f = qglfResolveUniform4f;
} }
static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v) static void QGLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v); typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
@ -3279,7 +3279,7 @@ static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat*
funcs->uniform4fv = qglfResolveUniform4fv; funcs->uniform4fv = qglfResolveUniform4fv;
} }
static void qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) static void QGLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
{ {
typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w); typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
@ -3299,7 +3299,7 @@ static void qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLin
funcs->uniform4i = qglfResolveUniform4i; funcs->uniform4i = qglfResolveUniform4i;
} }
static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v) static void QGLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
{ {
typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v); typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
@ -3319,7 +3319,7 @@ static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
funcs->uniform4iv = qglfResolveUniform4iv; funcs->uniform4iv = qglfResolveUniform4iv;
} }
static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) static void QGLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{ {
typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
@ -3339,7 +3339,7 @@ static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean
funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv; funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
} }
static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) static void QGLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{ {
typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
@ -3359,7 +3359,7 @@ static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean
funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv; funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
} }
static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) static void QGLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{ {
typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
@ -3379,7 +3379,7 @@ static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean
funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv; funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
} }
static void qglfResolveUseProgram(GLuint program) static void QGLF_APIENTRY qglfResolveUseProgram(GLuint program)
{ {
typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program); typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program);
@ -3399,7 +3399,7 @@ static void qglfResolveUseProgram(GLuint program)
funcs->useProgram = qglfResolveUseProgram; funcs->useProgram = qglfResolveUseProgram;
} }
static void qglfResolveValidateProgram(GLuint program) static void QGLF_APIENTRY qglfResolveValidateProgram(GLuint program)
{ {
typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program); typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
@ -3419,7 +3419,7 @@ static void qglfResolveValidateProgram(GLuint program)
funcs->validateProgram = qglfResolveValidateProgram; funcs->validateProgram = qglfResolveValidateProgram;
} }
static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x) static void QGLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x); typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
@ -3439,7 +3439,7 @@ static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
funcs->vertexAttrib1f = qglfResolveVertexAttrib1f; funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
} }
static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values) static void QGLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values); typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
@ -3459,7 +3459,7 @@ static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv; funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
} }
static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) static void QGLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y); typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
@ -3479,7 +3479,7 @@ static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
funcs->vertexAttrib2f = qglfResolveVertexAttrib2f; funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
} }
static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values) static void QGLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values); typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
@ -3499,7 +3499,7 @@ static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv; funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
} }
static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) static void QGLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z); typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
@ -3519,7 +3519,7 @@ static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat
funcs->vertexAttrib3f = qglfResolveVertexAttrib3f; funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
} }
static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values) static void QGLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values); typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
@ -3539,7 +3539,7 @@ static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv; funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
} }
static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) static void QGLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
@ -3559,7 +3559,7 @@ static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat
funcs->vertexAttrib4f = qglfResolveVertexAttrib4f; funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
} }
static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values) static void QGLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values); typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
@ -3579,7 +3579,7 @@ static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv; funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
} }
static void qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) static void QGLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
{ {
typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);

View File

@ -59,6 +59,10 @@ QT_MODULE(OpenGL)
typedef ptrdiff_t qgl_GLintptr; typedef ptrdiff_t qgl_GLintptr;
typedef ptrdiff_t qgl_GLsizeiptr; typedef ptrdiff_t qgl_GLsizeiptr;
#ifdef Q_WS_WIN
# define QGLF_APIENTRY APIENTRY
#endif
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
# ifndef QGLF_APIENTRYP # ifndef QGLF_APIENTRYP
# ifdef QGLF_APIENTRY # ifdef QGLF_APIENTRY
@ -1945,6 +1949,9 @@ inline void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum
#ifndef GL_RGBA4 #ifndef GL_RGBA4
#define GL_RGBA4 0x8056 #define GL_RGBA4 0x8056
#endif #endif
#ifndef GL_BGRA
#define GL_BGRA 0x80E1
#endif
#ifndef GL_SAMPLE_ALPHA_TO_COVERAGE #ifndef GL_SAMPLE_ALPHA_TO_COVERAGE
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#endif #endif

View File

@ -90,7 +90,7 @@ protected:
// Wraps a QGLWidget // Wraps a QGLWidget
class QGLWidget; class QGLWidget;
class QGLWidgetGLPaintDevice : public QGLPaintDevice class Q_OPENGL_EXPORT QGLWidgetGLPaintDevice : public QGLPaintDevice
{ {
public: public:
QGLWidgetGLPaintDevice(); QGLWidgetGLPaintDevice();

View File

@ -63,7 +63,6 @@ private:
QWaylandEglIntegration *mEglIntegration; QWaylandEglIntegration *mEglIntegration;
QWaylandGLContext *mGLContext; QWaylandGLContext *mGLContext;
struct wl_egl_window *mWaylandEglWindow; struct wl_egl_window *mWaylandEglWindow;
EGLConfig mConfig;
const QWaylandWindow *mParentWindow; const QWaylandWindow *mParentWindow;
}; };

View File

@ -1,12 +1,11 @@
include (../../../eglconvenience/eglconvenience.pri)
LIBS += -lwayland-egl -lEGL LIBS += -lwayland-egl -lEGL
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
SOURCES += $$PWD/qwaylandeglintegration.cpp \ SOURCES += $$PWD/qwaylandeglintegration.cpp \
$$PWD/qwaylandglcontext.cpp \ $$PWD/qwaylandglcontext.cpp \
$$PWD/qwaylandeglwindow.cpp \ $$PWD/qwaylandeglwindow.cpp
$$PWD/../../../eglconvenience/qeglconvenience.cpp
HEADERS += $$PWD/qwaylandeglintegration.h \ HEADERS += $$PWD/qwaylandeglintegration.h \
$$PWD/qwaylandglcontext.h \ $$PWD/qwaylandglcontext.h \
$$PWD/qwaylandeglwindow.h \ $$PWD/qwaylandeglwindow.h
$$PWD/../../../eglconvenience/qeglconvenience.h \
gl_integration/wayland_egl/qwaylandeglinclude.h

View File

@ -44,6 +44,7 @@
#include <QtCore/QSize> #include <QtCore/QSize>
#include <wayland-client.h>
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>
class QWaylandBuffer { class QWaylandBuffer {

View File

@ -101,6 +101,12 @@ void QWaylandInputDevice::inputHandleMotion(void *data,
QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
QWaylandWindow *window = inputDevice->mPointerFocus; QWaylandWindow *window = inputDevice->mPointerFocus;
if (window == NULL) {
/* We destroyed the pointer focus surface, but the server
* didn't get the message yet. */
return;
}
inputDevice->mSurfacePos = QPoint(surface_x, surface_y); inputDevice->mSurfacePos = QPoint(surface_x, surface_y);
inputDevice->mGlobalPos = QPoint(x, y); inputDevice->mGlobalPos = QPoint(x, y);
inputDevice->mTime = time; inputDevice->mTime = time;
@ -120,6 +126,12 @@ void QWaylandInputDevice::inputHandleButton(void *data,
QWaylandWindow *window = inputDevice->mPointerFocus; QWaylandWindow *window = inputDevice->mPointerFocus;
Qt::MouseButton qt_button; Qt::MouseButton qt_button;
if (window == NULL) {
/* We destroyed the pointer focus surface, but the server
* didn't get the message yet. */
return;
}
switch (button) { switch (button) {
case 272: case 272:
qt_button = Qt::LeftButton; qt_button = Qt::LeftButton;
@ -229,6 +241,12 @@ void QWaylandInputDevice::inputHandleKey(void *data,
QEvent::Type type; QEvent::Type type;
char s[2]; char s[2];
if (window == NULL) {
/* We destroyed the keyboard focus surface, but the server
* didn't get the message yet. */
return;
}
code = key + inputDevice->mXkb->min_key_code; code = key + inputDevice->mXkb->min_key_code;
level = 0; level = 0;
@ -250,9 +268,6 @@ void QWaylandInputDevice::inputHandleKey(void *data,
sym = translateKey(sym, s, sizeof s); sym = translateKey(sym, s, sizeof s);
qWarning("keycode %d, sym %d, string %d, modifiers 0x%x",
code, sym, s[0], (int) inputDevice->mModifiers);
if (window) { if (window) {
QWindowSystemInterface::handleKeyEvent(window->widget(), QWindowSystemInterface::handleKeyEvent(window->widget(),
time, type, sym, time, type, sym,

View File

@ -44,6 +44,7 @@
#include "qwaylanddisplay.h" #include "qwaylanddisplay.h"
#include "qwaylandshmsurface.h" #include "qwaylandshmsurface.h"
#include "qwaylandshmwindow.h" #include "qwaylandshmwindow.h"
#include "qwaylandnativeinterface.h"
#include "qgenericunixfontdatabase.h" #include "qgenericunixfontdatabase.h"
@ -62,9 +63,15 @@ QWaylandIntegration::QWaylandIntegration(bool useOpenGL)
: mFontDb(new QGenericUnixFontDatabase()) : mFontDb(new QGenericUnixFontDatabase())
, mDisplay(new QWaylandDisplay()) , mDisplay(new QWaylandDisplay())
, mUseOpenGL(useOpenGL) , mUseOpenGL(useOpenGL)
, mNativeInterface(new QWaylandNativeInterface)
{ {
} }
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
{
return mNativeInterface;
}
QList<QPlatformScreen *> QList<QPlatformScreen *>
QWaylandIntegration::screens() const QWaylandIntegration::screens() const
{ {

View File

@ -63,12 +63,15 @@ public:
QPlatformFontDatabase *fontDatabase() const; QPlatformFontDatabase *fontDatabase() const;
QPlatformNativeInterface *nativeInterface() const;
private: private:
bool hasOpenGL() const; bool hasOpenGL() const;
QPlatformFontDatabase *mFontDb; QPlatformFontDatabase *mFontDb;
QWaylandDisplay *mDisplay; QWaylandDisplay *mDisplay;
bool mUseOpenGL; bool mUseOpenGL;
QPlatformNativeInterface *mNativeInterface;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -0,0 +1,72 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qwaylandnativeinterface.h"
#include "qwaylanddisplay.h"
#include "qwaylandwindow.h"
#include <QtGui/private/qapplication_p.h>
void *QWaylandNativeInterface::nativeResourceForWidget(const QByteArray &resourceString, QWidget *widget)
{
QByteArray lowerCaseResource = resourceString.toLower();
if (lowerCaseResource == "display")
return qPlatformScreenForWidget(widget)->display()->wl_display();
if (lowerCaseResource == "surface") {
return ((QWaylandWindow *) widget->platformWindow())->wl_surface();
}
return NULL;
}
QWaylandScreen * QWaylandNativeInterface::qPlatformScreenForWidget(QWidget *widget)
{
QWaylandScreen *screen;
if (widget) {
screen = static_cast<QWaylandScreen *>(QPlatformScreen::platformScreenForWidget(widget));
} else {
screen = static_cast<QWaylandScreen *>(QApplicationPrivate::platformIntegration()->screens()[0]);
}
return screen;
}

View File

@ -0,0 +1,60 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QWAYLANDNATIVEINTERFACE_H
#define QWAYLANDNATIVEINTERFACE_H
#include "qwaylandscreen.h"
#include <QtGui/QPlatformNativeInterface>
class QWaylandNativeInterface : public QPlatformNativeInterface
{
public:
void *nativeResourceForWidget(const QByteArray &resourceString,
QWidget *widget);
private:
static QWaylandScreen *qPlatformScreenForWidget(QWidget *widget);
};
#endif // QWAYLANDNATIVEINTERFACE_H

View File

@ -74,6 +74,9 @@ public:
void damage(const QRegion &region); void damage(const QRegion &region);
void waitForFrameSync(); void waitForFrameSync();
struct wl_surface *wl_surface() const { return mSurface; }
protected: protected:
struct wl_surface *mSurface; struct wl_surface *mSurface;
virtual void newSurfaceCreated(); virtual void newSurfaceCreated();

View File

@ -8,6 +8,7 @@ DEFINES += $$QMAKE_DEFINES_WAYLAND
SOURCES = main.cpp \ SOURCES = main.cpp \
qwaylandintegration.cpp \ qwaylandintegration.cpp \
qwaylandnativeinterface.cpp \
qwaylandshmsurface.cpp \ qwaylandshmsurface.cpp \
qwaylandinputdevice.cpp \ qwaylandinputdevice.cpp \
qwaylandcursor.cpp \ qwaylandcursor.cpp \
@ -17,6 +18,7 @@ SOURCES = main.cpp \
qwaylandshmwindow.cpp qwaylandshmwindow.cpp
HEADERS = qwaylandintegration.h \ HEADERS = qwaylandintegration.h \
qwaylandnativeinterface.h \
qwaylandcursor.h \ qwaylandcursor.h \
qwaylanddisplay.h \ qwaylanddisplay.h \
qwaylandwindow.h \ qwaylandwindow.h \