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 Class Reference

The QSGTextureMaterial class provides a convenient way of rendering textured geometry in the scene graph. More...

#include <qsgtexturematerial.h>

+ Inheritance diagram for QSGTextureMaterial:
+ Collaboration diagram for QSGTextureMaterial:

Public Member Functions

QSGMaterialTypetype () const override
 
QSGMaterialShadercreateShader (QSGRendererInterface::RenderMode renderMode) const override
 
- Public Member Functions inherited from QSGOpaqueTextureMaterial
 QSGOpaqueTextureMaterial ()
 Creates a new QSGOpaqueTextureMaterial.
 
int compare (const QSGMaterial *other) const override
 
void setTexture (QSGTexture *texture)
 Sets the texture of this material to texture.
 
QSGTexturetexture () const
 Returns this texture material's texture.
 
void setMipmapFiltering (QSGTexture::Filtering filteringType)
 Sets the mipmap mode to filtering.
 
QSGTexture::Filtering mipmapFiltering () const
 Returns this material's mipmap filtering mode.
 
void setFiltering (QSGTexture::Filtering filteringType)
 Sets the filtering to filtering.
 
QSGTexture::Filtering filtering () const
 Returns this material's filtering mode.
 
void setHorizontalWrapMode (QSGTexture::WrapMode mode)
 Sets the horizontal wrap mode to mode.
 
QSGTexture::WrapMode horizontalWrapMode () const
 Returns this material's horizontal wrap mode.
 
void setVerticalWrapMode (QSGTexture::WrapMode mode)
 Sets the vertical wrap mode to mode.
 
QSGTexture::WrapMode verticalWrapMode () const
 Returns this material's vertical wrap mode.
 
void setAnisotropyLevel (QSGTexture::AnisotropyLevel level)
 Sets this material's anistropy level to level.
 
QSGTexture::AnisotropyLevel anisotropyLevel () const
 Returns this material's anistropy level.
 
- Public Member Functions inherited from QSGMaterial
 QSGMaterial ()
 
virtual ~QSGMaterial ()
 
QSGMaterial::Flags flags () const
 Returns the material's flags.
 
void setFlag (Flags flags, bool on=true)
 Sets the flags flags on this material if on is true; otherwise clears the attribute.
 
int viewCount () const
 

Additional Inherited Members

- Public Types inherited from QSGMaterial
enum  Flag {
  Blending = 0x0001 , RequiresDeterminant = 0x0002 , RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant , RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate ,
  NoBatching = 0x0010 , MultiView2 = 0x10000 , MultiView3 = 0x20000 , MultiView4 = 0x40000
}
 \value Blending Set this flag to true if the material requires blending to be enabled during rendering. More...
 
- Protected Attributes inherited from QSGOpaqueTextureMaterial
QSGTexturem_texture
 
uint m_filtering: 2
 
uint m_mipmap_filtering: 2
 
uint m_horizontal_wrap: 1
 
uint m_vertical_wrap: 1
 
uint m_anisotropy_level: 3
 
uint m_reserved: 23
 

Detailed Description

The QSGTextureMaterial class provides a convenient way of rendering textured geometry in the scene graph.

\inmodule QtQuick

Warning
This utility class is only functional when running with the default backend of the Qt Quick scenegraph.

The textured material will fill every pixel in a geometry with the supplied texture.

The geometry to be rendered with a texture material requires vertices in attribute location 0 and texture coordinates in attribute location 1. The texture coordinate is a 2-dimensional floating-point tuple. The QSGGeometry::defaultAttributes_TexturedPoint2D returns an attribute set compatible with this material.

The texture to be rendered can be set using setTexture(). How the texture should be rendered can be specified using setMipmapFiltering(), setFiltering(), setHorizontalWrapMode() and setVerticalWrapMode(). The rendering state is set on the texture instance just before it is bound.

The textured material respects the current matrix and the alpha channel of the texture. It will also respect the accumulated opacity in the scenegraph.

A texture material must have a texture set before it is used as a material in the scene graph.

Definition at line 51 of file qsgtexturematerial.h.

Member Function Documentation

◆ createShader()

QSGMaterialShader * QSGTextureMaterial::createShader ( QSGRendererInterface::RenderMode renderMode) const
overridevirtual

Reimplemented from QSGOpaqueTextureMaterial.

Definition at line 336 of file qsgtexturematerial.cpp.

References Q_UNUSED, and QSGMaterial::viewCount().

+ Here is the call graph for this function:

◆ type()

QSGMaterialType * QSGTextureMaterial::type ( ) const
overridevirtual

Reimplemented from QSGOpaqueTextureMaterial.

Definition at line 326 of file qsgtexturematerial.cpp.

References type().

Referenced by type().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: