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
qsgtexturematerial.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 QSGTEXTUREMATERIAL_H
5#define QSGTEXTUREMATERIAL_H
6
7#include <QtQuick/qsgmaterial.h>
8#include <QtQuick/qsgtexture.h>
9
11
12class Q_QUICK_EXPORT QSGOpaqueTextureMaterial : public QSGMaterial
13{
14public:
16
17 QSGMaterialType *type() const override;
18 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override;
19 int compare(const QSGMaterial *other) const override;
20
21 void setTexture(QSGTexture *texture);
22 QSGTexture *texture() const { return m_texture; }
23
24 void setMipmapFiltering(QSGTexture::Filtering filteringType) { m_mipmap_filtering = filteringType; }
25 QSGTexture::Filtering mipmapFiltering() const { return QSGTexture::Filtering(m_mipmap_filtering); }
26
27 void setFiltering(QSGTexture::Filtering filteringType) { m_filtering = filteringType; }
28 QSGTexture::Filtering filtering() const { return QSGTexture::Filtering(m_filtering); }
29
30 void setHorizontalWrapMode(QSGTexture::WrapMode mode) { m_horizontal_wrap = mode; }
31 QSGTexture::WrapMode horizontalWrapMode() const { return QSGTexture::WrapMode(m_horizontal_wrap); }
32
34 QSGTexture::WrapMode verticalWrapMode() const { return QSGTexture::WrapMode(m_vertical_wrap); }
35
38
39protected:
41
48};
49
50
51class Q_QUICK_EXPORT QSGTextureMaterial : public QSGOpaqueTextureMaterial
52{
53public:
54 QSGMaterialType *type() const override;
55 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override;
56};
57
59
60#endif
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the sc...
QSGTexture::AnisotropyLevel anisotropyLevel() const
Returns this material's anistropy level.
QSGTexture::WrapMode verticalWrapMode() const
Returns this material's vertical wrap mode.
void setFiltering(QSGTexture::Filtering filteringType)
Sets the filtering to filtering.
void setVerticalWrapMode(QSGTexture::WrapMode mode)
Sets the vertical wrap mode to mode.
void setHorizontalWrapMode(QSGTexture::WrapMode mode)
Sets the horizontal wrap mode to mode.
void setAnisotropyLevel(QSGTexture::AnisotropyLevel level)
Sets this material's anistropy level to level.
QSGTexture::Filtering filtering() const
Returns this material's filtering mode.
void setMipmapFiltering(QSGTexture::Filtering filteringType)
Sets the mipmap mode to filtering.
QSGTexture::WrapMode horizontalWrapMode() const
Returns this material's horizontal wrap mode.
QSGTexture::Filtering mipmapFiltering() const
Returns this material's mipmap filtering mode.
QSGTexture * texture() const
Returns this texture material's texture.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
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
WrapMode
Specifies how the sampler should treat texture coordinates.
Definition qsgtexture.h:28
AnisotropyLevel
Specifies the anisotropic filtering level to be used when the texture is not screen aligned.
Definition qsgtexture.h:40
Combined button and popup list for selecting options.
GLenum mode
GLenum GLuint GLint level
GLenum type
GLenum GLuint texture
static int compare(quint64 a, quint64 b)
unsigned int uint
Definition qtypes.h:34
QSharedPointer< T > other(t)
[5]
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.