#ifndef __OPEN_GL_WIDGET_HEADER__ #define __OPEN_GL_WIDGET_HEADER__ #include "../guiClass.h" #include #include #include #include #include #include #include #include //class Bubble; class MainWindow; //QT_FORWARD_DECLARE_CLASS(QOpenGLTexture) //QT_FORWARD_DECLARE_CLASS(QOpenGLShader) //QT_FORWARD_DECLARE_CLASS(QOpenGLShaderProgram) class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions { //Q_OBJECT public: GLWidget(MainWindow *mw, bool button, const QColor &background); ~GLWidget(); public slots: void setScaling(int scale); void setLogo(); void setTexture(); void setShowBubbles(bool); void setTransparent(bool transparent); private slots: void handleButtonPress(); protected: void resizeGL(int w, int h) Q_DECL_OVERRIDE; void paintGL() Q_DECL_OVERRIDE; void initializeGL() Q_DECL_OVERRIDE; private: void paintTexturedCube(); void paintQtLogo(); void createGeometry(); //void createBubbles(int number); void quad(qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4); void extrude(qreal x1, qreal y1, qreal x2, qreal y2); MainWindow *m_mainWindow; qreal m_fAngle; qreal m_fScale; //bool m_showBubbles; QVector m_vertices; QVector m_normals; bool m_qtLogo; //QList m_bubbles; int m_frames; QTime m_time; QOpenGLShader *m_vshader1; QOpenGLShader *m_fshader1; QOpenGLShader *m_vshader2; QOpenGLShader *m_fshader2; QOpenGLShaderProgram *m_program1; QOpenGLShaderProgram *m_program2; QOpenGLTexture *m_texture; QOpenGLBuffer m_vbo1; QOpenGLBuffer m_vbo2; int m_vertexAttr1; int m_normalAttr1; int m_matrixUniform1; int m_vertexAttr2; int m_normalAttr2; int m_texCoordAttr2; int m_matrixUniform2; int m_textureUniform2; bool m_transparent; QPushButton *m_btn; bool m_hasButton; QColor m_background; }; #endif