1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DRENDER_QTEXTUREWRAPMODE_H |
5 | #define QT3DRENDER_QTEXTUREWRAPMODE_H |
6 | |
7 | #include <Qt3DRender/qt3drender_global.h> |
8 | #include <QtCore/QObject> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace Qt3DRender { |
13 | |
14 | class QTextureWrapModePrivate; |
15 | |
16 | class Q_3DRENDERSHARED_EXPORT QTextureWrapMode : public QObject |
17 | { |
18 | Q_OBJECT |
19 | Q_PROPERTY(WrapMode x READ x WRITE setX NOTIFY xChanged) |
20 | Q_PROPERTY(WrapMode y READ y WRITE setY NOTIFY yChanged) |
21 | Q_PROPERTY(WrapMode z READ z WRITE setZ NOTIFY zChanged) |
22 | |
23 | public: |
24 | enum WrapMode { |
25 | Repeat = 0x2901, // GL_REPEAT |
26 | MirroredRepeat = 0x8370, // GL_MIRRORED_REPEAT |
27 | ClampToEdge = 0x812F, // GL_CLAMP_TO_EDGE |
28 | ClampToBorder = 0x812D // GL_CLAMP_TO_BORDER |
29 | }; |
30 | Q_ENUM(WrapMode) // LCOV_EXCL_LINE |
31 | |
32 | explicit QTextureWrapMode(WrapMode wrapMode = ClampToEdge, QObject *parent = nullptr); |
33 | explicit QTextureWrapMode(WrapMode x, WrapMode y, WrapMode z, QObject *parent = nullptr); |
34 | ~QTextureWrapMode(); |
35 | |
36 | WrapMode x() const; |
37 | WrapMode y() const; |
38 | WrapMode z() const; |
39 | |
40 | public Q_SLOTS: |
41 | void setX(WrapMode x); |
42 | void setY(WrapMode y); |
43 | void setZ(WrapMode z); |
44 | |
45 | Q_SIGNALS: |
46 | void xChanged(WrapMode x); |
47 | void yChanged(WrapMode y); |
48 | void zChanged(WrapMode z); |
49 | |
50 | private: |
51 | Q_DECLARE_PRIVATE(QTextureWrapMode) |
52 | }; |
53 | |
54 | } // namespace Qt3DRender |
55 | |
56 | QT_END_NAMESPACE |
57 | |
58 | #endif // QT3DRENDER_QWRAPMODE_H |
59 | |