04b7641e85
- Add x11proto to redbear-full.toml package list - libxau recipe updated with x11proto dependency and custom build script - Fixes libxau build failure: 'Package xproto was not found'
76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
|
|
|
#ifndef QOPENGLVERTEXARRAYOBJECT_H
|
|
#define QOPENGLVERTEXARRAYOBJECT_H
|
|
|
|
#include <QtOpenGL/qtopenglglobal.h>
|
|
|
|
#ifndef QT_NO_OPENGL
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtGui/qopengl.h>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QOpenGLVertexArrayObjectPrivate;
|
|
|
|
class Q_OPENGL_EXPORT QOpenGLVertexArrayObject : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit QOpenGLVertexArrayObject(QObject* parent = nullptr);
|
|
~QOpenGLVertexArrayObject();
|
|
|
|
bool create();
|
|
void destroy();
|
|
bool isCreated() const;
|
|
GLuint objectId() const;
|
|
void bind();
|
|
void release();
|
|
|
|
class Binder
|
|
{
|
|
public:
|
|
inline Binder(QOpenGLVertexArrayObject *v)
|
|
: vao(v)
|
|
{
|
|
Q_ASSERT(v);
|
|
if (vao->isCreated() || vao->create())
|
|
vao->bind();
|
|
}
|
|
|
|
inline ~Binder()
|
|
{
|
|
release();
|
|
}
|
|
|
|
inline void release()
|
|
{
|
|
vao->release();
|
|
}
|
|
|
|
inline void rebind()
|
|
{
|
|
vao->bind();
|
|
}
|
|
|
|
private:
|
|
Q_DISABLE_COPY(Binder)
|
|
QOpenGLVertexArrayObject *vao;
|
|
};
|
|
|
|
private:
|
|
Q_DISABLE_COPY(QOpenGLVertexArrayObject)
|
|
Q_DECLARE_PRIVATE(QOpenGLVertexArrayObject)
|
|
Q_PRIVATE_SLOT(d_func(), void _q_contextAboutToBeDestroyed())
|
|
QOpenGLVertexArrayObject(QOpenGLVertexArrayObjectPrivate &dd);
|
|
};
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
#endif
|
|
|
|
#endif // QOPENGLVERTEXARRAYOBJECT_H
|