summaryrefslogtreecommitdiffstats
path: root/examples/opengl/shared/qtlogo.h
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2009-09-21 01:23:06 (GMT)
committerSarah Smith <sarah.j.smith@nokia.com>2009-09-21 01:23:06 (GMT)
commit11fed1f64f43593a2890e0a3f27b4e2e7ebde783 (patch)
tree99f57336eafe2403af7526154d8d4743f416333e /examples/opengl/shared/qtlogo.h
parent1b8d92b1ae453bd2d395658c7086d0049916e88f (diff)
downloadQt-11fed1f64f43593a2890e0a3f27b4e2e7ebde783.zip
Qt-11fed1f64f43593a2890e0a3f27b4e2e7ebde783.tar.gz
Qt-11fed1f64f43593a2890e0a3f27b4e2e7ebde783.tar.bz2
remove display lists and qt3d-ize overpainting/hellogl example
On the way to making opengl examples portable, remove display lists and go to triangles only. Use QMatrix4x4. While on the job use Qt/3D stylee to make the QtLogo as an example of 3D programming more Qt-like. Reviewed-by: Rhys Weatherley
Diffstat (limited to 'examples/opengl/shared/qtlogo.h')
-rw-r--r--examples/opengl/shared/qtlogo.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/examples/opengl/shared/qtlogo.h b/examples/opengl/shared/qtlogo.h
new file mode 100644
index 0000000..26508e1
--- /dev/null
+++ b/examples/opengl/shared/qtlogo.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTLOGO_H
+#define QTLOGO_H
+
+#include <QObject>
+#include <QtOpenGL>
+
+class Patch;
+class Geometry;
+
+//! [0]
+class QtLogo : public QObject
+{
+public:
+ QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
+ ~QtLogo();
+ void setColor(QColor c);
+ void draw() const;
+private:
+ void buildGeometry(int d, qreal s);
+
+ QList<Patch *> parts;
+ Geometry *geom;
+};
+//! [0]
+
+#endif // QTLOGO_H