1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef TEXTUREMATERIAL_H
43 #define TEXTUREMATERIAL_H
45 #include "qsgmaterial.h"
46 #include <qsgtexture.h>
52 QT_MODULE(Declarative)
55 class Q_DECLARATIVE_EXPORT QSGOpaqueTextureMaterial : public QSGMaterial
58 QSGOpaqueTextureMaterial();
60 virtual QSGMaterialType *type() const;
61 virtual QSGMaterialShader *createShader() const;
62 virtual int compare(const QSGMaterial *other) const;
64 void setTexture(QSGTexture *texture);
65 QSGTexture *texture() const { return m_texture; }
67 void setMipmapFiltering(QSGTexture::Filtering filtering) { m_mipmap_filtering = filtering; }
68 QSGTexture::Filtering mipmapFiltering() const { return (QSGTexture::Filtering) m_mipmap_filtering; }
70 void setFiltering(QSGTexture::Filtering filtering) { m_filtering = filtering; }
71 QSGTexture::Filtering filtering() const { return (QSGTexture::Filtering) m_filtering; }
73 void setHorizontalWrapMode(QSGTexture::WrapMode mode) { m_horizontal_wrap = mode; }
74 QSGTexture::WrapMode horizontalWrapMode() const { return (QSGTexture::WrapMode) m_horizontal_wrap; }
76 void setVerticalWrapMode(QSGTexture::WrapMode mode) { m_vertical_wrap = mode; }
77 QSGTexture::WrapMode verticalWrapMode() const { return (QSGTexture::WrapMode) m_vertical_wrap; }
80 QSGTexture *m_texture;
83 uint m_mipmap_filtering: 2;
84 uint m_horizontal_wrap : 1;
85 uint m_vertical_wrap: 1;
91 class Q_DECLARATIVE_EXPORT QSGTextureMaterial : public QSGOpaqueTextureMaterial
94 virtual QSGMaterialType *type() const;
95 virtual QSGMaterialShader *createShader() const;
102 #endif // TEXTUREMATERIAL_H