Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgsimpletexturenode.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
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 QSGSIMPLETEXTURENODE_H
5#define QSGSIMPLETEXTURENODE_H
6
7#include <QtQuick/qsgnode.h>
8#include <QtQuick/qsggeometry.h>
9#include <QtQuick/qsgtexturematerial.h>
10
12
14
15class Q_QUICK_EXPORT QSGSimpleTextureNode : public QSGGeometryNode
16{
17public:
19 ~QSGSimpleTextureNode() override;
20
21 void setRect(const QRectF &rect);
22 inline void setRect(qreal x, qreal y, qreal w, qreal h) { setRect(QRectF(x, y, w, h)); }
23 QRectF rect() const;
24
25 void setSourceRect(const QRectF &r);
27 QRectF sourceRect() const;
28
29 void setTexture(QSGTexture *texture);
30 QSGTexture *texture() const;
31
32 void setFiltering(QSGTexture::Filtering filtering);
33 QSGTexture::Filtering filtering() const;
34
36 NoTransform = 0x00,
37 MirrorHorizontally = 0x01,
38 MirrorVertically = 0x02
39 };
40 Q_DECLARE_FLAGS(TextureCoordinatesTransformMode, TextureCoordinatesTransformFlag)
41
42 void setTextureCoordinatesTransform(TextureCoordinatesTransformMode mode);
43 TextureCoordinatesTransformMode textureCoordinatesTransform() const;
44
45 void setOwnsTexture(bool owns);
46 bool ownsTexture() const;
47
48private:
49 QSGGeometry m_geometry;
50 QSGOpaqueTextureMaterial m_opaque_material;
51 QSGTextureMaterial m_material;
52
53 QRectF m_rect;
54
55 Q_DECLARE_PRIVATE(QSGSimpleTextureNode)
56};
57
58Q_DECLARE_OPERATORS_FOR_FLAGS(QSGSimpleTextureNode::TextureCoordinatesTransformMode)
59
61
62#endif // QSGSIMPLETEXTURENODE_H
\inmodule QtCore\reentrant
Definition qrect.h:484
The QSGGeometryNode class is used for all rendered content in the scene graph.
Definition qsgnode.h:188
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
Definition qsggeometry.h:15
The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the sc...
The QSGSimpleTextureNode class is provided for convenience to easily draw textured content using the ...
void setSourceRect(qreal x, qreal y, qreal w, qreal h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
TextureCoordinatesTransformFlag
The TextureCoordinatesTransformFlag enum is used to specify the mode used to generate texture coordin...
void setRect(qreal x, qreal y, qreal w, qreal h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QSGTextureMaterial class provides a convenient way of rendering textured geometry in the scene gr...
\inmodule QtQuick
Definition qsgtexture.h:20
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
Definition qsgtexture.h:34
rect
[4]
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLint GLint GLint GLint GLint x
[0]
GLenum mode
GLfloat GLfloat GLfloat w
[0]
GLboolean r
[2]
GLenum GLuint texture
GLint y
GLfloat GLfloat GLfloat GLfloat h
double qreal
Definition qtypes.h:187