Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/examples/opengl/pbuffers/glwidget.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the examples of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
    4040****************************************************************************/
    4141
    42 #include <QtOpenGL>
     42#ifndef GLWIDGET_H
     43#define GLWIDGET_H
     44
     45#include <QGLWidget>
     46
     47class Geometry;
     48class Cube;
     49class Tile;
     50QT_BEGIN_NAMESPACE
     51class QGLPixelBuffer;
     52QT_END_NAMESPACE
    4353
    4454class GLWidget : public QGLWidget
    4555{
    4656public:
    47     GLWidget(QWidget *parent);
     57    GLWidget(QWidget *parent = 0);
    4858    ~GLWidget();
     59
     60protected:
    4961    void initializeGL();
    50     void resizeGL(int w, int h);
    5162    void paintGL();
    52     void timerEvent(QTimerEvent *) { update(); }
    53     void mousePressEvent(QMouseEvent *) { killTimer(timerId); }
    54     void mouseReleaseEvent(QMouseEvent *) { timerId = startTimer(20); }
    55 
    56     void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp);
    57     void initCommon();
    58     void initPbuffer();
     63    void resizeGL(int width, int height);
     64    void mousePressEvent(QMouseEvent *) { setAnimationPaused(true); }
     65    void mouseReleaseEvent(QMouseEvent *) { setAnimationPaused(false); }
    5966
    6067private:
    61     GLfloat rot[3], xOffs[3], yOffs[3], xInc[3];
    62     GLuint pbufferList;
     68    void initializeGeometry();
     69    void initPbuffer();
     70    void initCommon();
     71    void perspectiveProjection();
     72    void orthographicProjection();
     73    void drawPbuffer();
     74    void setAnimationPaused(bool enable);
     75
     76    qreal aspect;
    6377    GLuint dynamicTexture;
    6478    GLuint cubeTexture;
    65     int timerId;
    6679    bool hasDynamicTextureUpdate;
     80    QGLPixelBuffer *pbuffer;
     81    Geometry *geom;
     82    Cube *cube;
     83    Tile *backdrop;
     84    QList<Cube *> cubes;
     85    QList<Tile *> tiles;
    6786
    68     QGLPixelBuffer *pbuffer;
    6987};
     88//! [3]
    7089
     90#endif
Note: See TracChangeset for help on using the changeset viewer.